Compare commits
28 Commits
upstream/5
...
kali/5.3.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e25e5ab54 | ||
|
|
5bb00118be | ||
|
|
aa31120624 | ||
|
|
9aa2cd13ac | ||
|
|
ca373d4356 | ||
|
|
aae9cdee3b | ||
|
|
322a5f0ea6 | ||
|
|
e2969545f3 | ||
|
|
da9706496e | ||
|
|
e105322274 | ||
|
|
f074eb5844 | ||
|
|
f075fe14db | ||
|
|
ec3c163afd | ||
|
|
fb75a987dd | ||
|
|
5a7f22dc1f | ||
|
|
6cdb6d8145 | ||
|
|
3ed934f66a | ||
|
|
2e8ec02f30 | ||
|
|
bb80d9b37d | ||
|
|
739e000bbf | ||
|
|
627a0f8e2c | ||
|
|
4bd5e85b7b | ||
|
|
1791b22180 | ||
|
|
ce21fa5d6b | ||
|
|
a313c3997a | ||
|
|
3b2b01c647 | ||
|
|
9c36ca92c2 | ||
|
|
ea83a483fa |
14
Makefile
14
Makefile
@@ -154,6 +154,7 @@ CONFIG_PLATFORM_AML_S905 = n
|
||||
CONFIG_PLATFORM_ZTE_ZX296716 = n
|
||||
CONFIG_PLATFORM_ARM_ODROIDC2 = n
|
||||
CONFIG_PLATFORM_PPC = n
|
||||
CONFIG_PLATFORM_PPC64LE = n
|
||||
###############################################################
|
||||
|
||||
CONFIG_DRVEXT_MODULE = n
|
||||
@@ -1031,7 +1032,7 @@ EXTRA_CFLAGS += -DDM_ODM_SUPPORT_TYPE=0x04
|
||||
ifeq ($(CONFIG_PLATFORM_I386_PC), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
|
||||
SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;")
|
||||
SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc64le/powerpc/; s/ppc/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;")
|
||||
ARCH ?= $(SUBARCH)
|
||||
CROSS_COMPILE ?=
|
||||
KVER := $(shell uname -r)
|
||||
@@ -1085,6 +1086,17 @@ MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
|
||||
INSTALL_PREFIX :=
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_PPC64LE), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
SUBARCH := $(shell uname -m | sed -e s/ppc64le/powerpc/)
|
||||
ARCH ?= $(SUBARCH)
|
||||
CROSS_COMPILE ?=
|
||||
KVER ?= $(shell uname -r)
|
||||
KSRC := /lib/modules/$(KVER)/build
|
||||
MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
|
||||
INSTALL_PREFIX :=
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PLATFORM_NV_TK1), y)
|
||||
EXTRA_CFLAGS += -DCONFIG_PLATFORM_NV_TK1
|
||||
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
|
||||
|
||||
10
README.md
10
README.md
@@ -18,19 +18,19 @@
|
||||
* MESH Support
|
||||
* Monitor mode
|
||||
* Frame injection
|
||||
* Up to kernel v5.3+
|
||||
* Up to kernel v5.8+
|
||||
... 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" > "/etc/modprobe.d/realtek.conf"
|
||||
3. "make && make install"<br>
|
||||
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.
|
||||
|
||||
# MONITOR MODE howto
|
||||
Use these steps to enter monitor mode.
|
||||
```
|
||||
$ sudo airmon-ng check-kill
|
||||
$ sudo airmon-ng check kill
|
||||
$ sudo ip link set <interface> down
|
||||
$ sudo iw dev <interface> set type monitor
|
||||
```
|
||||
@@ -42,7 +42,7 @@ $ aireplay -9 <interface>
|
||||
|
||||
# NetworkManager configuration
|
||||
Add these lines below to "NetworkManager.conf" and ADD YOUR ADAPTER MAC below [keyfile]
|
||||
This will make the Network-Manager ignore the device, and therefor don't cause problems.
|
||||
This will make the Network-Manager ignore the device, and therefore don't cause problems.
|
||||
```
|
||||
[device]
|
||||
wifi.scan-rand-mac-address=no
|
||||
|
||||
@@ -2133,6 +2133,7 @@ BIP_exit:
|
||||
#ifndef PLATFORM_FREEBSD
|
||||
#if defined(CONFIG_TDLS)
|
||||
/* compress 512-bits */
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
|
||||
static int sha256_compress(struct sha256_state *md, unsigned char *buf)
|
||||
{
|
||||
u32 S[8], W[64], t0, t1;
|
||||
@@ -2179,8 +2180,10 @@ static int sha256_compress(struct sha256_state *md, unsigned char *buf)
|
||||
md->state[i] = md->state[i] + S[i];
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Initialize the hash state */
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
|
||||
static void sha256_init(struct sha256_state *md)
|
||||
{
|
||||
md->curlen = 0;
|
||||
@@ -2194,6 +2197,7 @@ static void sha256_init(struct sha256_state *md)
|
||||
md->state[6] = 0x1F83D9ABUL;
|
||||
md->state[7] = 0x5BE0CD19UL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
Process a block of memory though the hash
|
||||
@@ -2202,6 +2206,8 @@ static void sha256_init(struct sha256_state *md)
|
||||
@param inlen The length of the data (octets)
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
|
||||
static int sha256_process(struct sha256_state *md, unsigned char *in,
|
||||
unsigned long inlen)
|
||||
{
|
||||
@@ -2235,7 +2241,7 @@ static int sha256_process(struct sha256_state *md, unsigned char *in,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
Terminate the hash to get the digest
|
||||
@@ -2243,6 +2249,7 @@ static int sha256_process(struct sha256_state *md, unsigned char *in,
|
||||
@param out [out] The destination of the hash (32 bytes)
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
|
||||
static int sha256_done(struct sha256_state *md, unsigned char *out)
|
||||
{
|
||||
int i;
|
||||
@@ -2281,6 +2288,7 @@ static int sha256_done(struct sha256_state *md, unsigned char *out)
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* sha256_vector - SHA256 hash for data vector
|
||||
@@ -2290,6 +2298,8 @@ static int sha256_done(struct sha256_state *md, unsigned char *out)
|
||||
* @mac: Buffer for the hash
|
||||
* Returns: 0 on success, -1 of failure
|
||||
*/
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
|
||||
static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len,
|
||||
u8 *mac)
|
||||
{
|
||||
@@ -2304,6 +2314,7 @@ static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len,
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static u8 os_strlen(const char *s)
|
||||
{
|
||||
@@ -2344,6 +2355,7 @@ static int os_memcmp(const void *s1, const void *s2, u8 n)
|
||||
* @mac: Buffer for the hash (32 bytes)
|
||||
*/
|
||||
#if defined(CONFIG_TDLS)
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
|
||||
static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
|
||||
u8 *addr[], size_t *len, u8 *mac)
|
||||
{
|
||||
@@ -2405,6 +2417,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
|
||||
_len[1] = 32;
|
||||
sha256_vector(2, _addr, _len, mac);
|
||||
}
|
||||
#endif
|
||||
#endif /* CONFIG_TDLS */
|
||||
#endif /* PLATFORM_FREEBSD */
|
||||
/**
|
||||
@@ -2422,6 +2435,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
|
||||
*/
|
||||
#ifndef PLATFORM_FREEBSD /* Baron */
|
||||
#if defined(CONFIG_TDLS)
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
|
||||
static void sha256_prf(u8 *key, size_t key_len, char *label,
|
||||
u8 *data, size_t data_len, u8 *buf, size_t buf_len)
|
||||
{
|
||||
@@ -2459,6 +2473,7 @@ static void sha256_prf(u8 *key, size_t key_len, char *label,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif /* PLATFORM_FREEBSD Baron */
|
||||
|
||||
/* AES tables*/
|
||||
|
||||
5
debian/README.Debian
vendored
Normal file
5
debian/README.Debian
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
realtek-rtl8188eus-dkms for Debian
|
||||
---------------------------------
|
||||
|
||||
This package was automatically generated by the DKMS system,
|
||||
for distribution on Debian based operating systems.
|
||||
57
debian/changelog
vendored
Normal file
57
debian/changelog
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
realtek-rtl8188eus-dkms (5.3.9~git20210206.1e7145f-0kali2) kali-dev; urgency=medium
|
||||
|
||||
* Bump Standards-Version to 4.5.1
|
||||
* Blacklist r8188eu
|
||||
|
||||
-- Sophie Brun <sophie@offensive-security.com> Tue, 13 Jul 2021 10:50:42 +0200
|
||||
|
||||
realtek-rtl8188eus-dkms (5.3.9~git20210206.1e7145f-0kali1) kali-dev; urgency=medium
|
||||
|
||||
* Update debian/watch
|
||||
* New upstream version 5.3.9~git20210206.1e7145f
|
||||
* Refresh patches
|
||||
|
||||
-- Sophie Brun <sophie@offensive-security.com> Wed, 14 Apr 2021 17:25:11 +0200
|
||||
|
||||
realtek-rtl8188eus-dkms (5.3.9~git20201227-0kali1) kali-dev; urgency=medium
|
||||
|
||||
* New upstream version 5.3.9~git20201227
|
||||
* Refresh patches
|
||||
|
||||
-- Sophie Brun <sophie@offensive-security.com> Tue, 26 Jan 2021 17:04:18 +0100
|
||||
|
||||
realtek-rtl8188eus-dkms (5.3.9~git20200829-0kali2) kali-dev; urgency=medium
|
||||
|
||||
* Fix errors introduced in 5a7f22 (lintian-overrides)
|
||||
|
||||
-- Sophie Brun <sophie@offensive-security.com> Wed, 16 Sep 2020 15:54:13 +0200
|
||||
|
||||
realtek-rtl8188eus-dkms (5.3.9~git20200829-0kali1) kali-dev; urgency=medium
|
||||
|
||||
* New upstream version 5.3.9~git20200829
|
||||
* Refresh patches
|
||||
* Add comment in debian/copyright
|
||||
* Bump Standards-Version to 4.5.0
|
||||
* Add lintian-overrides for dh-exec-subst-unknown-variable
|
||||
|
||||
-- Sophie Brun <sophie@offensive-security.com> Wed, 16 Sep 2020 15:07:29 +0200
|
||||
|
||||
realtek-rtl8188eus-dkms (5.3.9~git20200710-0kali1) kali-dev; urgency=medium
|
||||
|
||||
* New upstream version 5.3.9~20200710
|
||||
|
||||
-- Sophie Brun <sophie@offensive-security.com> Fri, 10 Jul 2020 08:49:51 +0200
|
||||
|
||||
realtek-rtl8188eus-dkms (5.3.9~git20200316-0kali1) kali-dev; urgency=medium
|
||||
|
||||
* Configure git-buildpackage for Kali
|
||||
* Add GitLab's CI configuration file
|
||||
* New upstream version 5.3.9~git20200316
|
||||
|
||||
-- Sophie Brun <sophie@offensive-security.com> Thu, 14 May 2020 11:45:14 +0200
|
||||
|
||||
realtek-rtl8188eus-dkms (5.3.9~20191129-0kali1) kali-dev; urgency=medium
|
||||
|
||||
* Initial release (see 5842)
|
||||
|
||||
-- Sophie Brun <sophie@offensive-security.com> Tue, 17 Dec 2019 17:14:38 +0100
|
||||
19
debian/control
vendored
Normal file
19
debian/control
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Source: realtek-rtl8188eus-dkms
|
||||
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
|
||||
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
|
||||
|
||||
Package: realtek-rtl8188eus-dkms
|
||||
Architecture: all
|
||||
Depends: dkms (>= 1.95), ${misc:Depends}
|
||||
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.
|
||||
|
||||
34
debian/copyright
vendored
Normal file
34
debian/copyright
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: realtek-rtl8188eus-dkms
|
||||
Source: https://github.com/aircrack-ng/rtl8188eus
|
||||
Comment: dkms package built during installation
|
||||
|
||||
Files: *
|
||||
Copyright: 2007 - 2017 Realtek Corporation.
|
||||
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>
|
||||
License: GPL-2
|
||||
|
||||
Files: debian/*
|
||||
Copyright: 2019 Sophie Brun <sophie@offensive-security.com>
|
||||
License: GPL-2
|
||||
|
||||
License: GPL-2
|
||||
This package is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License version 2 as published
|
||||
by the Free Software Foundation.
|
||||
.
|
||||
This package is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>
|
||||
.
|
||||
On Debian systems, the complete text of the GNU General
|
||||
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
|
||||
10
debian/gbp.conf
vendored
Normal file
10
debian/gbp.conf
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
[DEFAULT]
|
||||
debian-branch = kali/master
|
||||
debian-tag = kali/%(version)s
|
||||
pristine-tar = True
|
||||
|
||||
[pq]
|
||||
patch-numbers = False
|
||||
|
||||
[dch]
|
||||
multimaint-merge = True
|
||||
2
debian/kali-ci.yml
vendored
Normal file
2
debian/kali-ci.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
include:
|
||||
- https://gitlab.com/kalilinux/tools/kali-ci-pipeline/raw/master/recipes/kali.yml
|
||||
20
debian/patches/Change-dkms-version.patch
vendored
Normal file
20
debian/patches/Change-dkms-version.patch
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
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..0ec5a51 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_git20210206.1e7145f"
|
||||
CLEAN="'make' clean"
|
||||
BUILT_MODULE_NAME[0]=8188eu
|
||||
PROCS_NUM=`nproc`
|
||||
1
debian/patches/series
vendored
Normal file
1
debian/patches/series
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Change-dkms-version.patch
|
||||
2
debian/r8188eus-dkms.conf
vendored
Normal file
2
debian/r8188eus-dkms.conf
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# blacklist the driver
|
||||
blacklist r8188eu
|
||||
1
debian/realtek-rtl8188eus-dkms.docs
vendored
Normal file
1
debian/realtek-rtl8188eus-dkms.docs
vendored
Normal file
@@ -0,0 +1 @@
|
||||
README.md
|
||||
3
debian/realtek-rtl8188eus-dkms.install
vendored
Executable file
3
debian/realtek-rtl8188eus-dkms.install
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/dh-exec
|
||||
core hal include Kconfig Makefile os_dep platform usr/src/realtek-rtl8188eus-${DEB_VERSION_UPSTREAM}
|
||||
debian/r8188eus-dkms.conf etc/modprobe.d
|
||||
21
debian/rules
vendored
Executable file
21
debian/rules
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/make -f
|
||||
#export DH_VERBOSE = 1
|
||||
|
||||
include /usr/share/dpkg/pkg-info.mk
|
||||
export DEB_VERSION_UPSTREAM
|
||||
|
||||
%:
|
||||
dh $@ --with dkms
|
||||
|
||||
override_dh_dkms:
|
||||
dh_dkms -V $(DEB_VERSION_UPSTREAM) -- dkms.conf
|
||||
|
||||
override_dh_fixperms:
|
||||
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
|
||||
# installation using dkms)
|
||||
override_dh_auto_configure:
|
||||
override_dh_auto_build:
|
||||
override_dh_auto_install:
|
||||
22
debian/script-targz
vendored
Executable file
22
debian/script-targz
vendored
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" = '--upstream-version' ]; then
|
||||
new_version="$2"
|
||||
else
|
||||
printf "Missing --upstream-version argument" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DEB_SOURCE="$(dpkg-parsechangelog -SSource)"
|
||||
|
||||
default_branch="$(git remote show https://github.com/aircrack-ng/rtl8188eus.git | grep 'HEAD' | sed 's/.*: v//')"
|
||||
|
||||
version="$(echo ${new_version} | sed 's/~git.*//')"
|
||||
|
||||
# fails if the upstream default branch has changed and is no longer the
|
||||
# version mentioned in debian/watch
|
||||
if [ "${default_branch}" != "${version}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
1
debian/source/format
vendored
Normal file
1
debian/source/format
vendored
Normal file
@@ -0,0 +1 @@
|
||||
3.0 (quilt)
|
||||
2
debian/source/lintian-overrides
vendored
Normal file
2
debian/source/lintian-overrides
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
#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
|
||||
9
debian/watch
vendored
Normal file
9
debian/watch
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
version=4
|
||||
opts="mode=git, pretty=5.3.9~git%cd.%h, pgpmode=none" \
|
||||
https://github.com/aircrack-ng/rtl8188eus.git \
|
||||
HEAD debian debian/script-targz
|
||||
|
||||
# Use the following when upstream starts to tag releases:
|
||||
#opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%realtek-rtl8188eus-dkms-$1.tar.gz%" \
|
||||
# https://github.com/aircrack-ng/rtl8188eus/tags \
|
||||
# (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate
|
||||
@@ -249,11 +249,13 @@ struct security_priv {
|
||||
#define SEC_IS_BIP_KEY_INSTALLED(sec) _FALSE
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
|
||||
struct sha256_state {
|
||||
u64 length;
|
||||
u32 state[8], curlen;
|
||||
u8 buf[64];
|
||||
};
|
||||
#endif
|
||||
|
||||
#define GET_ENCRY_ALGO(psecuritypriv, psta, encry_algo, bmcst)\
|
||||
do {\
|
||||
|
||||
@@ -686,18 +686,12 @@ static int rtw_cfg80211_sync_iftype(_adapter *adapter)
|
||||
|
||||
static u64 rtw_get_systime_us(void)
|
||||
{
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
|
||||
struct timespec64 ts;
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0))
|
||||
struct timespec ts;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
|
||||
getboottime64(&ts);
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
|
||||
getboottime(&ts);
|
||||
#else
|
||||
get_monotonic_boottime(&ts);
|
||||
#endif
|
||||
return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000;
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
|
||||
return ktime_to_us(ktime_get_boottime());
|
||||
#else
|
||||
struct timeval tv;
|
||||
do_gettimeofday(&tv);
|
||||
@@ -7100,11 +7094,26 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
|
||||
#else
|
||||
struct net_device *ndev,
|
||||
#endif
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
|
||||
struct mgmt_frame_regs *upd)
|
||||
#else
|
||||
u16 frame_type, bool reg)
|
||||
#endif
|
||||
|
||||
{
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
|
||||
u32 rtw_mask = BIT(IEEE80211_STYPE_PROBE_REQ >> 4);
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
|
||||
struct net_device *ndev = wdev_to_ndev(wdev);
|
||||
#endif
|
||||
|
||||
/* hardcoded always true, to make it pass compilation */
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
|
||||
bool reg = true;
|
||||
#endif
|
||||
|
||||
_adapter *adapter;
|
||||
|
||||
struct rtw_wdev_priv *pwdev_priv;
|
||||
@@ -7116,14 +7125,24 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
|
||||
pwdev_priv = adapter_wdev_data(adapter);
|
||||
|
||||
#ifdef CONFIG_DEBUG_CFG80211
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
|
||||
RTW_INFO(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter),
|
||||
frame_type, reg);
|
||||
#else
|
||||
RTW_INFO(FUNC_ADPT_FMT " old_regs:%x new_regs:%x\n",
|
||||
FUNC_ADPT_ARG(adapter), pwdev_priv->mgmt_mask, upd->interface_stypes);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Wait QC Verify */
|
||||
return;
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
|
||||
switch (upd->interface_stypes) {
|
||||
#else
|
||||
switch (frame_type) {
|
||||
#endif
|
||||
|
||||
case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */
|
||||
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
|
||||
break;
|
||||
@@ -7133,7 +7152,13 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#else
|
||||
if ((upd->interface_stypes & rtw_mask) == (pwdev_priv->mgmt_mask & rtw_mask))
|
||||
return;
|
||||
|
||||
pwdev_priv->mgmt_mask = upd->interface_stypes;
|
||||
#endif
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
@@ -9438,7 +9463,11 @@ 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))
|
||||
.update_mgmt_frame_registrations = cfg80211_rtw_mgmt_frame_register,
|
||||
#else
|
||||
.mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
|
||||
#endif
|
||||
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
|
||||
.action = cfg80211_rtw_mgmt_tx,
|
||||
#endif
|
||||
@@ -9772,5 +9801,3 @@ void rtw_cfg80211_dev_res_unregister(struct dvobj_priv *dvobj)
|
||||
rtw_wiphy_unregister(dvobj_to_wiphy(dvobj));
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* CONFIG_IOCTL_CFG80211 */
|
||||
|
||||
@@ -167,6 +167,10 @@ struct rtw_wdev_priv {
|
||||
bool block;
|
||||
bool block_scan;
|
||||
bool power_mgmt;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)
|
||||
u32 mgmt_mask;
|
||||
#endif
|
||||
|
||||
/* report mgmt_frame registered */
|
||||
u16 report_mgmt;
|
||||
|
||||
@@ -158,6 +158,7 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
|
||||
{USB_DEVICE(0x2001, 0x330F), .driver_info = RTL8188E}, /* DLink DWA-125 REV D1 */
|
||||
{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 */
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2139,15 +2139,19 @@ static int isFileReadable(const char *path, u32 *sz)
|
||||
{
|
||||
struct file *fp;
|
||||
int ret = 0;
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
mm_segment_t oldfs;
|
||||
#endif
|
||||
char buf;
|
||||
|
||||
fp = filp_open(path, O_RDONLY, 0);
|
||||
if (IS_ERR(fp))
|
||||
ret = PTR_ERR(fp);
|
||||
else {
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
#endif
|
||||
|
||||
if (1 != readFile(fp, &buf, 1))
|
||||
ret = PTR_ERR(fp);
|
||||
@@ -2159,8 +2163,9 @@ static int isFileReadable(const char *path, u32 *sz)
|
||||
*sz = i_size_read(fp->f_dentry->d_inode);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
set_fs(oldfs);
|
||||
#endif
|
||||
filp_close(fp, NULL);
|
||||
}
|
||||
return ret;
|
||||
@@ -2176,7 +2181,9 @@ static int isFileReadable(const char *path, u32 *sz)
|
||||
static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
||||
{
|
||||
int ret = -1;
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
mm_segment_t oldfs;
|
||||
#endif
|
||||
struct file *fp;
|
||||
|
||||
if (path && buf) {
|
||||
@@ -2184,10 +2191,14 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
||||
if (0 == ret) {
|
||||
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
#endif
|
||||
ret = readFile(fp, buf, sz);
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
set_fs(oldfs);
|
||||
#endif
|
||||
closeFile(fp);
|
||||
|
||||
RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret);
|
||||
@@ -2211,7 +2222,9 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
||||
static int storeToFile(const char *path, u8 *buf, u32 sz)
|
||||
{
|
||||
int ret = 0;
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
mm_segment_t oldfs;
|
||||
#endif
|
||||
struct file *fp;
|
||||
|
||||
if (path && buf) {
|
||||
@@ -2219,10 +2232,14 @@ static int storeToFile(const char *path, u8 *buf, u32 sz)
|
||||
if (0 == ret) {
|
||||
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
|
||||
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
#endif
|
||||
ret = writeFile(fp, buf, sz);
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
||||
set_fs(oldfs);
|
||||
#endif
|
||||
closeFile(fp);
|
||||
|
||||
RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret);
|
||||
|
||||
Reference in New Issue
Block a user