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: dmac m2s head 15 * Create: 2020-7-5 16 */ 17 18 #ifndef __HMAC_M2S_H__ 19 #define __HMAC_M2S_H__ 20 21 #ifdef _PRE_WLAN_FEATURE_M2S 22 /***************************************************************************** 23 1 其他头文件包含 24 *****************************************************************************/ 25 #include "oal_types.h" 26 #include "frw_ext_if.h" 27 #include "mac_frame.h" 28 #include "mac_ie.h" 29 #include "hmac_device.h" 30 #include "hmac_user.h" 31 #include "hmac_vap.h" 32 #include "hmac_feature_main.h" 33 34 #ifdef __cplusplus 35 #if __cplusplus 36 extern "C" { 37 #endif 38 #endif 39 40 /***************************************************************************** 41 3 枚举定义 42 *****************************************************************************/ 43 #define M2S_MIMO_RX_CNT_THRESHOLD 2 44 #define M2S_SISO_RX_CNT_THRESHOLD 8 45 #define M2S_RX_UCAST_CNT_THRESHOLD 10 46 47 #define M2S_ACTION_SENT_CNT_THRESHOLD 3 48 49 #define M2S_RX_STATISTICS_START_TIME 1000 50 51 /***************************************************************************** 52 STRUCT定义 53 *****************************************************************************/ 54 typedef struct { 55 frw_timeout_stru m2s_delay_switch_statistics_timer; 56 osal_u16 rx_nss_mimo_count; 57 osal_u16 rx_nss_siso_count; 58 osal_u16 rx_nss_ucast_count; 59 oal_bool_enum_uint8 rx_nss_statistics_start_flag; 60 } hmac_vap_m2s_rx_statistics_stru; 61 62 typedef struct { 63 hmac_vap_m2s_rx_statistics_stru hmac_vap_m2s_rx_statistics; /* STA当前切换初始模式不满足要求时,开启统计变量 */ 64 oal_bool_enum_uint8 m2s_wait_complete; /* m2s切换是否正在执行,多vap都完成才能执行device状态切换 */ 65 wlan_m2s_action_type_enum_uint8 m2s_switch_ori_type; /* STA当前关联ap的切换初始模式 */ 66 oal_bool_enum_uint8 action_send_state; /* STA action帧发送是否成功 */ 67 osal_u8 action_send_cnt; 68 } hmac_vap_m2s_stru; 69 70 /***************************************************************************** 71 10 函数声明 72 *****************************************************************************/ 73 osal_u32 hmac_m2s_proc_vap_init(hmac_vap_stru *hmac_vap); 74 osal_void hmac_m2s_proc_vap_deinit(hmac_vap_stru *hmac_vap); 75 76 #ifdef _PRE_WIFI_DEBUG 77 osal_void hmac_m2s_mgr_param_info(const hal_to_dmac_device_stru *hal_device); 78 osal_void hmac_m2s_show_blacklist_in_list(const hal_to_dmac_device_stru *hal_device); 79 #endif 80 osal_void hmac_m2s_update_switch_mgr_param(hal_to_dmac_device_stru *hal_device, hal_m2s_event_tpye_uint16 m2s_event); 81 wlan_nss_enum_uint8 hmac_m2s_get_bss_max_nss(const hmac_vap_stru *hmac_vap, const oal_netbuf_stru *netbuf, 82 osal_u16 frame_len, oal_bool_enum_uint8 assoc_status); 83 osal_u8 hmac_m2s_scan_get_num_sounding_dim(const oal_netbuf_stru *netbuf, osal_u16 frame_len); 84 oal_bool_enum_uint8 hmac_m2s_get_bss_support_opmode(const hmac_vap_stru *hmac_vap, osal_u8 *frame_body, 85 osal_u16 frame_len); 86 osal_u32 hmac_m2s_d2h_vap_info_syn(hmac_vap_stru *hmac_vap); 87 osal_void hmac_m2s_send_action_complete_check(hmac_vap_stru *hmac_vap, const mac_tx_ctl_stru *tx_ctl); 88 osal_void hmac_m2s_mgr_back_to_mimo_check(hal_to_dmac_device_stru *hal_device); 89 osal_void hmac_m2s_update_vap_capbility(const hmac_device_stru *hmac_device, hmac_vap_stru *hmac_vap); 90 osal_void hmac_m2s_update_user_capbility(hmac_user_stru *hmac_user, const hmac_vap_stru *hmac_vap); 91 osal_void hmac_m2s_switch_update_vap_capbility(const hal_to_dmac_device_stru *hal_device); 92 osal_void hmac_m2s_switch_update_device_capbility(hal_to_dmac_device_stru *hal_device, hmac_device_stru *hmac_device); 93 osal_void hmac_m2s_switch_same_channel_vaps_begin(hal_to_dmac_device_stru *hal_device, hmac_device_stru *hmac_device, 94 hmac_vap_stru *mac_vap1, hmac_vap_stru *mac_vap2); 95 #ifdef _PRE_WLAN_FEATURE_DBAC 96 osal_void hmac_m2s_switch_dbac_vaps_begin(hal_to_dmac_device_stru *hal_device, hmac_device_stru *hmac_device, 97 hmac_vap_stru *mac_vap1, hmac_vap_stru *mac_vap2); 98 #endif 99 osal_void hmac_m2s_switch_update_hal_chain_capbility(hal_to_dmac_device_stru *hal_device, 100 oal_bool_enum_uint8 set_channel); 101 oal_bool_enum_uint8 hmac_m2s_custom_switch_check(const hal_to_dmac_device_stru *hal_device); 102 osal_void hmac_m2s_command_mode_force_to_mimo(hal_to_dmac_device_stru *hal_device); 103 osal_void hmac_m2s_spec_mode_force_to_mimo(hal_to_dmac_device_stru *hal_device); 104 osal_void hmac_m2s_spec_mode_band_change_check(hal_to_dmac_device_stru *hal_device, 105 wlan_channel_band_enum_uint8 set_band); 106 osal_void hmac_m2s_switch_update_vap_tx_chain_capbility(const hal_to_dmac_device_stru *hal_device); 107 osal_void hmac_m2s_spec_update_hal_device_capbility(hal_to_dmac_device_stru *hal_device, 108 wlan_channel_band_enum_uint8 band); 109 oal_bool_enum_uint8 hmac_m2s_spec_need_switch_keep_check(const hal_to_dmac_device_stru *hal_device); 110 oal_bool_enum_uint8 hmac_m2s_spec_support_siso_switch_check(const hal_to_dmac_device_stru *hal_device, 111 const hmac_device_stru *hmac_device, wlan_m2s_trigger_mode_enum_uint8 trigger_mode); 112 osal_void hmac_m2s_spec_update_vap_sw_capbility(const hmac_device_stru *hmac_device, hmac_vap_stru *hmac_vap, 113 wlan_nss_enum_uint8 nss_num); 114 osal_void hmac_config_m2s_assoc_state_syn(const hmac_vap_stru *hmac_vap); 115 osal_void hmac_config_m2s_disassoc_state_syn(hmac_vap_stru *hmac_vap); 116 oal_bool_enum_uint8 hmac_m2s_assoc_vap_find_in_device_blacklist(const hal_to_dmac_device_stru *hal_device); 117 osal_u32 hmac_m2s_check_blacklist_in_list(const hmac_vap_stru *hmac_vap, osal_u8 *index); 118 osal_void hmac_m2s_action_frame_type_query(const hmac_vap_stru *hmac_vap, wlan_m2s_action_type_enum_uint8 *action_type); 119 osal_void hmac_m2s_switch_protect_trigger(hmac_vap_stru *hmac_vap); 120 osal_void hmac_m2s_send_action_frame(hmac_vap_stru *hmac_vap); 121 osal_void hmac_m2s_rx_rate_nss_process(hmac_vap_stru *hmac_vap, const dmac_rx_ctl_stru *cb_ctrl, 122 const mac_ieee80211_frame_stru *frame_hdr); 123 oal_bool_enum_uint8 hmac_m2s_switch_apply_and_confirm(hal_to_dmac_device_stru *hal_device, osal_u16 m2s_type, 124 wlan_m2s_trigger_mode_enum_uint8 trigger_mode); 125 osal_void hmac_m2s_switch_vap_off(hal_to_dmac_device_stru *hal_device, hmac_device_stru *hmac_device, 126 hmac_vap_stru *hmac_vap); 127 osal_u32 hmac_m2s_switch_device_begin(hmac_device_stru *hmac_device, hal_to_dmac_device_stru *hal_device); 128 osal_void hmac_m2s_switch_device_end(hal_to_dmac_device_stru *hal_device); 129 osal_void hmac_m2s_nss_and_bw_alg_notify(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user, 130 oal_bool_enum_uint8 nss_change, oal_bool_enum_uint8 bw_change); 131 osal_u32 hmac_m2s_switch(hal_to_dmac_device_stru *hal_device, hal_m2s_event_tpye_uint16 m2s_event, 132 oal_bool_enum_uint8 hw_switch); 133 osal_void hmac_m2s_mimo_to_miso(hal_to_dmac_device_stru *hal_device, hal_m2s_event_tpye_uint16 m2s_event); 134 osal_void hmac_m2s_mimo_to_siso(hal_to_dmac_device_stru *hal_device, hal_m2s_event_tpye_uint16 m2s_event); 135 osal_void hmac_m2s_siso_to_mimo(hal_to_dmac_device_stru *hal_device, hal_m2s_event_tpye_uint16 m2s_event); 136 osal_void hmac_m2s_siso_to_miso(hal_to_dmac_device_stru *hal_device, hal_m2s_event_tpye_uint16 m2s_event); 137 osal_void hmac_m2s_miso_to_mimo(hal_to_dmac_device_stru *hal_device, hal_m2s_event_tpye_uint16 m2s_event); 138 osal_void hmac_m2s_miso_to_siso(hal_to_dmac_device_stru *hal_device, hal_m2s_event_tpye_uint16 m2s_event); 139 osal_void hmac_m2s_siso_to_siso(hal_to_dmac_device_stru *hal_device, hal_m2s_event_tpye_uint16 m2s_event); 140 osal_u32 hmac_m2s_handle_event(hal_to_dmac_device_stru *hal_device, osal_u16 type, osal_u16 datalen, osal_u8 *data); 141 osal_void hmac_m2s_fsm_attach(hal_to_dmac_device_stru *hal_device); 142 osal_void hmac_m2s_fsm_detach(hal_to_dmac_device_stru *hal_device); 143 osal_void hmac_m2s_mgmt_switch_judge(hal_to_dmac_device_stru *hal_device, const hmac_vap_stru *hmac_vap, 144 osal_char ant0_rssi_in, osal_char ant1_rssi_in); 145 146 #ifdef __cplusplus 147 #if __cplusplus 148 } 149 #endif 150 #endif 151 152 #endif /* end of _PRE_WLAN_FEATURE_M2S */ 153 154 #endif /* end of hmac_m2s.h */ 155