• 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_fsm_rom.c.
15  */
16 
17 #ifndef HAL_DEVICE_FSM_ROM_H
18 #define HAL_DEVICE_FSM_ROM_H
19 
20 /*****************************************************************************
21     1 头文件包含
22 *****************************************************************************/
23 #include "osal_types.h"
24 #include "hal_common_ops_rom.h"
25 #include "hal_ext_if_rom.h"
26 
27 #ifdef __cplusplus
28 #if __cplusplus
29 extern "C" {
30 #endif
31 #endif
32 #define MAC_HAL_FSM_TIMER_IDLE_TIMEOUT        20
33 /*****************************************************************************
34     函数声明
35 *****************************************************************************/
36 osal_void hal_device_fsm_attach(hal_to_dmac_device_stru *hal_device);
37 osal_void hal_device_fsm_detach(hal_to_dmac_device_stru *hal_device);
38 osal_void hal_device_handle_event(hal_to_dmac_device_stru *hal_device, osal_u16 type, osal_u16 datalen, osal_u8 *data);
39 osal_u32 hal_device_fsm_trans_to_state(hal_dev_fsm_stru *hal_dev_fsm, osal_u8 state, osal_u16 event);
40 osal_void hal_device_state_idle_entry(osal_void *ctx);
41 osal_void hal_device_state_idle_exit(osal_void *ctx);
42 osal_u32 hal_device_state_idle_event(osal_void *ctx, osal_u16 event, osal_u16 event_data_len, osal_void *event_data);
43 osal_void hal_device_state_work_entry(osal_void *ctx);
44 osal_void hal_device_state_work_exit(osal_void *ctx);
45 osal_u32 hal_device_state_work_event(osal_void *ctx, osal_u16 event, osal_u16 event_data_len, osal_void *event_data);
46 osal_void hal_device_state_scan_entry(osal_void *ctx);
47 osal_void hal_device_state_scan_exit(osal_void *ctx);
48 osal_u32 hal_device_state_scan_event(osal_void *ctx, osal_u16 event, osal_u16 event_data_len, osal_void *event_data);
49 
50 osal_u8 hal_device_get_mac_pa_switch(osal_void);
51 osal_void hal_device_set_mac_pa_switch(osal_u8 val);
52 osal_void hal_device_work_sub_state_trans(hal_to_dmac_device_stru *hal_device);
53 
54 osal_u8 hal_dev_fsm_get_curr_state(osal_void);
55 osal_s32 hal_dev_fsm_sync_state(osal_u8 curr_state, osal_u8 sub_state);
56 osal_void hal_device_set_pm_bitmap(hal_to_dmac_device_stru *hal_device, osal_u8 vap_id,
57     hal_device_work_sub_state_info state_trans_to);
58 osal_void hal_dev_pm_work_sub_state(hal_to_dmac_device_stru *hal_device, osal_u8 vap_id,
59     hal_device_work_sub_state_info state_trans_to);
60 
61 osal_void hal_device_enter_rf_sleep_mode_mark(hal_to_dmac_device_stru *hal_device, oal_bool_enum_uint8 ps_mode_ever);
62 hal_work_sub_state_uint8 hal_dev_fsm_get_curr_substate(osal_void);
63 osal_void hal_dev_sync_mac_pa_switch_to_dev(osal_u8 mac_pa_switch);
64 osal_void hal_device_state_init_entry(osal_void *ctx);
65 osal_void hal_device_state_init_exit(osal_void *ctx);
66 osal_u32 hal_device_state_init_event(osal_void *ctx, osal_u16 event, osal_u16 event_data_len, osal_void *event_data);
67 osal_void hal_device_handle_event(hal_to_dmac_device_stru *hal_device, osal_u16 type, osal_u16 datalen, osal_u8 *data);
68 osal_u32 hal_device_fsm_trans_to_state(hal_dev_fsm_stru *hal_dev_fsm, osal_u8 state, osal_u16 event);
69 osal_void hal_device_fsm_info(hal_to_dmac_device_stru *hal_device);
70 osal_u8 hal_device_get_mac_pa_switch(osal_void);
71 osal_void hal_device_set_mac_pa_switch(osal_u8 val);
72 osal_void hal_dev_change_work_sub_state(hal_work_sub_state_uint8 work_sub_state, osal_u8 hal_vap_id);
73 osal_void hal_dev_sync_work_vap_bitmap(osal_u32 work_vap_bitmap);
74 osal_void hal_pm_enable_front_end_to_dev(hal_to_dmac_device_stru *hal_dev, osal_bool enable_paldo);
75 osal_void hal_dev_sync_work_rf_to_dev(osal_u8 rf_id);
76 osal_void hal_dev_req_sync_pm_bitmap(osal_u8 hal_vap_id, osal_u8 work_sub_state);
77 
78 typedef osal_u32 (*hal_device_scan_param_cb)(hal_to_dmac_device_stru *hal_device, hal_scan_params_stru *hal_scan_params,
79     const hal_scan_info_stru *hal_scan_info);
80 typedef osal_u32 (*hal_device_scan_pause_cb)(hal_to_dmac_device_stru *hal_device,
81     hal_scan_pause_type_enum_uint8 hal_san_pause_type);
82 
83 typedef osal_void (*hal_fsm_hmsg2d_init_rx_dscr_cb)(hal_to_dmac_device_stru *hal_device);
84 typedef osal_void (*hal_fsm_hmsg2d_destory_rx_dscr_cb)(hal_to_dmac_device_stru *hal_device);
85 typedef osal_void (*hal_fsm_hmsg2d_idle_to_sleep_prepare_cb)(osal_void);
86 typedef osal_void (*hal_fsm_hmsg2d_front_end_to_dev_cb)(hal_to_dmac_device_stru *hal_dev, osal_bool enable_paldo);
87 typedef osal_void (*hal_fsm_hmsg2d_work_vap_bitmap_cb)(osal_u32 work_vap_bitmap);
88 typedef osal_void (*hal_fsm_hmsg2d_sync_pm_bitmap_cb)(osal_u8 hal_vap_id, osal_u8 work_sub_state);
89 typedef osal_void (*hal_fsm_hmsg2d_work_to_dev_cb)(osal_u8 rf_id);
90 
91 osal_void hal_fsm_idle_to_sleep_prepare(osal_void *dmac_vap, osal_void *msg);
92 osal_s32 hal_dev_fsm_init_rx_dscr(osal_void *dmac_vap, osal_void *msg);
93 osal_s32 hal_dev_fsm_destroy_rx_dscr(osal_void *dmac_vap, osal_void *msg);
94 osal_void hal_dev_sync_sub_work_to_rf(hal_to_dmac_device_stru *hal_dev, osal_u8 rf_id);
95 
96 typedef osal_void (*hal_device_hw_init_cb)(hal_to_dmac_device_stru *hal_device);
97 #ifdef __cplusplus
98 #if __cplusplus
99 }
100 #endif
101 #endif
102 
103 #endif /* end of hal_device_fsm_rom.h */
104