Compare commits

..

23 Commits

Author SHA1 Message Date
Sophie Brun
7ba2c81762 Prepare for Release 2022-10-06 16:00:04 +02:00
Sophie Brun
93bc402add Import upstream patch to fix the build with Linux 5.19 2022-10-06 15:59:12 +02:00
Sophie Brun
d1092bd331 Refresh patches 2022-10-06 15:05:13 +02:00
Sophie Brun
7338edb800 Update upstream source from tag 'upstream/5.3.9_git20220829.4ba8e08'
Update to upstream version '5.3.9~git20220829.4ba8e08'
with Debian dir acb483443a
2022-10-06 14:22:17 +02:00
Sophie Brun
8e82f2058a New upstream version 5.3.9~git20220829.4ba8e08 2022-10-06 14:22:13 +02:00
Kali Janitor
be4e8e03c7 Update standards version to 4.6.1, no changes needed.
Changes-By: lintian-brush
Fixes: lintian: out-of-date-standards-version
See-also: https://lintian.debian.org/tags/out-of-date-standards-version.html
2022-09-15 09:53:41 +00:00
Kali Janitor
6ef1e0dce3 Set upstream metadata fields: Bug-Database, Bug-Submit.
Changes-By: lintian-brush
Fixes: lintian: upstream-metadata-file-is-missing
See-also: https://lintian.debian.org/tags/upstream-metadata-file-is-missing.html
Fixes: lintian: upstream-metadata-missing-bug-tracking
See-also: https://lintian.debian.org/tags/upstream-metadata-missing-bug-tracking.html
2022-09-15 09:53:28 +00:00
Kali Janitor
970e221d6c debian/copyright: use spaces rather than tabs to start continuation lines.
Changes-By: lintian-brush
Fixes: lintian: tab-in-license-text
See-also: https://lintian.debian.org/tags/tab-in-license-text.html
2022-09-15 09:53:09 +00:00
Kali Janitor
ed0e6ba7f9 Trim trailing whitespace.
Changes-By: lintian-brush
Fixes: lintian: trailing-whitespace
See-also: https://lintian.debian.org/tags/trailing-whitespace.html
2022-09-15 09:52:57 +00:00
Arnaud Rebillout
52d217db9b Set PACKAGE_VERSION in override_dh_dkms
As this file is use by dh_dkms, it's Ok to adjust it just before calling
dh_dkms. Also, the option '-V $(DEB_VERSION_UPSTREAM)' is pointless, as
we already made sure that PACKAGE_VERSION was set properly.
2022-08-25 23:28:05 +07:00
Arnaud Rebillout
79615b352f Switch to dh-sequence-dkms 2022-08-25 22:58:22 +07:00
Arnaud Rebillout
50b857d068 No more dh-exec (requires compat 13) 2022-08-25 22:57:36 +07:00
Arnaud Rebillout
0c779d9cd8 Nitpicks, harmonize realtek-*-dkms packages
To reduce the differences when comparing those packages.

Gbp-Dch: ignore
2022-08-25 22:56:10 +07:00
Sophie Brun
9185277f38 Prepare for Release 2022-06-21 12:21:06 +02:00
Sophie Brun
dffa09bda6 Add a patch to fix the build with kernel 5.18 2022-06-21 12:19:40 +02:00
Sophie Brun
ca3597e27f Refresh patch 2022-06-21 12:19:30 +02:00
Sophie Brun
4d3330bc88 Remove useless patch (we change version in debian/rules) 2022-06-21 12:08:35 +02:00
Sophie Brun
1a7fc4699b Prepare for Release 2022-05-18 17:51:03 +02:00
Sophie Brun
92f8278d8b Add a patch to fix build build with kernel 5.17 2022-05-18 17:49:41 +02:00
Sophie Brun
f3d9c10358 Prepare for Release 2022-05-12 11:03:13 +02:00
Sophie Brun
661846d873 Refresh patches 2022-05-12 11:02:48 +02:00
Sophie Brun
e396b4e6ce Update upstream source from tag 'upstream/5.3.9_git20220319.0958f29'
Update to upstream version '5.3.9~git20220319.0958f29'
with Debian dir c14f50d3d0
2022-05-12 10:59:07 +02:00
Sophie Brun
88c8fcfece New upstream version 5.3.9~git20220319.0958f29 2022-05-12 10:59:03 +02:00
23 changed files with 231 additions and 122 deletions

View File

@@ -10,10 +10,6 @@ EXTRA_CFLAGS += -Wno-unused
EXTRA_CFLAGS += -Wno-vla
EXTRA_CFLAGS += -Wno-date-time
REDHAT_VER := $(shell cut -f4 -d" " /etc/redhat-release |cut -d"." -f1,2 )
ifeq ($(REDHAT_VER), 7.9)
EXTRA_CFLAGS += -DRHEL79
endif
GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )
ifeq ($(GCC_VER_49),1)

View File

@@ -1,3 +1,24 @@
If you are are taking "Learn Ethical Hacking From Scratch | Udemy" by Zaid Sabih and using Kali 2022 x64 Customized by zSecurity 1.0.7 and TP-Link TL-WN722N v2/v3 [Realtek RTL8188EUS], you might find this helpful. In the begining, I am able to enter monitor mode. However after a few days, I found out it doesn't allow to enter monitor mode. I think TP-Link TL-WN722N v2/v3 have automatically updated its driver. Then, I find a video from David Bombal (https://www.youtube.com/watch?v=tYnjMiTTdms) but still can't perfectly solve the issue. However, I find below steps work fine for me.
1. sudo apt update
2. sudo apt upgrade
3. sudo apt-get dist-upgrade
4. reboot
5. sudo apt-get install linux-headers-$(uname -r)
6. sudo apt install bc
7. sudo apt-get install build-essential
8. sudo apt-get install libelf-dev
10. sudo apt install dkms
11. sudo rmmod r8188eu.ko
12. git https://github.com/drygdryg/rtl8188eus (This works for me 😂)
13. cd rtl8188eus
14. sudo -i
15. echo 'blacklist r8188eu'|sudo tee -a '/etc/modprobe.d/realtek.conf'
16. reboot
17. cd rtl8188eus
18. sudo make && make install
19. reboot
Like https://github.com/cccooo/rtl8812au-centos-7.6, forked from aircrack-ng/rtl8188eus and modified for CentOS 7.9
as CentOS Kernel 3.10 contains many code from 4.x
@@ -27,8 +48,10 @@ as CentOS Kernel 3.10 contains many code from 4.x
# Howto build/install
1. You will need to blacklist another driver in order to use this one.
2. `echo 'blacklist r8188eu'|sudo tee -a '/etc/modprobe.d/realtek.conf'`
3. `make && sudo make install`
4. Reboot in order to blacklist and load the new driver/module.
3. Reboot
4. cd rtl8188eus
5. `make && sudo make install`
6. Reboot in order to blacklist and load the new driver/module.
# MONITOR MODE howto
Use these steps to enter monitor mode.

View File

@@ -15,9 +15,12 @@
#define _RTW_BR_EXT_C_
#ifdef __KERNEL__
#include <linux/version.h>
#include <linux/if_arp.h>
#include <net/ip.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
#include <net/ipx.h>
#endif
#include <linux/atalk.h>
#include <linux/udp.h>
#include <linux/if_pppox.h>
@@ -948,6 +951,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
}
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
/* IPX */
if (ipx != NULL) {
switch (method) {
@@ -1016,8 +1020,12 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
}
}
/* AARP */
else if (ea != NULL) {
#else
if (ea != NULL) {
#endif
/* Sanity check fields. */
if (ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN) {
DEBUG_WARN("NAT25: Appletalk AARP Sanity check fail!\n");

View File

@@ -1831,11 +1831,13 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
ptable->func = &OnAuth;
else
ptable->func = &OnAuthClient;
_mgt_dispatcher(padapter, ptable, precv_frame);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
__attribute__ ((fallthrough));
#else
__attribute__ ((__fallthrough__));
#endif
break;
case WIFI_ASSOCREQ:
case WIFI_REASSOCREQ:
_mgt_dispatcher(padapter, ptable, precv_frame);

View File

@@ -1,5 +1,4 @@
realtek-rtl8188eus-dkms for Debian
---------------------------------
realtek-rtl8188eus DKMS module for Debian
This package was automatically generated by the DKMS system,
for distribution on Debian based operating systems.

41
debian/changelog vendored
View File

@@ -1,3 +1,44 @@
realtek-rtl8188eus-dkms (5.3.9~git20220829.4ba8e08-0kali1) kali-dev; urgency=medium
[ Arnaud Rebillout ]
* No more dh-exec (requires compat 13)
* Switch to dh-sequence-dkms
* Set PACKAGE_VERSION in override_dh_dkms
[ Kali Janitor ]
* Trim trailing whitespace.
* debian/copyright: use spaces rather than tabs to start continuation lines.
* Set upstream metadata fields: Bug-Database, Bug-Submit.
* Update standards version to 4.6.1, no changes needed.
[ Sophie Brun ]
* New upstream version 5.3.9~git20220829.4ba8e08
* Refresh patches
* Import upstream patch to fix the build with Linux 5.19
-- Sophie Brun <sophie@offensive-security.com> Thu, 06 Oct 2022 15:05:27 +0200
realtek-rtl8188eus-dkms (5.3.9~git20220319.0958f29-0kali3) kali-dev; urgency=medium
* Remove useless patch (we change version in debian/rules)
* Refresh patch
* Add a patch to fix the build with kernel 5.18
-- Sophie Brun <sophie@offensive-security.com> Tue, 21 Jun 2022 12:20:45 +0200
realtek-rtl8188eus-dkms (5.3.9~git20220319.0958f29-0kali2) kali-dev; urgency=medium
* Add a patch to fix build build with kernel 5.17
-- Sophie Brun <sophie@offensive-security.com> Wed, 18 May 2022 17:50:10 +0200
realtek-rtl8188eus-dkms (5.3.9~git20220319.0958f29-0kali1) kali-dev; urgency=medium
* New upstream version 5.3.9~git20220319.0958f29
* Refresh patches
-- Sophie Brun <sophie@offensive-security.com> Thu, 12 May 2022 11:02:51 +0200
realtek-rtl8188eus-dkms (5.3.9~git20210504.6146193-0kali2) kali-dev; urgency=medium
[ Ben Wilson ]

5
debian/control vendored
View File

@@ -3,8 +3,8 @@ Section: contrib/kernel
Priority: optional
Maintainer: Kali Developers <devel@kali.org>
Uploaders: Sophie Brun <sophie@offensive-security.com>
Build-Depends: debhelper-compat (= 12), dkms, dh-exec
Standards-Version: 4.5.1
Build-Depends: debhelper-compat (= 13), dh-sequence-dkms
Standards-Version: 4.6.1
Homepage: https://github.com/aircrack-ng/rtl8188eus
Vcs-Browser: https://gitlab.com/kalilinux/packages/realtek-rtl8188eus-dkms
Vcs-Git: https://gitlab.com/kalilinux/packages/realtek-rtl8188eus-dkms.git
@@ -16,4 +16,3 @@ Description: Realtek RTL8188EUS driver in DKMS format
This package provides the source code for RTL8188EUS Linux driver (with
monitor mode and frame injection) to be build with dkms. Kernel sources or
headers are required to compile this module.

2
debian/copyright vendored
View File

@@ -10,7 +10,7 @@ License: GPL-2
Files: os_dep/linux/rhashtable.*
Copyright: 2015 Herbert Xu <herbert@gondor.apana.org.au>
2014-2015 Thomas Graf <tgraf@suug.ch>
2008-2014 Patrick McHardy <kaber@trash.net>
2008-2014 Patrick McHardy <kaber@trash.net>
License: GPL-2
Files: debian/*

View File

@@ -1,20 +0,0 @@
From: Sophie Brun <sophie@offensive-security.com>
Date: Fri, 10 Jul 2020 08:49:31 +0200
Subject: Change dkms version
Forwarded: not-needed
---
dkms.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dkms.conf b/dkms.conf
index 1c14127..bc56f1e 100644
--- a/dkms.conf
+++ b/dkms.conf
@@ -1,5 +1,5 @@
PACKAGE_NAME="realtek-rtl8188eus"
-PACKAGE_VERSION="5.3.9~20200316"
+PACKAGE_VERSION="5.3.9~git20210504.6146193"
CLEAN="'make' clean"
BUILT_MODULE_NAME[0]=8188eu
PROCS_NUM=`nproc`

View File

@@ -0,0 +1,29 @@
From: Sophie Brun <sophie@offensive-security.com>
Date: Tue, 21 Jun 2022 12:15:03 +0200
Subject: Fix build for linux kernel >= 5.17
Origin: https://github.com/aircrack-ng/rtl8188eus/commit/0f1905259ec9b85fd1453be3abd322ff543e12bc
---
include/ieee80211.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/ieee80211.h b/include/ieee80211.h
index 89d2eff..5d7ebe1 100644
--- a/include/ieee80211.h
+++ b/include/ieee80211.h
@@ -1535,13 +1535,13 @@ extern __inline int is_multicast_mac_addr(const u8 *addr)
return (addr[0] != 0xff) && (0x01 & addr[0]);
}
-extern __inline int is_broadcast_mac_addr(const u8 *addr)
+__inline int is_broadcast_mac_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
-extern __inline int is_zero_mac_addr(const u8 *addr)
+__inline int is_zero_mac_addr(const u8 *addr)
{
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));

49
debian/patches/Fix-for-linux-5.19.patch vendored Normal file
View File

@@ -0,0 +1,49 @@
From: Sophie Brun <sophie@offensive-security.com>
Date: Thu, 6 Oct 2022 15:53:31 +0200
Subject: Fix for linux 5.19
Origin: https://github.com/aircrack-ng/rtl8188eus/pull/205
---
os_dep/linux/ioctl_cfg80211.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c
index 86c45b9..02ed8dc 100644
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -417,7 +417,11 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8
if (ret != _SUCCESS)
goto exit;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0))
+ cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0);
+#else
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef);
+#endif
#else
int freq = rtw_ch2freq(ch);
@@ -4876,7 +4880,11 @@ static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *nd
return ret;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0))
+static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id)
+#else
static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
+#endif
{
_adapter *adapter = (_adapter *)rtw_netdev_priv(ndev);
@@ -9634,7 +9642,11 @@ void rtw_wdev_unregister(struct wireless_dev *wdev)
rtw_cfg80211_indicate_scan_done(adapter, _TRUE);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE)
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0))
+ if (wdev->connected) {
+ #else
if (wdev->current_bss) {
+ #endif
RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter));
rtw_cfg80211_indicate_disconnect(adapter, 0, 1);
}

View File

@@ -0,0 +1,24 @@
From: Sophie Brun <sophie@offensive-security.com>
Date: Wed, 18 May 2022 17:47:55 +0200
Subject: Build support with kernel v5.17
Origin: https://github.com/aircrack-ng/rtl8188eus/commit/13cc38399eb44f234a52dde5f94509e54a09c71f
---
os_dep/linux/rtw_proc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c
index 8b1a424..9bd4041 100644
--- a/os_dep/linux/rtw_proc.c
+++ b/os_dep/linux/rtw_proc.c
@@ -39,6 +39,10 @@ inline struct proc_dir_entry *get_rtw_drv_proc(void)
#define proc_get_parent_data(inode) PDE((inode))->parent->data
#endif
+#if(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
+#define PDE_DATA(inode) pde_data(inode)
+#endif
+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
#define get_proc_net proc_net
#else

View File

@@ -1,77 +0,0 @@
From: Sophie Brun <sophie@offensive-security.com>
Date: Tue, 14 Dec 2021 17:54:33 +0100
Subject: Fix compilation for kernel 5.15
Drop IPX and Apple Talk support for Linux 5.15 Remove IPX support from
driver, set as obsolete in Jan 2018. IPX is not supported by the Linux
kernel since v5.15-rc1, see commit
6c9b40844751ea30c72f7a2f92f4d704bc6b2927
Origin: https://github.com/aircrack-ng/rtl8188eus/commit/4830d3906230a4d80ba67709a06c9d5b99764839
---
core/rtw_br_ext.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/core/rtw_br_ext.c b/core/rtw_br_ext.c
index 6509df3..4507dce 100644
--- a/core/rtw_br_ext.c
+++ b/core/rtw_br_ext.c
@@ -17,7 +17,10 @@
#ifdef __KERNEL__
#include <linux/if_arp.h>
#include <net/ip.h>
+ #include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)
#include <net/ipx.h>
+#endif
#include <linux/atalk.h>
#include <linux/udp.h>
#include <linux/if_pppox.h>
@@ -169,6 +172,7 @@ static __inline__ void __nat25_generate_ipv4_network_addr(unsigned char *network
}
+#ifdef _NET_INET_IPX_H_
static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr)
{
@@ -200,6 +204,7 @@ static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networ
memcpy(networkAddr + 1, (unsigned char *)network, 2);
networkAddr[3] = *node;
}
+#endif
static __inline__ void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
@@ -329,6 +334,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
return x & (NAT25_HASH_SIZE - 1);
+#ifdef _NET_INET_IPX_H_
} else if (networkAddr[0] == NAT25_IPX) {
unsigned long x;
@@ -342,6 +348,7 @@ static __inline__ int __nat25_network_hash(unsigned char *networkAddr)
x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3];
return x & (NAT25_HASH_SIZE - 1);
+#endif
} else if (networkAddr[0] == NAT25_PPPOE) {
unsigned long x;
@@ -888,6 +895,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
}
}
+#ifdef _NET_INET_IPX_H_
/*---------------------------------------------------*/
/* Handle IPX and Apple Talk frame */
/*---------------------------------------------------*/
@@ -1108,6 +1116,7 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
return -1;
}
+#endif
/*---------------------------------------------------*/
/* Handle PPPoE frame */

View File

@@ -1,2 +1,3 @@
Change-dkms-version.patch
fix-compilation-kernel-5.15.patch
add-support-kernel-5.17.patch
Fix-build-for-linux-kernel-5.17.patch
Fix-for-linux-5.19.patch

3
debian/realtek-rtl8188eus-dkms.install vendored Executable file → Normal file
View File

@@ -1,3 +1,2 @@
#!/usr/bin/dh-exec
core hal include Kconfig Makefile os_dep platform usr/src/realtek-rtl8188eus-${DEB_VERSION_UPSTREAM}
core hal include Kconfig Makefile os_dep platform usr/src/realtek-rtl8188eus-${env:DEB_VERSION_UPSTREAM}
debian/r8188eus-dkms.conf etc/modprobe.d

11
debian/rules vendored
View File

@@ -1,18 +1,17 @@
#!/usr/bin/make -f
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1
include /usr/share/dpkg/pkg-info.mk
export DEB_VERSION_UPSTREAM
%:
dh $@ --with dkms
dh $@
override_dh_dkms:
dh_dkms -V $(DEB_VERSION_UPSTREAM) -- dkms.conf
# Force PACKAGE_VERSION to be DEB_VERSION_UPSTREAM
sed -i dkms.conf -e 's%^PACKAGE_VERSION=.*%PACKAGE_VERSION="$(DEB_VERSION_UPSTREAM)"%'
dh_dkms -- dkms.conf
override_dh_fixperms:
dh_fixperms
execute_after_dh_fixperms:
find debian/realtek-rtl8188eus-dkms/usr/src -type f -exec chmod -x {} \;
# Nothing to configure, build or auto-install (all is done after

View File

@@ -1,2 +0,0 @@
#we export the variable provided by /usr/share/dpkg/pkg-info.mk
realtek-rtl8188eus-dkms source: dh-exec-subst-unknown-variable debian/realtek-rtl8188eus-dkms.install DEB_VERSION_UPSTREAM

3
debian/upstream/metadata vendored Normal file
View File

@@ -0,0 +1,3 @@
---
Bug-Database: https://github.com/aircrack-ng/rtl8188eus/issues
Bug-Submit: https://github.com/aircrack-ng/rtl8188eus/issues/new

View File

@@ -1529,6 +1529,7 @@ enum ieee80211_state {
(((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \
(((Addr[5]) & 0xff) == 0xff))
#else
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 00))
extern __inline int is_multicast_mac_addr(const u8 *addr)
{
return (addr[0] != 0xff) && (0x01 & addr[0]);
@@ -1545,6 +1546,24 @@ extern __inline int is_zero_mac_addr(const u8 *addr)
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
}
#else
static __inline int is_multicast_mac_addr(const u8 *addr)
{
return (addr[0] != 0xff) && (0x01 & addr[0]);
}
static __inline int is_broadcast_mac_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
static __inline int is_zero_mac_addr(const u8 *addr)
{
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
}
#endif /* LINUX_VERSION_CODE */
#endif /* PLATFORM_FREEBSD */
#define CFG_IEEE80211_RESERVE_FCS (1<<0)

View File

@@ -1199,7 +1199,11 @@ static int rtw_net_set_mac_address(struct net_device *pnetdev, void *addr)
}
_rtw_memcpy(adapter_mac_addr(padapter), sa->sa_data, ETH_ALEN); /* set mac addr to adapter */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
eth_hw_addr_set(pnetdev, sa->sa_data);
#else
_rtw_memcpy(pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /* set mac addr to net_device */
#endif
#if 0
if (rtw_is_hw_init_completed(padapter)) {
@@ -1628,7 +1632,11 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name)
/* alloc netdev name */
rtw_init_netdev_name(ndev, name);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
eth_hw_addr_set(ndev, adapter_mac_addr(adapter));
#else
_rtw_memcpy(ndev->dev_addr, adapter_mac_addr(adapter), ETH_ALEN);
#endif
#if defined(CONFIG_NET_NS)
dev_net_set(ndev, wiphy_net(adapter_to_wiphy(adapter)));
#endif //defined(CONFIG_NET_NS)

View File

@@ -45,6 +45,10 @@ inline struct proc_dir_entry *get_rtw_drv_proc(void)
#define get_proc_net init_net.proc_net
#endif
#if(LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
#define PDE_DATA(inode) pde_data(inode)
#endif
inline struct proc_dir_entry *rtw_proc_create_dir(const char *name, struct proc_dir_entry *parent, void *data)
{
struct proc_dir_entry *entry;

View File

@@ -159,7 +159,8 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
{USB_DEVICE(0x2001, 0x3310), .driver_info = RTL8188E}, /* Dlink DWA-123 REV D1 */
{USB_DEVICE(0x2001, 0x3311), .driver_info = RTL8188E}, /* DLink GO-USB-N150 REV B1 */
{USB_DEVICE(0x2001, 0x331B), .driver_info = RTL8188E}, /* DLink DWA-121 REV B1 */
{USB_DEVICE(0x056E, 0x4008), .driver_info = RTL8188E}, /* Elecom WDC-150SU2M */
{USB_DEVICE(0x056E, 0x4008), .driver_info = RTL8188E}, /* Elecom WDC-150SU2M */
{USB_DEVICE(0x7392, 0xB811), .driver_info = RTL8188E}, /* Edimax EW-7811UN v2 */
#endif
#ifdef CONFIG_RTL8812A

View File

@@ -1268,8 +1268,12 @@ u32 _rtw_down_sema(_sema *sema)
inline void thread_exit(_completion *comp)
{
#ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
kthread_complete_and_exit(comp, 0);
#else
complete_and_exit(comp, 0);
#endif
#endif
#ifdef PLATFORM_FREEBSD
printf("%s", "RTKTHREAD_exit");