• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  * Description: 前端对外提供接口---- 只能包含类型定义,不允许包含实际的函数声明,同样也不能包含校准内部头文件。
15  */
16 
17 #ifndef __FE_EXTERN_IF_DEVICE_H__
18 #define __FE_EXTERN_IF_DEVICE_H__
19 #include "hal_common_ops_rom.h"
20 #include "hal_commom_ops_type_rom.h"
21 
22 #ifdef __cplusplus
23 #if __cplusplus
24 extern "C" {
25 #endif
26 #endif
27 
28 #define HAL_2G_CHANNEL_NUM (13)
29 
30 typedef enum {
31     CCA_ED_TYPE_20TH = 0,
32     CCA_ED_TYPE_40TH,
33 } cca_ed_type_enum;
34 
35 /* rf dev 状态机状态枚举 */
36 typedef enum {
37     HAL_RF_STATE_IDLE = 0,         /* idle状态 */
38     HAL_RF_STATE_CALI = 1,         /* cali状态 */
39     HAL_RF_STATE_WORK = 2,         /* work状态 */
40     HAL_RF_STATE_PS   = 3,         /* powersave状态 */
41     HAL_RF_STATE_BUTT              /* 最大状态 */
42 } hal_rf_state_info;
43 
44 /* 信道参数结构体 */
45 typedef struct {
46     wlan_channel_band_enum_uint8       band;          /* 频段(2g,5g) */
47     wlan_channel_bandwidth_enum_uint8  bw;            /* 带宽(20M,40M,80M) */
48     osal_u8                            ch_num;        /* 信道号 */
49     osal_u8                            ch_idx;        /* 信道索引 */
50 } hal_rf_chn_param;
51 
52 typedef osal_s8 (*fe_rf_get_customized_cca_ed_cb)(osal_u32 cca_ed_type, wlan_channel_band_enum_uint8 band);
53 typedef osal_void (*online_cali_proc_set_channel_cb)(hal_to_dmac_device_stru *device, osal_u8 channel_num,
54     wlan_channel_band_enum_uint8 band, osal_u8 channel_idx, wlan_channel_bandwidth_enum_uint8 bandwidth);
55 typedef osal_void (*online_cali_proc_tx_send_cb)(hal_to_dmac_device_stru *hal_device,
56     hal_tx_txop_alg_stru *txop_alg, wlan_frame_type_enum_uint8 frame_type);
57 typedef osal_void (*online_cali_get_pdet_val_cb)(hal_tx_complete_event_stru *tx_comp_event);
58 typedef osal_void (*online_cali_proc_tx_complete_cb)(osal_u8 vap_id, hal_to_dmac_device_stru *hal_device,
59     hal_tx_dscr_stru *curr_dscr, hal_tx_complete_event_stru *tx_comp_event);
60 
61 // rom化代码调用hook类型定义
62 typedef osal_void (*fe_rf_disable_abb_cb)(osal_u8 rf_id);
63 typedef osal_void (*fe_hal_rf_set_channel_info_cb)(hal_rf_chan_info *rf_chan);
64 typedef osal_void (*fe_rf_dev_set_ops_ext_cb)(osal_u8 cfg);
65 typedef osal_u32 (*fe_rf_dev_init_cb)(osal_u8 rf_id);
66 typedef osal_void (*fe_hal_proc_rf_work_cb)(osal_u8 rf_id);
67 typedef osal_void (*fe_hal_proc_rf_sleep_cb)(osal_u8 rf_id);
68 typedef osal_void (*fe_hal_rf_open_close_tx_cb)(osal_u8 rf_id, osal_u8 flag);
69 typedef osal_void (*fe_hal_rf_open_close_pll_cb)(osal_u8 rf_id, osal_u8 pll_idx, osal_u8 flag);
70 typedef osal_void (*fe_hal_rf_open_close_ldo_cb)(osal_u8 rf_id, osal_u8 flag);
71 typedef osal_u8 (*fe_rf_fsm_get_state_cb)(osal_u8 rf_id);
72 typedef osal_void (*fe_rf_set_rf_channel_cb)(const hal_rf_chn_param *chn_para);
73 typedef osal_void (*fe_rf_dev_sleep_cb)(osal_u8 rf_id);
74 typedef osal_void (*fe_rf_proc_rf_awake_cb)(osal_void);
75 typedef osal_void (*fe_rf_proc_rf_sleep_cb)(osal_void);
76 typedef osal_void (*fe_rf_dev_enable_tx_cb)(osal_u8 rf_id);
77 typedef osal_void (*fe_rf_enable_rf_tx_cb)(osal_void);
78 typedef osal_void (*fe_rf_disable_rf_tx_cb)(osal_void);
79 
80 #ifdef __cplusplus
81 #if __cplusplus
82 }
83 #endif
84 #endif
85 #endif