hc
2023-02-13 e440ec23c5a540cdd3f7464e8779219be6fd3d95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
 * Copyright (c) 2015 South Silicon Valley Microelectronics Inc.
 * Copyright (c) 2015 iComm Corporation
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
 
#ifndef _CFG_H_
#define _CFG_H_
#include <linux/kthread.h>
 
#define SAR_XTAL_INDEX     (0)
#define SAR_TXGAIN_INDEX    (1)
#define THERMAL_MONITOR_TIME (10 * HZ)
#define DEFAULT_CFG_BIN_NAME "/tmp/flash.bin"
#define SEC_CFG_BIN_NAME "/system/etc/wifi/ssv6051/flash.bin"
enum {
    SAR_LVL_LT,
    SAR_LVL_RT,
    SAR_LVL_HT,
    SAR_LVL_INVALID
};
 
struct flash_thermal_info {
    u32 rt;
    u32 lt;
    u32 ht;
    u8 lt_ts;
    u8 ht_ts;
    u16 reserve;
};
typedef struct t_WIFI_FLASH_CCFG {
    //16bytes
    u16 chip_id;
    u16 sid;
    u32 date;
    u16 version;
    u16 reserve_1;
    u32 reserve_2;
    //16bytes
    struct flash_thermal_info sar_rlh[2];
#if 0
    u32 x_rt;
    u32 x_lt;
    u32 x_ht;
    u8 x_tt_lt;
    u8 x_tt_ht;
    u16 reserve_3;
    //16bytes
    u32 g_rt;
    u32 g_lt;
    u32 g_ht;
    u8 g_tt_lt;
    u8 g_tt_ht;
    u16 reserve_4;
#endif
} WIFI_FLASH_CCFG;
 
 
struct t_sar_info {
    u32 lvl;
    u32 value;
    struct flash_thermal_info *p;
};
 
void thermal_monitor(struct work_struct *work);
int get_flash_info(struct ssv_softc *sc);
void flash_hexdump(void);
 
#endif