blob: aa7e5144183c5ce9330af535477600a0dc014437
1 | #ifndef __TV_KEY_DATA_H__ |
2 | #define __TV_KEY_DATA_H__ |
3 | |
4 | #include <pthread.h> |
5 | #include <stdint.h> |
6 | |
7 | #include "../tv/CTvLog.h" |
8 | #define LOG_TAG "TvKeyData" |
9 | |
10 | #define SSM_CR_RGBOGO_LEN (256) |
11 | #define SSM_CR_RGBOGO_CHKSUM_LEN (2) |
12 | #define SSM_HDMI_PORT_MAX (3) |
13 | #define SSM_HDMI_EDID_SIZE (256) |
14 | |
15 | #define CS_KEY_DATA_NAME_DEV_PATH "/sys/class/aml_keys/aml_keys/key_name" |
16 | #define CS_KEY_DATA_READ_DEV_PATH "/sys/class/aml_keys/aml_keys/key_read" |
17 | #define CS_KEY_DATA_WRITE_DEV_PATH "/sys/class/aml_keys/aml_keys/key_write" |
18 | |
19 | #define CS_MAC_KEY_NAME "mac" |
20 | #define CS_BARCODE_KEY_NAME "usid" |
21 | #define CS_RX_HDCP_KEY_NAME "rxhdcp20" |
22 | #define CS_PROJECT_ID_KEY_NAME "projid" |
23 | |
24 | int ReadKeyData(const char *key_name, unsigned char data_buf[]); |
25 | int WriteKeyData(const char *key_name, int wr_size, char data_buf[]); |
26 | |
27 | int KeyData_SaveProjectID(int rw_val); |
28 | int KeyData_ReadProjectID(); |
29 | |
30 | int KeyData_GetMacAddressDataLen(); |
31 | int KeyData_ReadMacAddress(unsigned char data_buf[]); |
32 | int KeyData_SaveMacAddress(unsigned char data_buf[]); |
33 | |
34 | int KeyData_GetBarCodeDataLen(); |
35 | int KeyData_ReadBarCode(unsigned char data_buf[]); |
36 | int KeyData_SaveBarCode(unsigned char data_buf[]); |
37 | |
38 | int SSMReadHDCPKey(unsigned char hdcp_key_buf[]); |
39 | int SSMSaveHDCPKey(unsigned char hdcp_key_buf[]); |
40 | int SSMSetHDCPKey(); |
41 | int SSMGetHDCPKeyDataLen(); |
42 | int SSMRefreshHDCPKey(); |
43 | |
44 | |
45 | int SSMReadHDMIEdid(int port, unsigned char hdmi_edid_buf[]); |
46 | int SSMSetHDMIEdid(int port); |
47 | |
48 | int SSMSaveRGBOGOValue(int offset, int size, unsigned char data_buf[]); |
49 | int SSMReadRGBOGOValue(int offset, int size, unsigned char data_buf[]); |
50 | |
51 | int SSMReadAudioNoLinePoints(int offset, int size, unsigned char tmp_buf[]); |
52 | int SSMSaveAudioNoLinePoints(int offset, int size, unsigned char tmp_buf[]); |
53 | |
54 | #ifdef __cplusplus |
55 | extern "C" { |
56 | #endif |
57 | |
58 | #ifdef __cplusplus |
59 | } |
60 | #endif |
61 | |
62 | #endif //__TV_KEY_DATA_H__ |
63 |