• 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: Header file for hal_device_rom.c.
15  */
16 
17 #ifndef HAL_DEVICE_ROM_H
18 #define HAL_DEVICE_ROM_H
19 
20 /*****************************************************************************
21     头文件包含
22 *****************************************************************************/
23 #include "osal_types.h"
24 #include "hal_common_ops_rom.h"
25 
26 #ifdef __cplusplus
27 #if __cplusplus
28 extern "C" {
29 #endif
30 #endif
31 
32 #define WLAN_HAL_OHTER_BSS_ID                   6   /* 其他BSS的广播ID */
33 #define WLAN_HAL_OTHER_BSS_OTHER_ID             7   /* 来自其他BSS的其他帧(组播、单播) */
34 /* P2P 中断统计 */
35 typedef struct {
36     osal_u32 ct_window_end_count;
37     osal_u32 noa_absent_start_count;
38     osal_u32 noa_absent_end_count;
39     osal_u32 absent_start_count;
40     osal_u32 absent_end_count;
41 } hal_p2p_ps_stat_stru;
42 
43 /* 设备级 中断统计信息,!!!!本结构中修改任何一个成员都需要通知SDT同步修改,否则解析错误!!!! */
44 typedef struct {
45     osal_u32 radar_detect_cnt; /* 检测到雷达 */
46     /* P2P 节能统计 */
47     hal_p2p_ps_stat_stru p2p_stat;
48 } hal_irq_device_stats_stru;
49 
50 typedef struct tag_hal_hal_device_stru {
51     hal_to_dmac_device_stru hal_device_base;
52     /* device上挂的指针,使用时需要强转(后续需要使用宏替代,是不是指链表模板) */
53     hal_vap_stru *vap_list[HAL_MAX_VAP_NUM];
54     hal_irq_device_stats_stru irq_stats;
55 
56     osal_u8 cur_cali_chn; /* 当前校准的通道 */
57     osal_u8 cali_data_received  : 1, /* device是否收到host下发的校准数据 */
58           dbdc_cali           : 1,
59           noa_type            : 2, /* 表示软件模拟触发一次雷达中断 */
60           wur_ac : 4;
61     osal_u8 vap_num; /* device下的vap的数量 */
62     osal_u8 wur_ap_vap_id : 4, /* wur在ap模式下使用,指示当前ap的vap id */
63             wur_twbtt_vap_id : 4; /* 指示wur的twbtt功能借用了哪个vap的TSF能力 */
64 
65     uintptr_t *_rom; /* ROM化后资源扩展指针 */
66 } hal_device_stru;
67 
68 typedef struct {
69     volatile oal_bool_enum_uint8 fcs_done;
70 } hal_fcs_mgr_stru;
71 
72 /*****************************************************************************
73     函数声明
74 *****************************************************************************/
75 osal_void hal_alg_isr_hook_run(osal_u8 vap_id, hal_device_stru *hal_device, hal_isr_type_enum_uint8 isr_type);
76 osal_u8 hal_device_calc_up_vap_num(const hal_to_dmac_device_stru *hal_device);
77 osal_u8 hal_get_hal_fcs_done(osal_void);
78 osal_void hal_set_hal_fcs_done(osal_u8 param);
79 osal_void hal_device_state_idle_set_rx_filter_reg(const hal_to_dmac_device_stru *hal_device);
80 osal_void hal_device_reset_bcn_rf_chain(hal_to_dmac_device_stru *hal_device, osal_u8 up_vap_num);
81 osal_u32 hal_device_update_phy_chain(hal_to_dmac_device_stru *hal_device, oal_bool_enum_uint8 set_channel);
82 osal_void hal_device_state_scan_set_rx_filter_reg(const hal_to_dmac_device_stru *hal_device);
83 osal_void hal_device_state_work_set_rx_filter_reg(hal_to_dmac_device_stru *hal_device);
84 oal_bool_enum_uint8 hal_device_find_is_ap_up(hal_to_dmac_device_stru *hal_device);
85 
86 #ifdef __cplusplus
87 #if __cplusplus
88 }
89 #endif
90 #endif
91 
92 #endif /* end of hal_device_rom.h */
93