From e68310ce0db8710bbebf83d4ca473ce95fe6355f Mon Sep 17 00:00:00 2001 From: kimocoder Date: Sat, 1 Feb 2020 09:55:13 +0100 Subject: [PATCH] Use for RTL8814A chip (AWWD-165) --- Makefile | 1 + hal/hal_dm_acs.c | 2 ++ hal/phydm/phydm_noisemonitor.c | 4 ++-- os_dep/linux/ioctl_linux.c | 6 +++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 24f2dfd..00a9382 100755 --- a/Makefile +++ b/Makefile @@ -51,6 +51,7 @@ CONFIG_REDUCE_TX_CPU_LOADING = n CONFIG_BR_EXT = y CONFIG_TDLS = n CONFIG_WIFI_MONITOR = y +CONFIG_DISABLE_REGD_C = y CONFIG_MCC_MODE = n CONFIG_APPEND_VENDOR_IE_ENABLE = n CONFIG_RTW_NAPI = y diff --git a/hal/hal_dm_acs.c b/hal/hal_dm_acs.c index 5c19d99..49fc8a0 100644 --- a/hal/hal_dm_acs.c +++ b/hal/hal_dm_acs.c @@ -539,8 +539,10 @@ s16 rtw_noise_measure_curchan(_adapter *padapter) u8 is_pause_dig = _TRUE; u8 cur_chan = rtw_get_oper_ch(padapter); +#ifndef CONFIG_ALLOW_UNLINKED_NOISE_MONITOR if (rtw_linked_check(padapter) == _FALSE) return noise; +#endif rtw_ps_deny(padapter, PS_DENY_IOCTL); LeaveAllPowerSaveModeDirect(padapter); diff --git a/hal/phydm/phydm_noisemonitor.c b/hal/phydm/phydm_noisemonitor.c index aeeb255..77fe94e 100644 --- a/hal/phydm/phydm_noisemonitor.c +++ b/hal/phydm/phydm_noisemonitor.c @@ -263,12 +263,12 @@ s16 odm_inband_noise_monitor_ac(struct dm_struct *dm, u8 pause_dig, u8 igi, s16 rpt = 0; u8 val_u8 = 0; - if (dm->support_ic_type & (ODM_RTL8822B | ODM_RTL8821C)) { + if (dm->support_ic_type & (ODM_RTL8822B | ODM_RTL8821C | ODM_RTL8814A)) { rpt = phydm_idle_noise_measure_ac(dm, pause_dig, igi, max_time); return rpt; } - if (!(dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8821 | ODM_RTL8814A))) + if (!(dm->support_ic_type & (ODM_RTL8812 | ODM_RTL8821))) return 0; func_start = odm_get_current_time(dm); diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 0d1f301..9136d68 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -12364,12 +12364,16 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev) int tmp_qual = 0; int tmp_noise = 0; +#ifndef CONFIG_ALLOW_UNLINKED_NOISE_MONITOR if (check_fwstate(&padapter->mlmepriv, _FW_LINKED) != _TRUE) { piwstats->qual.qual = 0; piwstats->qual.level = 0; piwstats->qual.noise = 0; /* RTW_INFO("No link level:%d, qual:%d, noise:%d\n", tmp_level, tmp_qual, tmp_noise); */ - } else { + } + else +#endif + { #ifdef CONFIG_SIGNAL_DISPLAY_DBM tmp_level = translate_percentage_to_dbm(padapter->recvpriv.signal_strength); #else