diff --git a/make/linux-drivers.mk b/make/linux-drivers.mk index aacb5486..c4d693c2 100644 --- a/make/linux-drivers.mk +++ b/make/linux-drivers.mk @@ -3,27 +3,6 @@ # # ----------------------------------------------------------------------------- -RTL8192EU_VERSION = git -RTL8192EU_DIR = rtl8192eu-linux-driver.$(RTL8192EU_VERSION) -RTL8192EU_SOURCE = rtl8192eu-linux-driver.$(RTL8192EU_VERSION) -RTL8192EU_SITE = https://github.com/mange/$(RTL8192EU_SOURCE) - -RTL8192EU_CHECKOUT = 60aa279428024ea78dcffe2c181ffee3cc1495f5 - -rtl8192eu: kernel-$(BOXTYPE) | $(TARGET_DIR) - $(REMOVE)/$(RTL8192EU_DIR) - $(GET_GIT_SOURCE) $(RTL8192EU_SITE) $(DL_DIR)/$(RTL8192EU_SOURCE) - $(CPDIR)/$(RTL8192EU_SOURCE) - $(CHDIR)/$(RTL8192EU_DIR); \ - git checkout $(RTL8192EU_CHECKOUT); \ - $(MAKE) $(KERNEL_MAKE_VARS); \ - $(INSTALL_DATA) 8192eu.ko $(TARGET_modulesdir)/kernel/drivers/net/wireless/ - $(LINUX_RUN_DEPMOD) - $(REMOVE)/$(RTL8192EU_DIR) - $(TOUCH) - -# ----------------------------------------------------------------------------- - RTL8812AU_VERSION = 4.3.14 RTL8812AU_DIR = rtl8812AU-driver-$(RTL8812AU_VERSION) RTL8812AU_SOURCE = rtl8812AU-driver-$(RTL8812AU_VERSION).zip diff --git a/package/rtl8192eu/rtl8192eu.mk b/package/rtl8192eu/rtl8192eu.mk new file mode 100644 index 00000000..1b1e6865 --- /dev/null +++ b/package/rtl8192eu/rtl8192eu.mk @@ -0,0 +1,30 @@ +################################################################################ +# +# rtl8192eu +# +################################################################################ + +RTL8192EU_VERSION = git +RTL8192EU_DIR = rtl8192eu-linux-driver.$(RTL8192EU_VERSION) +RTL8192EU_SOURCE = rtl8192eu-linux-driver.$(RTL8192EU_VERSION) +RTL8192EU_SITE = https://github.com/mange/$(RTL8192EU_SOURCE) + +RTL8192EU_CHECKOUT = 60aa279428024ea78dcffe2c181ffee3cc1495f5 + +RTL8192EU_DEPENDENCIES = kernel-$(BOXTYPE) + +define RTL8192EU_INSTALL_BINARY + $(INSTALL_DATA) -D $(PKG_BUILD_DIR)/8192eu.ko $(TARGET_modulesdir)/kernel/drivers/net/wireless/8192eu.ko +endef +RTL8192EU_PRE_FOLLOWUP_HOOKS += RTL8192EU_INSTALL_BINARY + +define RTL8192EU_RUN_DEPMOD + $(LINUX_RUN_DEPMOD) +endef +RTL8192EU_TARGET_FINALIZE_HOOKS += RTL8192EU_RUN_DEPMOD + +rtl8192eu: | $(TARGET_DIR) + $(call PREPARE) + $(CHDIR)/$($(PKG)_DIR); \ + $(MAKE) $(KERNEL_MAKE_VARS) + $(call TARGET_FOLLOWUP) diff --git a/package/rtl8822bu/patches/0001-add-linux-4.19-support.patch b/package/rtl8822bu/patches/0001-add-linux-4.19-support.patch index b4b63b02..e9d71d36 100644 --- a/package/rtl8822bu/patches/0001-add-linux-4.19-support.patch +++ b/package/rtl8822bu/patches/0001-add-linux-4.19-support.patch @@ -1,23 +1,23 @@ --- a/os_dep/linux/os_intfs.c 2018-10-23 21:11:56.009471377 +0200 +++ b/os_dep/linux/os_intfs.c 2018-10-23 21:12:40.189684185 +0200 @@ -1190,7 +1190,11 @@ - return dscp >> 5; - } - -- -+#if (LINUX_VERSION_CODE>=KERNEL_VERSION(4,19,0)) -+static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb, -+ struct net_device *sb_dev, -+ select_queue_fallback_t fallback -+#else - static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb - #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) - , void *accel_priv + return dscp >> 5; + } + +- ++#if (LINUX_VERSION_CODE>=KERNEL_VERSION(4,19,0)) ++static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb, ++ struct net_device *sb_dev, ++ select_queue_fallback_t fallback ++#else + static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) + , void *accel_priv @@ -1198,6 +1202,7 @@ - , select_queue_fallback_t fallback - #endif - #endif -+#endif - ) - { - _adapter *padapter = rtw_netdev_priv(dev); + , select_queue_fallback_t fallback + #endif + #endif ++#endif + ) + { + _adapter *padapter = rtw_netdev_priv(dev); diff --git a/package/rtl8822bu/patches/0002-add-linux-4.20-support.patch b/package/rtl8822bu/patches/0002-add-linux-4.20-support.patch index 0ded20c7..038acfc1 100644 --- a/package/rtl8822bu/patches/0002-add-linux-4.20-support.patch +++ b/package/rtl8822bu/patches/0002-add-linux-4.20-support.patch @@ -3,32 +3,32 @@ index ecb93a364f57..859efa6658ff 100644 --- a/include/wifi.h +++ b/include/wifi.h @@ -1011,7 +1011,11 @@ typedef enum _HT_CAP_AMPDU_DENSITY { - * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2) - */ - #define IEEE80211_MIN_AMPDU_BUF 0x8 -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) -+#define IEEE80211_MAX_AMPDU_BUF 0x100 -+#else - #define IEEE80211_MAX_AMPDU_BUF 0x40 -+#endif - - - /* Spatial Multiplexing Power Save Modes */ + * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2) + */ + #define IEEE80211_MIN_AMPDU_BUF 0x8 ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) ++#define IEEE80211_MAX_AMPDU_BUF 0x100 ++#else + #define IEEE80211_MAX_AMPDU_BUF 0x40 ++#endif + + + /* Spatial Multiplexing Power Save Modes */ diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 4069d5489873..7c6f1c21fa55 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -327,6 +327,13 @@ static const struct ieee80211_txrx_stypes - }; - #endif - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) -+static inline void get_monotonic_boottime(struct timespec *ts) -+{ -+ *ts = ktime_to_timespec(ktime_get_boottime()); -+} -+#endif -+ - static u64 rtw_get_systime_us(void) - { - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) + }; + #endif + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0)) ++static inline void get_monotonic_boottime(struct timespec *ts) ++{ ++ *ts = ktime_to_timespec(ktime_get_boottime()); ++} ++#endif ++ + static u64 rtw_get_systime_us(void) + { + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) diff --git a/package/rtl8822bu/patches/0003-add-linux-5.0-support.patch b/package/rtl8822bu/patches/0003-add-linux-5.0-support.patch index 4e7636b3..ae3c110a 100644 --- a/package/rtl8822bu/patches/0003-add-linux-5.0-support.patch +++ b/package/rtl8822bu/patches/0003-add-linux-5.0-support.patch @@ -3,14 +3,14 @@ index a4affae2f8cb..0996159d1379 100644 --- a/os_dep/linux/rtw_android.c +++ b/os_dep/linux/rtw_android.c @@ -621,7 +621,11 @@ int rtw_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd) - goto exit; - } - -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) -+ if (!access_ok(priv_cmd.buf, priv_cmd.total_len)) { -+#else - if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)) { -+#endif - RTW_INFO("%s: failed to access memory\n", __FUNCTION__); - ret = -EFAULT; - goto exit; + goto exit; + } + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)) ++ if (!access_ok(priv_cmd.buf, priv_cmd.total_len)) { ++#else + if (!access_ok(VERIFY_READ, priv_cmd.buf, priv_cmd.total_len)) { ++#endif + RTW_INFO("%s: failed to access memory\n", __FUNCTION__); + ret = -EFAULT; + goto exit; diff --git a/package/rtl8822bu/patches/0004-add-linux-5.1-support.patch b/package/rtl8822bu/patches/0004-add-linux-5.1-support.patch index d41933f4..1a9da81a 100644 --- a/package/rtl8822bu/patches/0004-add-linux-5.1-support.patch +++ b/package/rtl8822bu/patches/0004-add-linux-5.1-support.patch @@ -3,47 +3,47 @@ index dcd26b6a15b4..c44b5f593135 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -2076,7 +2076,13 @@ static int isFileReadable(const char *path, u32 *sz) - ret = PTR_ERR(fp); - else { - oldfs = get_fs(); -- set_fs(get_ds()); -+ set_fs( -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) -+ KERNEL_DS -+#else -+ get_ds() -+#endif -+ ); - - if (1 != readFile(fp, &buf, 1)) - ret = PTR_ERR(fp); + ret = PTR_ERR(fp); + else { + oldfs = get_fs(); +- set_fs(get_ds()); ++ set_fs( ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) ++ KERNEL_DS ++#else ++ get_ds() ++#endif ++ ); + + if (1 != readFile(fp, &buf, 1)) + ret = PTR_ERR(fp); @@ -2114,7 +2120,13 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz) - RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); - - oldfs = get_fs(); -- set_fs(get_ds()); -+ set_fs( -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) -+ KERNEL_DS -+#else -+ get_ds() -+#endif -+ ); - ret = readFile(fp, buf, sz); - set_fs(oldfs); - closeFile(fp); + RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); + + oldfs = get_fs(); +- set_fs(get_ds()); ++ set_fs( ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) ++ KERNEL_DS ++#else ++ get_ds() ++#endif ++ ); + ret = readFile(fp, buf, sz); + set_fs(oldfs); + closeFile(fp); @@ -2149,7 +2161,13 @@ static int storeToFile(const char *path, u8 *buf, u32 sz) - RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); - - oldfs = get_fs(); -- set_fs(get_ds()); -+ set_fs( -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) -+ KERNEL_DS -+#else -+ get_ds() -+#endif -+ ); - ret = writeFile(fp, buf, sz); - set_fs(oldfs); - closeFile(fp); + RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); + + oldfs = get_fs(); +- set_fs(get_ds()); ++ set_fs( ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) ++ KERNEL_DS ++#else ++ get_ds() ++#endif ++ ); + ret = writeFile(fp, buf, sz); + set_fs(oldfs); + closeFile(fp); diff --git a/package/rtl8822bu/patches/0005-add-linux-5.2-support.patch b/package/rtl8822bu/patches/0005-add-linux-5.2-support.patch index c681c1e1..68760416 100644 --- a/package/rtl8822bu/patches/0005-add-linux-5.2-support.patch +++ b/package/rtl8822bu/patches/0005-add-linux-5.2-support.patch @@ -3,15 +3,15 @@ index 24e7cf0c650b..a47aeca1f393 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1192,8 +1192,10 @@ unsigned int rtw_classify8021d(struct sk_buff *skb) - - #if (LINUX_VERSION_CODE>=KERNEL_VERSION(4,19,0)) - static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb, -- struct net_device *sb_dev, -- select_queue_fallback_t fallback -+ struct net_device *sb_dev -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)) -+ , select_queue_fallback_t fallback -+#endif - #else - 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)) + static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb, +- struct net_device *sb_dev, +- select_queue_fallback_t fallback ++ struct net_device *sb_dev ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)) ++ , select_queue_fallback_t fallback ++#endif + #else + static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)