1 /* 2 * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 18 19 #ifndef __HMAC_FSM_H__ 20 #define __HMAC_FSM_H__ 21 22 /* **************************************************************************** 23 1 其他头文件包含 24 **************************************************************************** */ 25 #include "oal_ext_if.h" 26 #include "hmac_main.h" 27 #include "hmac_vap.h" 28 #include "hmac_rx_filter.h" 29 #include "hmac_config.h" 30 31 #ifdef __cplusplus 32 #if __cplusplus 33 extern "C" { 34 #endif 35 #endif 36 37 /* **************************************************************************** 38 2 宏定义 39 **************************************************************************** */ 40 typedef hi_u32 (*hmac_fsm_func)(hmac_vap_stru *hmac_vap, hi_void *p_param); 41 42 /* **************************************************************************** 43 3 枚举定义 44 **************************************************************************** */ 45 /* 状态机输入类型枚举 */ 46 typedef enum { 47 /* AP STA共有的输入类型 */ 48 HMAC_FSM_INPUT_RX_MGMT, 49 HMAC_FSM_INPUT_RX_DATA, 50 HMAC_FSM_INPUT_TX_DATA, 51 HMAC_FSM_INPUT_TIMER0_OUT, 52 HMAC_FSM_INPUT_MISC, /* TBTT 异常 等其他输入类型 */ 53 54 /* AP 独有的输入类型 */ 55 HMAC_FSM_INPUT_START_REQ, 56 57 /* STA独有的输入类型 */ 58 HMAC_FSM_INPUT_SCAN_REQ, 59 HMAC_FSM_INPUT_JOIN_REQ, 60 HMAC_FSM_INPUT_AUTH_REQ, 61 HMAC_FSM_INPUT_ASOC_REQ, 62 HMAC_FSM_INPUT_LISTEN_REQ, /* 监听请求 */ 63 HMAC_FSM_INPUT_LISTEN_TIMEOUT, 64 HMAC_FSM_INPUT_SCHED_SCAN_REQ, /* PNO调度扫描请求 */ 65 HMAC_FSM_INPUT_TYPE_BUTT 66 } hmac_fsm_input_type_enum; 67 typedef hi_u8 hmac_fsm_input_type_enum_uint8; 68 69 #define HMAC_FSM_AP_INPUT_TYPE_BUTT (HMAC_FSM_INPUT_RX_MGMT + 1) 70 #define HMAC_FSM_STA_INPUT_TYPE_BUTT HMAC_FSM_INPUT_TYPE_BUTT 71 #define HMAC_SWITCH_STA_PSM_PERIOD 120000 /* staut打开低功耗超时的时间参考1101 120s */ 72 73 /* MISC输入类型的子类型定义 */ 74 typedef enum { 75 HMAC_MISC_TBTT, 76 HMAC_MISC_ERROR, 77 HMAC_MISC_RADAR, 78 79 HMAC_MISC_BUTT 80 } hmac_misc_input_enum; 81 typedef hi_u8 hmac_misc_input_enum_uint8; 82 83 /* **************************************************************************** 84 4 STRUCT定义 85 **************************************************************************** */ 86 /* MISC输入类型,入参结构体定义 */ 87 typedef struct { 88 hmac_misc_input_enum_uint8 type; 89 hi_u8 auc_resv[3]; /* 3 保留字节 */ 90 hi_void *data; 91 } hmac_misc_input_stru; 92 93 /* **************************************************************************** 94 5 函数声明 95 **************************************************************************** */ 96 hi_u32 hmac_fsm_handle_scan_req(const mac_vap_stru *mac_vap, mac_scan_req_stru *scan_params); 97 hi_void hmac_fsm_change_state(hmac_vap_stru *hmac_vap, mac_vap_state_enum_uint8 vap_state); 98 99 #ifdef __cplusplus 100 #if __cplusplus 101 } 102 #endif 103 #endif 104 105 #endif /* __HMAC_FSM_H__ */ 106