1 /****************************************************************************** 2 * 3 * Copyright(c) 2007 - 2017 Realtek Corporation. 4 * 5 * This program is free software; you can redistribute it and/or modify it 6 * under the terms of version 2 of the GNU General Public License as 7 * published by the Free Software Foundation. 8 * 9 * This program is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 * more details. 13 * 14 *****************************************************************************/ 15 #ifndef __RTW_AP_H_ 16 #define __RTW_AP_H_ 17 18 19 #ifdef CONFIG_AP_MODE 20 21 /* external function */ 22 extern void rtw_indicate_sta_assoc_event(_adapter *padapter, struct sta_info *psta); 23 extern void rtw_indicate_sta_disassoc_event(_adapter *padapter, struct sta_info *psta); 24 25 26 void init_mlme_ap_info(_adapter *padapter); 27 void free_mlme_ap_info(_adapter *padapter); 28 /* void update_BCNTIM(_adapter *padapter); */ 29 void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *data, u8 len); 30 void rtw_remove_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index); 31 void _update_beacon(_adapter *padapter, u8 ie_id, u8 *oui, u8 tx, const char *tag); 32 #define update_beacon(adapter, ie_id, oui, tx) _update_beacon((adapter), (ie_id), (oui), (tx), __func__) 33 34 void rtw_ap_update_sta_ra_info(_adapter *padapter, struct sta_info *psta); 35 36 void expire_timeout_chk(_adapter *padapter); 37 void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta); 38 void rtw_start_bss_hdl_after_chbw_decided(_adapter *adapter); 39 void start_bss_network(_adapter *padapter, struct createbss_parm *parm); 40 int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len); 41 void rtw_ap_restore_network(_adapter *padapter); 42 43 #if CONFIG_RTW_MACADDR_ACL 44 void rtw_set_macaddr_acl(_adapter *adapter, int mode); 45 int rtw_acl_add_sta(_adapter *adapter, const u8 *addr); 46 int rtw_acl_remove_sta(_adapter *adapter, const u8 *addr); 47 #endif /* CONFIG_RTW_MACADDR_ACL */ 48 49 u8 rtw_ap_set_pairwise_key(_adapter *padapter, struct sta_info *psta); 50 int rtw_ap_set_group_key(_adapter *padapter, u8 *key, u8 alg, int keyid); 51 int rtw_ap_set_wep_key(_adapter *padapter, u8 *key, u8 keylen, int keyid, u8 set_tx); 52 53 #ifdef CONFIG_NATIVEAP_MLME 54 void associated_clients_update(_adapter *padapter, u8 updated, u32 sta_info_type); 55 void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta); 56 u8 bss_cap_update_on_sta_leave(_adapter *padapter, struct sta_info *psta); 57 void sta_info_update(_adapter *padapter, struct sta_info *psta); 58 void ap_sta_info_defer_update(_adapter *padapter, struct sta_info *psta); 59 u8 ap_free_sta(_adapter *padapter, struct sta_info *psta, bool active, u16 reason, bool enqueue); 60 int rtw_sta_flush(_adapter *padapter, bool enqueue); 61 int rtw_ap_inform_ch_switch(_adapter *padapter, u8 new_ch, u8 ch_offset); 62 void start_ap_mode(_adapter *padapter); 63 void stop_ap_mode(_adapter *padapter); 64 #endif 65 66 void rtw_ap_update_bss_chbw(_adapter *adapter, WLAN_BSSID_EX *bss, u8 ch, u8 bw, u8 offset); 67 bool rtw_ap_chbw_decision(_adapter *adapter, s16 req_ch, s8 req_bw, s8 req_offset, u8 *ch, u8 *bw, u8 *offset, u8 *chbw_allow); 68 69 #ifdef CONFIG_AUTO_AP_MODE 70 extern void rtw_start_auto_ap(_adapter *adapter); 71 #endif /* CONFIG_AUTO_AP_MODE */ 72 void rtw_ap_acdata_control(_adapter *padapter, u8 power_mode); 73 74 void rtw_ap_parse_sta_capability(_adapter *adapter, struct sta_info *sta, u8 *cap); 75 u16 rtw_ap_parse_sta_supported_rates(_adapter *adapter, struct sta_info *sta, u8 *tlv_ies, u16 tlv_ies_len); 76 u16 rtw_ap_parse_sta_security_ie(_adapter *adapter, struct sta_info *sta, struct rtw_ieee802_11_elems *elems); 77 void rtw_ap_parse_sta_wmm_ie(_adapter *adapter, struct sta_info *sta, u8 *tlv_ies, u16 tlv_ies_len); 78 void rtw_ap_parse_sta_ht_ie(_adapter *adapter, struct sta_info *sta, struct rtw_ieee802_11_elems *elems); 79 void rtw_ap_parse_sta_vht_ie(_adapter *adapter, struct sta_info *sta, struct rtw_ieee802_11_elems *elems); 80 81 void update_bmc_sta(_adapter *padapter); 82 83 #ifdef CONFIG_BMC_TX_RATE_SELECT 84 void rtw_update_bmc_sta_tx_rate(_adapter *adapter); 85 #endif 86 87 void rtw_process_ht_action_smps(_adapter *padapter, u8 *ta, u8 ctrl_field); 88 void rtw_process_public_act_bsscoex(_adapter *padapter, u8 *pframe, uint frame_len); 89 int rtw_ht_operation_update(_adapter *padapter); 90 u8 rtw_ap_sta_linking_state_check(_adapter *adapter); 91 92 #ifdef CONFIG_SWTIMER_BASED_TXBCN 93 void tx_beacon_handlder(struct dvobj_priv *pdvobj); 94 void tx_beacon_timer_handlder(void *ctx); 95 #endif /*CONFIG_SWTIMER_BASED_TXBCN*/ 96 97 #endif /* end of CONFIG_AP_MODE */ 98 #endif /*__RTW_AP_H_*/ 99