1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /****************************************************************************** 3 * 4 * Copyright(c) 2007 - 2020 Realtek Corporation. 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of version 2 of the GNU General Public License as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 * more details. 14 * 15 *****************************************************************************/ 16 #ifndef __RTW_ROCH_H__ 17 #define __RTW_ROCH_H__ 18 19 #include <drv_types.h> 20 21 struct rtw_roch_parm; 22 23 #if (defined(CONFIG_P2P) && defined(CONFIG_CONCURRENT_MODE)) || defined(CONFIG_IOCTL_CFG80211) 24 struct roch_info { 25 #ifdef CONFIG_CONCURRENT_MODE 26 _timer ap_roch_ch_switch_timer; /* Used to switch the channel between legacy AP and listen state. */ 27 #ifdef CONFIG_IOCTL_CFG80211 28 u32 min_home_dur; /* min duration for traffic, home_time */ 29 u32 max_away_dur; /* max acceptable away duration, home_away_time */ 30 #endif 31 #endif 32 33 #ifdef CONFIG_IOCTL_CFG80211 34 _timer remain_on_ch_timer; 35 u8 restore_channel; 36 struct ieee80211_channel remain_on_ch_channel; 37 enum nl80211_channel_type remain_on_ch_type; 38 ATOMIC_T ro_ch_cookie_gen; 39 u64 remain_on_ch_cookie; 40 bool is_ro_ch; 41 struct wireless_dev *ro_ch_wdev; 42 systime last_ro_ch_time; /* this will be updated at the beginning and end of ro_ch */ 43 #endif 44 }; 45 #endif 46 47 #ifdef CONFIG_IOCTL_CFG80211 48 u8 rtw_roch_stay_in_cur_chan(_adapter *padapter); 49 #endif 50 51 #if (defined(CONFIG_P2P) && defined(CONFIG_CONCURRENT_MODE)) || defined(CONFIG_IOCTL_CFG80211) 52 s32 rtw_roch_wk_hdl(_adapter *padapter, int intCmdType, u8 *buf); 53 u8 rtw_roch_wk_cmd(_adapter *padapter, int intCmdType, struct rtw_roch_parm *roch_parm, u8 flags); 54 55 #ifdef CONFIG_CONCURRENT_MODE 56 void rtw_concurrent_handler(_adapter *padapter); 57 #endif 58 59 void rtw_init_roch_info(_adapter *padapter); 60 #endif /* (defined(CONFIG_P2P) && defined(CONFIG_CONCURRENT_MODE)) || defined(CONFIG_IOCTL_CFG80211) */ 61 62 #endif 63