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: hmac_beacon_rom.c 的头文件 15 * Date: 2020-07-07 16 */ 17 18 #ifndef HMAC_BEACON_H 19 #define HMAC_BEACON_H 20 21 /***************************************************************************** 22 1 其他头文件包含 23 *****************************************************************************/ 24 #include "hmac_vap.h" 25 #include "mac_resource_ext.h" 26 #include "mac_vap_ext.h" 27 28 #ifdef __cplusplus 29 #if __cplusplus 30 extern "C" { 31 #endif 32 #endif 33 34 /***************************************************************************** 35 2 宏定义 36 *****************************************************************************/ 37 #define HMAC_WMM_QOS_PARAMS_HDR_LEN 8 38 #define HMAC_MAX_WAIT_BEACON_TIMES 5 39 40 #define WLAN_PROTECTION_NON_ERP_AGING_THRESHOLD (60) /* ERP 老化计数最大值 */ 41 #define WLAN_PROTECTION_NON_HT_AGING_THRESHOLD (60) /* HT 老化计数最大值 */ 42 43 /* 接收或者发送成功门限增值 */ 44 #define LINKLOSS_THRESHOLD_INCR 1 45 /* 用于计算linkloss门限的最大beacon周期 */ 46 #define LINKLOSS_THRESHOLD_BEACON_MAX_INTVAL 400 47 48 #define LINKLOSS_PROBE_REQ_MIN_CNT 10 /* linkloss发送probe req最小阈值 */ 49 #define LINKLOSS_PORBE_REQ_MAX_CNT 60 /* linkloss发送probe req最大阈值 */ 50 #define LINKLOSS_PROBE_REQ_MIN_MOD 3 /* 每3次tbtt中断发送一次probe req */ 51 #define LINKLOSS_PROBE_REQ_MAX_MOD 10 /* 每10次tbtt中断发送一次probe req */ 52 53 #define RX_DATA_RATE (50000) /* 50M */ 54 #define STA_TBTT_INTERVAL_TH 5 // STA tbtt执行间隔阈值 55 /***************************************************************************** 56 4 全局变量声明 57 *****************************************************************************/ 58 59 /***************************************************************************** 60 7 STRUCT定义 61 *****************************************************************************/ 62 /* beacon帧需要更新的信息元素偏移量 */ 63 typedef struct { 64 osal_u16 cap_offset; 65 osal_u16 bss_load_offset; 66 osal_u16 wmm_offset; 67 osal_u16 ht_cap_offset; 68 osal_u16 ht_operation_offset; 69 osal_u16 erp_offset; 70 osal_u16 pwr_constrain_offset; 71 osal_u16 tpc_report_offset; 72 osal_u16 tim_offset; 73 osal_u8 wmm_update_flag; 74 osal_u8 auc_resv[1]; 75 } hmac_beacon_ie_offset_stru; 76 77 /***************************************************************************** 78 10 函数声明 79 *****************************************************************************/ 80 extern osal_void hmac_sta_post_bw_verify_switch(const hmac_vap_stru *hmac_vap, 81 hmac_sta_bw_switch_type_enum_enum_uint8 verify_reslt); 82 osal_u32 hmac_sta_set_bandwith_handler(hmac_vap_stru *hmac_vap, wlan_channel_bandwidth_enum_uint8 sta_new_bandwidth); 83 osal_u32 hmac_beacon_alloc(hmac_vap_stru *hmac_vap); 84 osal_u32 hmac_beacon_free(hmac_vap_stru *hmac_vap); 85 osal_s32 hmac_tbtt_event_handler(hmac_vap_stru *hmac_vap, frw_msg *msg); 86 osal_u32 hmac_tbtt_event_sta(osal_void *arg); 87 osal_void hmac_vap_linkloss_channel_clean(hmac_vap_stru *hmac_vap, oal_netbuf_stru *netbuf); 88 osal_u32 hmac_sta_up_rx_beacon_check(hmac_vap_stru *hmac_vap, oal_netbuf_stru *netbuf, osal_u8 *go_on); 89 osal_u16 hmac_encap_beacon(hmac_vap_stru *hmac_vap, osal_u8 *beacon_buffer); 90 osal_void hmac_sta_beacon_offload_test(hmac_vap_stru *hmac_vap, osal_u8 *host_sleep); 91 osal_u32 hmac_protection_update_mib_ap(hmac_vap_stru *hmac_vap); 92 osal_u32 hmac_protection_del_user(hmac_vap_stru *hmac_vap, hmac_user_stru *hmac_user); 93 osal_void hmac_protection_stop_timer(hmac_vap_stru *hmac_vap); 94 osal_u32 hmac_set_protection_mode(hmac_vap_stru *hmac_vap, const hmac_user_stru *hmac_user, 95 wlan_prot_mode_enum_uint8 prot_mode); 96 osal_void hmac_ap_up_rx_obss_beacon(hmac_vap_stru *hmac_vap, oal_netbuf_stru *netbuf); 97 osal_void hmac_ap_wait_start_rx_obss_beacon(hmac_device_stru *hmac_device, const hmac_vap_stru *hmac_vap, 98 oal_netbuf_stru *netbuf); 99 osal_void hmac_vap_linkloss_init(hmac_vap_stru *hmac_vap); 100 osal_void hmac_vap_linkloss_clean(hmac_vap_stru *hmac_vap); 101 osal_s32 hmac_config_set_linkloss_params(hmac_vap_stru *hmac_vap, frw_msg *msg); 102 osal_u32 hmac_irq_tbtt_ap_isr(osal_u8 mac_vap_id); 103 osal_void hmac_sta_stop_tbtt_timer(hmac_vap_stru *hmac_vap); 104 osal_void hmac_sta_align_tbtt_timer(hmac_vap_stru *hmac_vap, oal_bool_enum_uint8 need_addition); 105 #ifdef __cplusplus 106 #if __cplusplus 107 } 108 #endif 109 #endif 110 111 #endif /* end of hmac_beacon.h */ 112