1 /* 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef __SAL_CFG_H__ 17 #define __SAL_CFG_H__ 18 #include <hi_types.h> 19 #include <hi_diag.h> 20 21 /* defined in tee_hks lib. */ 22 extern hi_void hks_handle_secure_call(void); 23 extern hi_void hks_handle_secure_pki_provision(void); 24 25 #define INIT_CONFIG_XTAL_COMPESATION 1 26 27 typedef struct { 28 hi_s32 init_cfg_rf_high_temp_threshold; 29 hi_s32 init_cfg_rf_low_temp_threshold; 30 hi_s32 init_cfg_rf_ppm_compesation; 31 } rf_cfg_xtal_compesation; 32 33 /* read rf xtal compesation from Factory NV */ 34 hi_u32 hi_get_rf_xtal_compesation_param(rf_cfg_xtal_compesation *rf_cfg_xtal_compesatioan); 35 36 typedef hi_u32 (*oam_log_msg0_func)(hi_u32 msg_id, hi_u16 msg_level); 37 typedef hi_u32 (*oam_log_msg1_func)(hi_u32 msg_id, hi_u32 d0, hi_u16 msg_level); 38 typedef hi_u32 (*oam_log_msg2_func)(hi_u32 msg_id, hi_u32 d0, hi_u32 d1, hi_u16 msg_level); 39 typedef hi_u32 (*oam_log_msg3_func)(hi_u32 msg_id, hi_u32 d0, hi_u32 d1, hi_u32 d2, hi_u16 msg_level); 40 typedef hi_u32 (*oam_log_msg4_func)(hi_u32 msg_id, diag_log_msg log_msg, hi_u16 msg_level); 41 typedef hi_u32 (*oam_log_msg_buffer_func)(hi_u32 msg_id, hi_pvoid buffer, hi_u16 size, hi_u16 msg_level); 42 43 typedef struct oam_log_hook_func_ { 44 oam_log_msg0_func oam_log_msg0; 45 oam_log_msg1_func oam_log_msg1; 46 oam_log_msg2_func oam_log_msg2; 47 oam_log_msg3_func oam_log_msg3; 48 oam_log_msg4_func oam_log_msg4; 49 oam_log_msg_buffer_func oam_log_msg_buffer; 50 }oam_log_hook_func; 51 52 hi_void oam_log_register_hook_func(const oam_log_hook_func *hook_func); 53 54 hi_void hi_diag_register_wifi_log(); 55 56 #endif 57 58