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 * 文 件 名 : hmac_fsm.h 15 * 生成日期 : 2013年6月18日 16 * 功能描述 : hmac_fsm.c 的头文件 17 */ 18 19 #ifndef __HMAC_FSM_H__ 20 #define __HMAC_FSM_H__ 21 22 /***************************************************************************** 23 1 其他头文件包含 24 *****************************************************************************/ 25 #include "hmac_vap.h" 26 #include "hmac_rx_filter.h" 27 #include "hmac_config.h" 28 29 #if defined (WIN32) 30 #include "plat_pm_wlan.h" 31 #endif 32 33 #ifdef __cplusplus 34 #if __cplusplus 35 extern "C" { 36 #endif 37 #endif 38 39 #undef THIS_FILE_ID 40 #define THIS_FILE_ID OAM_FILE_ID_HMAC_FSM_H 41 /***************************************************************************** 42 2 宏定义 43 *****************************************************************************/ 44 typedef osal_u32(*hmac_fsm_func)(hmac_vap_stru *hmac_vap, osal_void *p_param); 45 46 extern osal_u32 hmac_config_sta_update_rates_etc(hmac_vap_stru *hmac_vap, 47 mac_cfg_mode_param_stru *cfg_mode, mac_bss_dscr_stru *bss_dscr); 48 49 /***************************************************************************** 50 3 枚举定义 51 *****************************************************************************/ 52 /* 状态机输入类型枚举 */ 53 typedef enum { 54 /* AP STA共有的输入类型 */ 55 HMAC_FSM_INPUT_RX_MGMT, 56 HMAC_FSM_INPUT_RX_DATA, 57 HMAC_FSM_INPUT_TX_DATA, 58 HMAC_FSM_INPUT_TIMER0_OUT, 59 HMAC_FSM_INPUT_LISTEN_REQ, /* listen请求 */ 60 HMAC_FSM_INPUT_LISTEN_TIMEOUT, 61 HMAC_FSM_INPUT_MISC, /* TBTT 异常 等其他输入类型 */ 62 63 /* AP 独有的输入类型 */ 64 HMAC_FSM_INPUT_START_REQ, 65 66 /* STA独有的输入类型 */ 67 HMAC_FSM_INPUT_SCAN_REQ, 68 HMAC_FSM_INPUT_JOIN_REQ, 69 HMAC_FSM_INPUT_AUTH_REQ, 70 HMAC_FSM_INPUT_ASOC_REQ, 71 #ifdef _PRE_WLAN_FEATURE_PNO_SCAN 72 HMAC_FSM_INPUT_SCHED_SCAN_REQ, /* PNO调度扫描请求 */ 73 #endif 74 75 HMAC_FSM_INPUT_TYPE_BUTT 76 } hmac_fsm_input_type_enum; 77 typedef osal_u8 hmac_fsm_input_type_enum_uint8; 78 79 #define HMAC_FSM_AP_INPUT_TYPE_BUTT (HMAC_FSM_INPUT_MISC + 1) 80 #define HMAC_FSM_STA_INPUT_TYPE_BUTT HMAC_FSM_INPUT_TYPE_BUTT 81 #define HMAC_SWITCH_STA_PSM_PERIOD 120000 // staut打开低功耗超时的时间120s 82 #define HMAC_SWITCH_STA_PSM_MAX_CNT (HMAC_SWITCH_STA_PSM_PERIOD / WLAN_SLEEP_TIMER_PERIOD) 83 84 /* MISC输入类型的子类型定义 */ 85 typedef enum { 86 HMAC_MISC_TBTT, 87 HMAC_MISC_ERROR, 88 HMAC_MISC_RADAR, 89 90 HMAC_MISC_BUTT 91 } hmac_misc_input_enum; 92 typedef osal_u8 hmac_misc_input_enum_uint8; 93 94 /***************************************************************************** 95 4 全局变量声明 96 *****************************************************************************/ 97 98 /***************************************************************************** 99 5 消息头定义 100 *****************************************************************************/ 101 102 /***************************************************************************** 103 6 消息定义 104 *****************************************************************************/ 105 106 /***************************************************************************** 107 7 STRUCT定义 108 *****************************************************************************/ 109 /* MISC输入类型,入参结构体定义 */ 110 typedef struct { 111 hmac_misc_input_enum_uint8 type; 112 osal_u8 auc_resv[3]; 113 osal_void *p_data; 114 } hmac_misc_input_stru; 115 116 /***************************************************************************** 117 8 UNION定义 118 *****************************************************************************/ 119 120 /***************************************************************************** 121 9 OTHERS定义 122 *****************************************************************************/ 123 124 /***************************************************************************** 125 10 函数声明 126 *****************************************************************************/ 127 extern osal_void hmac_fsm_init_etc(osal_void); 128 extern osal_u32 hmac_fsm_call_func_ap_etc(hmac_vap_stru *hmac_vap, 129 hmac_fsm_input_type_enum_uint8 input, osal_void *p_param); 130 extern osal_u32 hmac_fsm_call_func_sta_etc(hmac_vap_stru *hmac_vap, 131 hmac_fsm_input_type_enum_uint8 input, osal_void *p_param); 132 extern osal_void hmac_fsm_change_state_etc(hmac_vap_stru *hmac_vap, mac_vap_state_enum_uint8 vap_state); 133 134 #ifdef __cplusplus 135 #if __cplusplus 136 } 137 #endif 138 #endif 139 140 #endif /* end of hmac_fsm.h */ 141