From 28a8d26f11918b18871cb7ee6ba0cff329f1b7ee Mon Sep 17 00:00:00 2001 From: kimocoder Date: Mon, 18 Nov 2019 16:12:51 +0100 Subject: [PATCH] Fixes for compiling against OpenWRT tree --- include/drv_conf.h | 7 ++----- .../{wireless.h => old_unused_rtl_wireless.h} | 0 include/{autoconf.h => rtl_autoconf.h} | 0 os_dep/linux/ioctl_linux.c | 15 ++++++++++++++- os_dep/linux/os_intfs.c | 4 ++++ 5 files changed, 20 insertions(+), 6 deletions(-) rename include/linux/{wireless.h => old_unused_rtl_wireless.h} (100%) rename include/{autoconf.h => rtl_autoconf.h} (100%) diff --git a/include/drv_conf.h b/include/drv_conf.h index 6e242e7..9fac340 100644 --- a/include/drv_conf.h +++ b/include/drv_conf.h @@ -14,13 +14,10 @@ *****************************************************************************/ #ifndef __DRV_CONF_H__ #define __DRV_CONF_H__ -#include "autoconf.h" #include "hal_ic_cfg.h" -#if defined(PLATFORM_LINUX) && defined (PLATFORM_WINDOWS) +#include +#include "rtl_autoconf.h" - #error "Shall be Linux or Windows, but not both!\n" - -#endif #define CONFIG_RSSI_PRIORITY #ifdef CONFIG_RTW_REPEATER_SON #ifndef CONFIG_AP diff --git a/include/linux/wireless.h b/include/linux/old_unused_rtl_wireless.h similarity index 100% rename from include/linux/wireless.h rename to include/linux/old_unused_rtl_wireless.h diff --git a/include/autoconf.h b/include/rtl_autoconf.h similarity index 100% rename from include/autoconf.h rename to include/rtl_autoconf.h diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 94eee14..55e9d7b 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -266,6 +266,7 @@ uint rtw_is_cckratesonly_included(u8 *rate) } */ +#ifdef CONFIG_WIRELESS_EXT static int search_p2p_wfd_ie(_adapter *padapter, struct iw_request_info *info, struct wlan_network *pnetwork, char *start, char *stop) @@ -339,6 +340,7 @@ static int search_p2p_wfd_ie(_adapter *padapter, #endif /* CONFIG_P2P */ return _TRUE; } +#endif static inline char *iwe_stream_mac_addr_proess(_adapter *padapter, struct iw_request_info *info, struct wlan_network *pnetwork, char *start, char *stop, struct iw_event *iwe) @@ -782,6 +784,7 @@ static inline char *iwe_stream_net_rsv_process(_adapter *padapter, return start; } +#ifdef CONFIG_WIRELESS_EXT static char *translate_scan(_adapter *padapter, struct iw_request_info *info, struct wlan_network *pnetwork, char *start, char *stop) @@ -1198,7 +1201,9 @@ exit: return ret; } +#endif +#ifdef CONFIG_WIRELESS_EXT static int rtw_wx_get_name(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -12023,6 +12028,7 @@ free_buf: return 0; } +#ifdef CONFIG_WIRELESS_EXT static iw_handler rtw_handlers[] = { NULL, /* SIOCSIWCOMMIT */ rtw_wx_get_name, /* SIOCGIWNAME */ @@ -12346,7 +12352,9 @@ static iw_handler rtw_private_handler[] = { rtw_widi_set_probe_request, /* 0x1F */ #endif /* CONFIG_INTEL_WIDI */ }; +#endif +#ifdef CONFIG_WIRELESS_EXT #if WIRELESS_EXT >= 17 static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev) { @@ -12402,6 +12410,7 @@ static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev) return &padapter->iwstats; } #endif +#endif #ifdef CONFIG_WIRELESS_EXT struct iw_handler_def rtw_handlers_def = { @@ -12417,7 +12426,6 @@ struct iw_handler_def rtw_handlers_def = { .get_wireless_stats = rtw_get_wireless_stats, #endif }; -#endif /* copy from net/wireless/wext.c start * ---------------------------------------------------------------- @@ -12795,6 +12803,7 @@ exit: return err; } +#endif #ifdef CONFIG_COMPAT static int rtw_ioctl_compat_wext_private(struct net_device *dev, struct ifreq *rq) @@ -12822,6 +12831,7 @@ static int rtw_ioctl_compat_wext_private(struct net_device *dev, struct ifreq *r } #endif /* CONFIG_COMPAT */ +#ifdef CONFIG_WIRELESS_EXT static int rtw_ioctl_standard_wext_private(struct net_device *dev, struct ifreq *rq) { struct iw_point *iwp; @@ -12886,3 +12896,6 @@ int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) return ret; } + +#endif +#endif diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index f776436..8d3b804 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1504,7 +1504,9 @@ static const struct net_device_ops rtw_netdev_ops = { #endif .ndo_set_mac_address = rtw_net_set_mac_address, .ndo_get_stats = rtw_net_get_stats, +#ifdef CONFIG_WIRELESS_EXT .ndo_do_ioctl = rtw_ioctl, +#endif }; #endif @@ -2810,7 +2812,9 @@ static const struct net_device_ops rtw_netdev_vir_if_ops = { .ndo_start_xmit = rtw_xmit_entry, .ndo_set_mac_address = rtw_net_set_mac_address, .ndo_get_stats = rtw_net_get_stats, +#ifdef CONFIG_WIRELESS_EXT .ndo_do_ioctl = rtw_ioctl, +#endif #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)) .ndo_select_queue = rtw_select_queue, #endif