1 /****************************************************************************** 2 * 3 * Copyright(c) 2007 - 2019 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_WDS_H_ 16 #define __RTW_WDS_H_ 17 18 #ifdef CONFIG_AP_MODE 19 struct rtw_wds_path { 20 u8 dst[ETH_ALEN]; 21 rtw_rhash_head rhash; 22 _adapter *adapter; 23 struct sta_info __rcu *next_hop; 24 rtw_rcu_head rcu; 25 systime last_update; 26 }; 27 28 struct rtw_wds_table { 29 rtw_rhashtable rhead; 30 }; 31 32 #define RTW_WDS_PATH_EXPIRE (600 * HZ) 33 34 /* Maximum number of paths per interface */ 35 #define RTW_WDS_MAX_PATHS 1024 36 37 int rtw_wds_nexthop_lookup(_adapter *adapter, const u8 *da, u8 *ra); 38 39 struct rtw_wds_path *rtw_wds_path_lookup(_adapter *adapter, const u8 *dst); 40 void dump_wpath(void *sel, _adapter *adapter); 41 42 void rtw_wds_path_expire(_adapter *adapter); 43 44 struct rtw_wds_path *rtw_wds_path_add(_adapter *adapter, const u8 *dst, struct sta_info *next_hop); 45 void rtw_wds_path_assign_nexthop(struct rtw_wds_path *path, struct sta_info *sta); 46 47 int rtw_wds_pathtbl_init(_adapter *adapter); 48 void rtw_wds_pathtbl_unregister(_adapter *adapter); 49 50 void rtw_wds_path_flush_by_nexthop(struct sta_info *sta); 51 #endif /* CONFIG_AP_MODE */ 52 53 struct rtw_wds_gptr_table { 54 rtw_rhashtable rhead; 55 }; 56 57 void dump_wgptr(void *sel, _adapter *adapter); 58 bool rtw_rx_wds_gptr_check(_adapter *adapter, const u8 *src); 59 void rtw_tx_wds_gptr_update(_adapter *adapter, const u8 *src); 60 void rtw_wds_gptr_expire(_adapter *adapter); 61 int rtw_wds_gptr_tbl_init(_adapter *adapter); 62 void rtw_wds_gptr_tbl_unregister(_adapter *adapter); 63 64 #endif /* __RTW_WDSH_ */ 65 66