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