From 8bdef804c399b2f91d1fb0840f7d8ec05166d052 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Mon, 11 Nov 2019 02:43:26 +0100 Subject: [PATCH] Fix channel switch in the monitor mode if both CONFIG_WIRELESS_EXT and CONFIG_CFG80211_WEXT are enabled --- os_dep/linux/ioctl_linux.c | 6 ++++-- os_dep/linux/os_intfs.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 1060cf0..e96318b 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -1,3 +1,4 @@ + /****************************************************************************** * * Copyright(c) 2007 - 2017 Realtek Corporation. @@ -12402,8 +12403,9 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev) } #endif -#ifdef CONFIG_WIRELESS_EXT -struct iw_handler_def rtw_handlers_def = { +#if defined(CONFIG_WIRELESS_EXT) && !defined(CONFIG_CFG80211_WEXT) +struct iw_handler_def rtw_handlers_def = +{ .standard = rtw_handlers, .num_standard = sizeof(rtw_handlers) / sizeof(iw_handler), #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33)) || defined(CONFIG_WEXT_PRIV) diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 2febe88..87b1d41 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1626,7 +1626,7 @@ struct net_device *rtw_init_netdev(_adapter *old_padapter) /* pnetdev->tx_timeout = NULL; */ pnetdev->watchdog_timeo = HZ * 3; /* 3 second timeout */ -#ifdef CONFIG_WIRELESS_EXT +#if defined(CONFIG_WIRELESS_EXT) && !defined(CONFIG_CFG80211_WEXT) pnetdev->wireless_handlers = (struct iw_handler_def *)&rtw_handlers_def; #endif