Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version v5.3.9 is not working please revert back the changes #238

Open
wants to merge 45 commits into
base: revert-164-v5.3.9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
4830d39
Drop IPX and Apple Talk support for Linux 5.15
drygdryg Nov 13, 2021
f4f35e6
Compile with kernel v5.15
isqad Dec 20, 2021
ff4d7d0
Merge pull request #165 from aircrack-ng/revert-164-v5.3.9
kimocoder Mar 19, 2022
5157219
Merge pull request #146 from drygdryg/v5.3.9
kimocoder Mar 19, 2022
be9fe41
Fix /etc/redhat-release
kimocoder Mar 19, 2022
6c160b4
Revert "Drop IPX and Apple Talk support for Linux 5.15"
kimocoder Mar 19, 2022
4f4265f
Merge pull request #166 from aircrack-ng/revert-146-v5.3.9
kimocoder Mar 19, 2022
0958f29
Merge pull request #152 from isqad/v5.3.9
kimocoder Mar 19, 2022
fdd1b35
rtl8188eus: README: update__orgin repo link
karthik558 Mar 20, 2022
13cc383
Build support with kernel v5.17:
drygdryg Mar 31, 2022
daa3a2e
build support for kernel 5.18 and above
smCloudInTheSky Jul 27, 2022
a5793ef
Merge pull request #174 from drygdryg/v5.3.9
kimocoder Aug 29, 2022
4ba8e08
Merge pull request #193 from smCloudInTheSky/v5.3.9
kimocoder Aug 29, 2022
a3a93e3
build support for kernel 5.19
Sep 8, 2022
2ea2c91
build for debian LTS fix
dan-bolsun Sep 18, 2022
33c4ae0
build support for kernel 6.0
dan-bolsun Oct 23, 2022
aa92fe1
Cleanup wrongly commited PR
kimocoder Nov 5, 2022
4b892bb
Merge pull request #211 from dan-bolsun/v5.3.9
kimocoder Nov 5, 2022
dda5378
Fix kernel 6.x compiler warnings
kimocoder Nov 5, 2022
b7fb0ef
Merge pull request #168 from karthik558/patch-2
kimocoder Nov 5, 2022
fc68ce6
Update README.md
kimocoder Nov 5, 2022
dab6e02
Fix more minor issues in various places
kimocoder Nov 5, 2022
0294b69
fix: adapt to old kernels
Jun-Amane Nov 16, 2022
f79dffb
Merge pull request #216 from JunASAKA/v5.3.9
kimocoder Dec 6, 2022
fc96492
Makefile: Fix "fatal error: 'drv_types.h' file not found"
MrRob0-X Dec 19, 2022
67be0af
Merge pull request #219 from MrRob0-X/v5.3.9
kimocoder Dec 19, 2022
3a4ce2b
Makefile: set check for two way path's
MrRob0-X Dec 20, 2022
204c53d
Merge pull request #222 from MrRob0-X/v5.3.9
kimocoder Jan 1, 2023
d8d41d2
Update Makefile
kimocoder Jan 1, 2023
8c7cd37
Fix some compiler warnings
kimocoder Jan 1, 2023
f8ead57
Update Makefile
kimocoder Jan 1, 2023
258b77d
build support for kernel 6.1
gglluukk Jan 17, 2023
07e3beb
Fix compiler warnings
gglluukk Mar 30, 2023
cf7c7bf
Fix compiler warnings
gglluukk Mar 30, 2023
0ef6dd6
Build support for kernel 6.3
gglluukk Mar 30, 2023
1c29b9b
Fix kernel warning dump at net/wireless/sme.c:843
gglluukk Apr 2, 2023
971fad1
Adopt patch for 5.x kernel warning dump
gglluukk Apr 2, 2023
06420d2
Pragma GCC > 10 warning fix
gglluukk Apr 17, 2023
ecd47ad
halrf_cmninfo_hook u32 -> enum fix
gglluukk Apr 27, 2023
f1a456d
Update README.md
gglluukk Sep 14, 2023
ab10991
Update README.md
gglluukk Sep 14, 2023
3afeae6
Merge pull request #225 from gglluukk/v5.3.9
kimocoder Sep 21, 2023
3fae723
remove unused code
kimocoder Sep 21, 2023
cf02710
Build support for kernel 6.10
luizluca Aug 12, 2024
f969c54
Merge pull request #290 from luizluca/v5.3.9
kimocoder Sep 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ EXTRA_CFLAGS += -Wno-unused-label
EXTRA_CFLAGS += -Wno-unused-parameter
EXTRA_CFLAGS += -Wno-unused-function
EXTRA_CFLAGS += -Wno-unused
EXTRA_CFLAGS += -Wno-address
EXTRA_CFLAGS += -Wno-cast-function-type
#EXTRA_CFLAGS += -Wno-discarded-qualifiers
EXTRA_CFLAGS += -Wno-uninitialized
EXTRA_CFLAGS += -Wno-sometimes-uninitialized
EXTRA_CFLAGS += -Wno-enum-conversion
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)
EXTRA_CFLAGS += -Wno-date-time # Fix compile error && warning on gcc 4.9 and later
endif

EXTRA_CFLAGS += -I$(src)/include
EXTRA_CFLAGS += -I$(src)/include -I$(srctree)/$(src)/include

EXTRA_LDFLAGS += --strip-debug

Expand Down Expand Up @@ -227,10 +229,11 @@ _HAL_INTFS_FILES := hal/hal_intf.o \
hal/led/hal_$(HCI_NAME)_led.o


EXTRA_CFLAGS += -I$(src)/platform
EXTRA_CFLAGS += -I$(src)/platform -I$(srctree)/$(src)/platform
_PLATFORM_FILES := platform/platform_ops.o

EXTRA_CFLAGS += -I$(src)/hal/btc
EXTRA_CFLAGS += -I$(src)/hal/btc -I$(srctree)/$(src)/hal/btc
EXTRA_CFLAGS += -I$(src)/hal/phydm -I$(srctree)/$(src)/hal/phydm

########### HAL_RTL8188E #################################
ifeq ($(CONFIG_RTL8188E), y)
Expand Down
57 changes: 21 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
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

## rtl8188eus v5.3.9

# Realtek rtl8188eus & rtl8188eu & rtl8188etv WiFi drivers
Expand All @@ -38,32 +14,41 @@ as CentOS Kernel 3.10 contains many code from 4.x


# Supports
* Android 7
* Android 12/13
* MESH Support
* Monitor mode
* Frame injection
* Up to kernel v5.8+
* Up to kernel v6.5+
... And a bunch of various wifi chipsets

# 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. Reboot
4. cd rtl8188eus
5. `make && sudo make install`
6. Reboot in order to blacklist and load the new driver/module.
1. Compile and install the driver:
```
cd rtl8188eus
make && sudo make install
```
2. Blacklist another drivers in order to use this one:
```
echo 'blacklist r8188eu' | sudo tee -a '/etc/modprobe.d/realtek.conf'
echo 'blacklist rtl8xxxu' | sudo tee -a '/etc/modprobe.d/realtek.conf'
```
3. `reboot` or remove all drivers related to RTL8188 and reload this one:
```
rmmod r8188eu rtl8xxxu 8188eu
modprobe 8188eu
```

# MONITOR MODE howto
Use these steps to enter monitor mode.
```
$ sudo airmon-ng check kill
$ sudo ip link set <interface> down
$ sudo iw dev <interface> set type monitor
sudo airmon-ng check kill
sudo ip link set <interface> down
sudo iw dev <interface> set type monitor
```
Frame injection test may be performed with
(after kernel v5.2 scanning is slow, run a scan or simply an airodump-ng first!)
```
$ aireplay -9 <interface>
sudo aireplay-ng -9 <interface>
```

# NetworkManager configuration
Expand Down
3 changes: 2 additions & 1 deletion core/efuse/rtw_efuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,13 +711,14 @@ void rtw_efuse_analyze(PADAPTER padapter, u8 Type, u8 Fake)
j = 0;

for (i = 0; i < mapLen; i++) {
if (i % 16 == 0)
if (i % 16 == 0) {
RTW_PRINT_SEL(RTW_DBGDUMP, "0x%03x: ", i);
_RTW_PRINT_SEL(RTW_DBGDUMP, "%02X%s"
, pEfuseHal->fakeEfuseInitMap[i]
, ((i + 1) % 16 == 0) ? "\n" : (((i + 1) % 8 == 0) ? " " : " ")
);
}
}
_RTW_PRINT_SEL(RTW_DBGDUMP, "\n");
if (eFuseWord)
rtw_mfree((u8 *)eFuseWord, EFUSE_MAX_SECTION_NUM * (EFUSE_MAX_WORD_UNIT * 2));
Expand Down
14 changes: 14 additions & 0 deletions core/rtw_br_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -114,7 +117,13 @@ static __inline__ int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_ta
/* have a room for new tag */
memmove(((unsigned char *)ph->tag + data_len), (unsigned char *)ph->tag, ntohs(ph->length));
ph->length = htons(ntohs(ph->length) + data_len);
#if (defined __GNUC__) && (__GNUC__ > 10)
#pragma GCC diagnostic ignored "-Wstringop-overread"
#endif
memcpy((unsigned char *)ph->tag, tag, data_len);
#if (defined __GNUC__) && (__GNUC__ > 10)
#pragma GCC diagnostic pop
#endif
return data_len;
}

Expand Down Expand Up @@ -948,6 +957,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) {
Expand Down Expand Up @@ -1016,8 +1026,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");
Expand Down
12 changes: 7 additions & 5 deletions core/rtw_mlme_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,11 +1831,13 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
ptable->func = &OnAuth;
else
ptable->func = &OnAuthClient;
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
__attribute__ ((fallthrough));
#else
__attribute__ ((__fallthrough__));
#endif
_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);
Expand Down
72 changes: 0 additions & 72 deletions core/rtw_mp.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
*****************************************************************************/
#define _RTW_MP_C_
#include <drv_types.h>
#ifdef PLATFORM_FREEBSD
#include <sys/unistd.h> /* for RFHIGHPID */
#endif

#include "../hal/phydm/phydm_precomp.h"
#if defined(CONFIG_RTL8723B) || defined(CONFIG_RTL8821A)
Expand Down Expand Up @@ -163,64 +160,6 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv)

}

#ifdef PLATFORM_WINDOWS
#if 0
void mp_wi_callback(
IN NDIS_WORK_ITEM *pwk_item,
IN PVOID cntx
)
{
_adapter *padapter = (_adapter *)cntx;
struct mp_priv *pmppriv = &padapter->mppriv;
struct mp_wi_cntx *pmp_wi_cntx = &pmppriv->wi_cntx;

/* Execute specified action. */
if (pmp_wi_cntx->curractfunc != NULL) {
LARGE_INTEGER cur_time;
ULONGLONG start_time, end_time;
NdisGetCurrentSystemTime(&cur_time); /* driver version */
start_time = cur_time.QuadPart / 10; /* The return value is in microsecond */

pmp_wi_cntx->curractfunc(padapter);

NdisGetCurrentSystemTime(&cur_time); /* driver version */
end_time = cur_time.QuadPart / 10; /* The return value is in microsecond */

}

NdisAcquireSpinLock(&(pmp_wi_cntx->mp_wi_lock));
pmp_wi_cntx->bmp_wi_progress = _FALSE;
NdisReleaseSpinLock(&(pmp_wi_cntx->mp_wi_lock));

if (pmp_wi_cntx->bmpdrv_unload)
NdisSetEvent(&(pmp_wi_cntx->mp_wi_evt));

}
#endif

static int init_mp_priv_by_os(struct mp_priv *pmp_priv)
{
struct mp_wi_cntx *pmp_wi_cntx;

if (pmp_priv == NULL)
return _FAIL;

pmp_priv->rx_testcnt = 0;
pmp_priv->rx_testcnt1 = 0;
pmp_priv->rx_testcnt2 = 0;

pmp_priv->tx_testcnt = 0;
pmp_priv->tx_testcnt1 = 0;

pmp_wi_cntx = &pmp_priv->wi_cntx
pmp_wi_cntx->bmpdrv_unload = _FALSE;
pmp_wi_cntx->bmp_wi_progress = _FALSE;
pmp_wi_cntx->curractfunc = NULL;

return _SUCCESS;
}
#endif

#ifdef PLATFORM_LINUX
static int init_mp_priv_by_os(struct mp_priv *pmp_priv)
{
Expand Down Expand Up @@ -1940,17 +1879,6 @@ void SetPacketTx(PADAPTER padapter)
pmp_priv->tx.PktTxThread = NULL;
}
#endif
#ifdef PLATFORM_FREEBSD
{
struct proc *p;
struct thread *td;
pmp_priv->tx.PktTxThread = kproc_kthread_add(mp_xmit_packet_thread, pmp_priv,
&p, &td, RFHIGHPID, 0, "MPXmitThread", "MPXmitThread");

if (pmp_priv->tx.PktTxThread < 0)
RTW_INFO("Create PktTx Thread Fail !!!!!\n");
}
#endif

Rtw_MPSetMacTxEDCA(padapter);
exit:
Expand Down
4 changes: 2 additions & 2 deletions core/rtw_security.c
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ u32 rtw_aes_encrypt(_adapter *padapter, u8 *pxmitframe)
pframe = ((struct xmit_frame *)pxmitframe)->buf_addr + hw_hdr_offset;

/* 4 start to encrypt each fragment */
if ((pattrib->encrypt == _AES_)) {
if (pattrib->encrypt == _AES_) {
/*
if(pattrib->psta)
{
Expand Down Expand Up @@ -1930,7 +1930,7 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe)
u32 res = _SUCCESS;
pframe = (unsigned char *)((union recv_frame *)precvframe)->u.hdr.rx_data;
/* 4 start to encrypt each fragment */
if ((prxattrib->encrypt == _AES_)) {
if (prxattrib->encrypt == _AES_) {

stainfo = rtw_get_stainfo(&padapter->stapriv , &prxattrib->ta[0]);
if (stainfo != NULL) {
Expand Down
2 changes: 1 addition & 1 deletion dkms.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME="realtek-rtl8188eus"
PACKAGE_VERSION="5.3.9~20200316"
PACKAGE_VERSION="5.3.9~20221105"
CLEAN="'make' clean"
BUILT_MODULE_NAME[0]=8188eu
PROCS_NUM=`nproc`
Expand Down
2 changes: 1 addition & 1 deletion hal/hal_dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ void rtw_hal_turbo_edca(_adapter *adapter)
return;
}

if ((pregpriv->wifi_spec == 1)) { /* || (pmlmeinfo->HT_enable == 0)) */
if (pregpriv->wifi_spec == 1) { /* || (pmlmeinfo->HT_enable == 0)) */
precvpriv->is_any_non_be_pkts = _FALSE;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion hal/hal_mp.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void hal_mpt_CCKTxPowerAdjust(PADAPTER Adapter, BOOLEAN bInCH14)
} else if (IS_HARDWARE_TYPE_8723D(Adapter)) {
/* 2.4G CCK TX DFIR */
/* 2016.01.20 Suggest from RS BB mingzhi*/
if ((u1Channel == 14)) {
if (u1Channel == 14) {
phy_set_bb_reg(Adapter, rCCK0_TxFilter2, bMaskDWord, 0x0000B81C);
phy_set_bb_reg(Adapter, rCCK0_DebugPort, bMaskDWord, 0x00000000);
phy_set_bb_reg(Adapter, 0xAAC, bMaskDWord, 0x00003667);
Expand Down
2 changes: 1 addition & 1 deletion hal/phydm/halrf/halrf.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ halrf_cmn_info_init(
void
halrf_cmn_info_hook(
void *dm_void,
u32 cmn_info,
enum halrf_cmninfo_hook cmn_info,
void *value
);

Expand Down
2 changes: 1 addition & 1 deletion hal/phydm/halrf/halrf_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*****************************************************************************/

#ifndef __HALRF_FEATURES_H__
#define __HALRF_FEATURES
#define __HALRF_FEATURES_H__

#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)

Expand Down
2 changes: 1 addition & 1 deletion hal/phydm/halrf/halrf_kfree.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


#ifndef __PHYDMKFREE_H__
#define __PHYDKFREE_H__
#define __PHYDMKFREE_H__

#define KFREE_VERSION "1.0"

Expand Down
Loading