diff --git a/Makefile b/Makefile index 10b26d8..fc2bb9e 100644 --- a/Makefile +++ b/Makefile @@ -26,6 +26,11 @@ EXTRA_LDFLAGS += --strip-debug CONFIG_AUTOCFG_CP = n +RHEL_VER := $(shell echo `grep '^ID_LIKE' /etc/os-release |grep -qi 'fedora' && grep '^VERSION_ID' /etc/os-release | cut -f2 -d= | cut -c2`) +ifeq (${RHEL_VER},8) +EXTRA_CFLAGS += -DRHEL8 +endif + ########################## WIFI IC ############################ CONFIG_MULTIDRV = n CONFIG_RTL8188E = n diff --git a/README.md b/README.md index c95ef9e..cdf3eda 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,8 @@ $ sudo uname -a && mokutil --sb-state && lsusb && rfkill list all && dkms status - Ubuntu 20.xx (kernels 5.4 and 5.8) and 21.xx (kernels 5.11 and 5.14) +- RHEL 8.4 (kernel 4.18.0) + ### Download Locations for Tested Linux Distributions - [Arch Linux](https://www.archlinux.org) @@ -86,12 +88,14 @@ $ sudo uname -a && mokutil --sb-state && lsusb && rfkill list all && dkms status - [Manjaro](https://manjaro.org) - [Raspberry Pi OS](https://www.raspberrypi.org) - [Ubuntu](https://www.ubuntu.com) +- [RHEL](https://www.redhat.com) ### Tested Hardware - [EDUP EP-AC1605GS WiFi Adapter 1300Mbps USB 3.0 High Gain Wireless Adapter](https://www.amazon.com/gp/product/B07Q56K68T) - [FIDECO 6B21-AC1200M WiFi Adapter - AC1200 Dual Band](https://www.amazon.co.uk/gp/product/B08523KPP9) - [Cudy WU1400 AC 1300Mbps USB 3.0 WiFi Adapter](https://www.amazon.com/Cudy-WU1200-AC1200Mbps-Wireless-Compatible/dp/B07Q9KY4NT) +- [jjPlus WMU6202 miniPCIe - USB - WIFI2.4/5.0GHz Bluetooth (RTL8822BU)](https://techship.com/products/jjplus-wmu6202-mpcie-usb-wifi24-50ghz-bluetooth/) ### Compatible Devices diff --git a/include/osdep_service_linux.h b/include/osdep_service_linux.h index fca4cf6..c279b09 100644 --- a/include/osdep_service_linux.h +++ b/include/osdep_service_linux.h @@ -56,7 +56,7 @@ #include #include -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) || defined(RHEL8)) #include #endif diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 07a4496..4471ce8 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -739,7 +739,7 @@ static int rtw_cfg80211_sync_iftype(_adapter *adapter) static u64 rtw_get_systime_us(void) { -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0) || defined(RHEL8)) return ktime_to_us(ktime_get_boottime()); #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) struct timespec ts; @@ -8289,7 +8289,7 @@ exit: return ret; } -#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) && !defined(RHEL8)) static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy, #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) struct wireless_dev *wdev, @@ -10467,7 +10467,7 @@ static struct cfg80211_ops rtw_cfg80211_ops = { #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) .mgmt_tx = cfg80211_rtw_mgmt_tx, -#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) && !defined(RHEL8)) .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, #else .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_register, @@ -10556,7 +10556,7 @@ int rtw_wiphy_register(struct wiphy *wiphy) { RTW_INFO(FUNC_WIPHY_FMT"\n", FUNC_WIPHY_ARG(wiphy)); -#if ( (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) \ +#if ( (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) && !defined(RHEL8)) \ || defined(RTW_VENDOR_EXT_SUPPORT) ) rtw_cfgvendor_attach(wiphy); #endif @@ -10570,7 +10570,7 @@ void rtw_wiphy_unregister(struct wiphy *wiphy) { RTW_INFO(FUNC_WIPHY_FMT"\n", FUNC_WIPHY_ARG(wiphy)); -#if ( (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0)) \ +#if ( (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) && !defined(RHEL8)) \ || defined(RTW_VENDOR_EXT_SUPPORT) ) rtw_cfgvendor_detach(wiphy); #endif diff --git a/os_dep/linux/ioctl_cfg80211.h b/os_dep/linux/ioctl_cfg80211.h index 7c50e32..cd7c850 100644 --- a/os_dep/linux/ioctl_cfg80211.h +++ b/os_dep/linux/ioctl_cfg80211.h @@ -414,7 +414,7 @@ void rtw_cfg80211_deinit_rfkill(struct wiphy *wiphy); #endif #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) || defined(RHEL8)) #define rtw_cfg80211_notify_new_peer_candidate(wdev, addr, ie, ie_len, sig_dbm, gfp) cfg80211_notify_new_peer_candidate(wdev_to_ndev(wdev), addr, ie, ie_len, sig_dbm, gfp) #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)) #define rtw_cfg80211_notify_new_peer_candidate(wdev, addr, ie, ie_len, sig_dbm, gfp) cfg80211_notify_new_peer_candidate(wdev_to_ndev(wdev), addr, ie, ie_len, gfp) diff --git a/os_dep/linux/nlrtw.c b/os_dep/linux/nlrtw.c index 14d164b..5242b79 100644 --- a/os_dep/linux/nlrtw.c +++ b/os_dep/linux/nlrtw.c @@ -108,7 +108,7 @@ static struct genl_ops nlrtw_genl_ops[] = { { .cmd = NLRTW_CMD_CHANNEL_UTILIZATION, .flags = 0, -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) || !defined(RHEL8)) .policy = nlrtw_genl_policy, #endif .doit = nlrtw_ch_util_set, @@ -129,7 +129,7 @@ static struct genl_family nlrtw_genl_family = { .name = "nlrtw_"DRV_NAME, .version = 1, .maxattr = NLRTW_ATTR_MAX, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0) || defined(RHEL8)) .policy = nlrtw_genl_policy, #endif .netnsok = true, diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 7537c03..421a7e9 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1722,7 +1722,7 @@ unsigned int rtw_classify8021d(struct sk_buff *skb) static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) - #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || defined(RHEL8)) , struct net_device *sb_dev #else , void *accel_priv diff --git a/os_dep/linux/rtw_android.c b/os_dep/linux/rtw_android.c index 10f8f23..72cde59 100644 --- a/os_dep/linux/rtw_android.c +++ b/os_dep/linux/rtw_android.c @@ -663,7 +663,7 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) ret = -ENOMEM; goto exit; } - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) || defined(RHEL8)) if (!access_ok(priv_cmd.buf, priv_cmd.total_len)) { #else if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)) { diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 160a152..d933049 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -2507,7 +2507,7 @@ static int isFileReadable(const char *path, u32 *sz) else { #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) oldfs = get_fs(); - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) || defined(RHEL8)) set_fs(KERNEL_DS); #else set_fs(get_ds()); @@ -2555,7 +2555,7 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz) #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) oldfs = get_fs(); - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) || defined(RHEL8)) set_fs(KERNEL_DS); #else set_fs(get_ds()); @@ -2602,7 +2602,7 @@ static int storeToFile(const char *path, u8 *buf, u32 sz) #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) oldfs = get_fs(); - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) || defined(RHEL8)) set_fs(KERNEL_DS); #else set_fs(get_ds());