Compare commits

..
Author SHA1 Message Date
Sophie Brun ea83a483fa Initial release 2019-12-17 17:34:14 +01:00
31 changed files with 177 additions and 293 deletions
View File
-46
View File
@@ -1,46 +0,0 @@
## Build Kernel Headers
```
cd [your kernel source directory]
make module_prepare
make modules_install INSTALL_MOD_PATH=../
```
## Build RTL8188EUS driver/modules
```
cd ../
git clone https://github.com/aircrack-ng/rtl8188eus -b v5.3.9
cd rtl8188eus
```
That command places this driver behind your kernel source directory (RECOMMENDED).
If you put it anywhere you might need to set the Makefile in this driver, but i won't explain it.
Now, do:
```
export ARCH=arm64
export SUBARCH=arm64
export CROSS_COMPILE=../toolchain/toolchain64/bin/aarch64-linux-android-
export KBUILD_KVER=3.10.73-NetHunter-something
```
arm64 is the device architecture.
CROSS_COMPILE is your toolchain directory.
KBUILD_KVER is your kernel build version, you can search for it in ../lib/modules (the place of your modules_install when you build kernel headers).
Now, do:
```
make
```
If there is no error or success you will see a file named 8188eu.ko in this driver directory.
## Load the driver (8188eu.ko)
```
su
cd /system/lib/modules
insmod 8188eu.ko
```
+2 -2
View File
@@ -1,6 +1,6 @@
config RTL8188EU config RTL8188EUS
tristate "Realtek 8188E USB WiFi" tristate "Realtek 8188E USB WiFi"
depends on USB depends on USB
---help--- ---help---
Help message of RTL8188EU Help message of RTL8188EUS
+20 -16
View File
@@ -1,14 +1,30 @@
EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS) -fno-pie EXTRA_CFLAGS += $(USER_EXTRA_CFLAGS) -fno-pie
EXTRA_CFLAGS += -O1 EXTRA_CFLAGS += -O1
#EXTRA_CFLAGS += -O3 #EXTRA_CFLAGS += -O3
#EXTRA_CFLAGS += -Wall
#EXTRA_CFLAGS += -Wextra
#EXTRA_CFLAGS += -Werror
#EXTRA_CFLAGS += -pedantic
#EXTRA_CFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes
EXTRA_CFLAGS += -Wno-unused-variable EXTRA_CFLAGS += -Wno-unused-variable
EXTRA_CFLAGS += -Wno-unused-value EXTRA_CFLAGS += -Wno-unused-value
EXTRA_CFLAGS += -Wno-unused-label EXTRA_CFLAGS += -Wno-unused-label
EXTRA_CFLAGS += -Wno-unused-parameter EXTRA_CFLAGS += -Wno-unused-parameter
EXTRA_CFLAGS += -Wno-unused-function EXTRA_CFLAGS += -Wno-unused-function
EXTRA_CFLAGS += -Wno-unused EXTRA_CFLAGS += -Wno-unused
#EXTRA_CFLAGS += -Wno-uninitialized
EXTRA_CFLAGS += -Wno-vla EXTRA_CFLAGS += -Wno-vla
#EXTRA_CFLAGS += -Wno-cast-function-type
EXTRA_CFLAGS += -Wno-date-time EXTRA_CFLAGS += -Wno-date-time
#EXTRA_CFLAGS += -Wno-misleading-indentation
#EXTRA_CFLAGS += -Wno-uninitialized
# Relax some warnings from '-Wextra' so we won't get flooded with warnings
#EXTRA_CFLAGS += -Wno-sign-compare
#EXTRA_CFLAGS += -Wno-missing-field-initializers
#EXTRA_CFLAGS += -Wno-type-limits
EXTRA_CFLAGS += -Wno-implicit-fallthrough
EXTRA_CFLAGS += -Wno-maybe-uninitialized
GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc ) GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )
ifeq ($(GCC_VER_49),1) ifeq ($(GCC_VER_49),1)
@@ -40,7 +56,7 @@ CONFIG_PCI_HCI = n
CONFIG_SDIO_HCI = n CONFIG_SDIO_HCI = n
CONFIG_GSPI_HCI = n CONFIG_GSPI_HCI = n
########################## Features ########################### ########################## Features ###########################
CONFIG_NET_NS = y CONFIG_NET_NS = n
CONFIG_MP_INCLUDED = y CONFIG_MP_INCLUDED = y
CONFIG_POWER_SAVING = n CONFIG_POWER_SAVING = n
CONFIG_USB_AUTOSUSPEND = n CONFIG_USB_AUTOSUSPEND = n
@@ -73,10 +89,10 @@ CONFIG_RTW_IPCAM_APPLICATION = n
CONFIG_RTW_REPEATER_SON = n CONFIG_RTW_REPEATER_SON = n
CONFIG_RTW_WIFI_HAL = y CONFIG_RTW_WIFI_HAL = y
########################## Debug ########################### ########################## Debug ###########################
CONFIG_RTW_DEBUG = n CONFIG_RTW_DEBUG = y
# default log level is _DRV_INFO_ = 4, # default log level is _DRV_INFO_ = 4,
# please refer to "How_to_set_driver_debug_log_level.doc" to set the available level. # please refer to "How_to_set_driver_debug_log_level.doc" to set the available level.
CONFIG_RTW_LOG_LEVEL = 0 CONFIG_RTW_LOG_LEVEL = 4
######################## Wake On Lan ########################## ######################## Wake On Lan ##########################
CONFIG_WOWLAN = n CONFIG_WOWLAN = n
CONFIG_WAKEUP_TYPE = 0x7 #bit2: deauth, bit1: unicast, bit0: magic pkt. CONFIG_WAKEUP_TYPE = 0x7 #bit2: deauth, bit1: unicast, bit0: magic pkt.
@@ -154,7 +170,6 @@ CONFIG_PLATFORM_AML_S905 = n
CONFIG_PLATFORM_ZTE_ZX296716 = n CONFIG_PLATFORM_ZTE_ZX296716 = n
CONFIG_PLATFORM_ARM_ODROIDC2 = n CONFIG_PLATFORM_ARM_ODROIDC2 = n
CONFIG_PLATFORM_PPC = n CONFIG_PLATFORM_PPC = n
CONFIG_PLATFORM_PPC64LE = n
############################################################### ###############################################################
CONFIG_DRVEXT_MODULE = n CONFIG_DRVEXT_MODULE = n
@@ -1032,7 +1047,7 @@ EXTRA_CFLAGS += -DDM_ODM_SUPPORT_TYPE=0x04
ifeq ($(CONFIG_PLATFORM_I386_PC), y) ifeq ($(CONFIG_PLATFORM_I386_PC), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT
SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc64le/powerpc/; s/ppc/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;") SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc/powerpc/; s/armv.l/arm/; s/aarch64/arm64/;")
ARCH ?= $(SUBARCH) ARCH ?= $(SUBARCH)
CROSS_COMPILE ?= CROSS_COMPILE ?=
KVER := $(shell uname -r) KVER := $(shell uname -r)
@@ -1086,17 +1101,6 @@ MODDESTDIR := /lib/modules/$(KVER)/kernel/drivers/net/wireless/
INSTALL_PREFIX := INSTALL_PREFIX :=
endif 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) ifeq ($(CONFIG_PLATFORM_NV_TK1), y)
EXTRA_CFLAGS += -DCONFIG_PLATFORM_NV_TK1 EXTRA_CFLAGS += -DCONFIG_PLATFORM_NV_TK1
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN
+24 -19
View File
@@ -5,44 +5,46 @@
[![Monitor mode](https://img.shields.io/badge/monitor%20mode-supported-brightgreen.svg)](#) [![Monitor mode](https://img.shields.io/badge/monitor%20mode-supported-brightgreen.svg)](#)
[![Frame Injection](https://img.shields.io/badge/frame%20injection-supported-brightgreen.svg)](#) [![Frame Injection](https://img.shields.io/badge/frame%20injection-supported-brightgreen.svg)](#)
[![MESH Mode](https://img.shields.io/badge/mesh%20mode-supported-brightgreen.svg)](#) [![MESH Mode](https://img.shields.io/badge/mesh%20mode-supported-brightgreen.svg)](#)
[![GitHub issues](https://img.shields.io/github/issues/aircrack-ng/rtl8188eus.svg)](https://github.com/aircrack-ng/rtl8188eus/issues) [![GitHub issues](https://img.shields.io/github/issues/kimocoder/rtl8188eus.svg)](https://github.com/kimocoder/rtl8188eus/issues)
[![GitHub forks](https://img.shields.io/github/forks/aircrack-ng/rtl8188eus.svg)](https://github.com/aircrack-ng/rtl8188eus/network) [![GitHub forks](https://img.shields.io/github/forks/kimocoder/rtl8188eus.svg)](https://github.com/kimocoder/rtl8188eus/network)
[![GitHub stars](https://img.shields.io/github/stars/aircrack-ng/rtl8188eus.svg)](https://github.com/aircrack-ng/rtl8188eus/stargazers) [![GitHub stars](https://img.shields.io/github/stars/kimocoder/rtl8188eus.svg)](https://github.com/kimocoder/rtl8188eus/stargazers)
[![GitHub license](https://img.shields.io/github/license/aircrack-ng/rtl8812au.svg)](https://github.com/aircrack-ng/rtl8188eus/blob/master/LICENSE)<br> [![GitHub license](https://img.shields.io/github/license/kimocoder/rtl8812au.svg)](https://github.com/kimocoder/rtl8188eus/blob/master/LICENSE)<br>
[![Android](https://img.shields.io/badge/android%20(8)-supported-brightgreen.svg)](#) [![Android](https://img.shields.io/badge/android%20(8)-supported-brightgreen.svg)](#)
[![aircrack-ng](https://img.shields.io/badge/aircrack--ng-supported-blue.svg)](#) [![aircrack-ng](https://img.shields.io/badge/aircrack--ng-supported-blue.svg)](#)
This is a pure Realtek release, not from vendor but from all the Realtek multichip "bases"
we've seen, this must be the newest, most stable and effective one.
The performance and code quality has been improved.
# Supports # Supports
* Android 7
* MESH Support * MESH Support
* Monitor mode * Monitor mode
* Frame injection * Frame injection
* Up to kernel v5.8+ * Up to kernel v5.3+
... And a bunch of various wifi chipsets ... And a bunch of various wifi chipsets
# Howto build/install # Howto build/install
1. You will need to blacklist another driver in order to use this one. 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'` 2. "echo "blacklist r8188eu.ko" > "/etc/modprobe.d/realtek.conf"
3. `make && sudo make install` 3. "make && make install"<br>
4. Reboot in order to blacklist and load the new driver/module. 4. Reboot in order to blacklist and load the new driver/module.
# MONITOR MODE howto # MONITOR MODE howto
Use these steps to enter monitor mode. Use these steps to enter monitor mode.
``` ```
$ sudo airmon-ng check kill airmon-ng check-kill
$ sudo ip link set <interface> down ip link set <interface> down
$ sudo iw dev <interface> set type monitor iw dev <interface> set type monitor
``` ```
Frame injection test may be performed with Frame injection test may be performed with
(after kernel v5.2 scanning is slow, run a scan or simply an airodump-ng first!) (after kernel v5.2 scanning is slow, run a scan or simply an airodump-ng first!)
``` ```
$ aireplay -9 <interface> aireplay -9 <interface>
``` ```
# NetworkManager configuration # NetworkManager configuration
Add these lines below to "NetworkManager.conf" and ADD YOUR ADAPTER MAC below [keyfile] Add these lines below to "NetworkManager.conf" and ADD YOUR ADAPTER MAC below [keyfile]
This will make the Network-Manager ignore the device, and therefore don't cause problems. This will make the Network-Manager ignore the device, and therefor don't cause problems.
``` ```
[device] [device]
wifi.scan-rand-mac-address=no wifi.scan-rand-mac-address=no
@@ -60,9 +62,12 @@ plugins=keyfile
unmanaged-devices=mac:A7:A7:A7:A7:A7 unmanaged-devices=mac:A7:A7:A7:A7:A7
``` ```
# Credits # TODO
Realtek - https://www.realtek.com<br> * Implement txpower control
Alfa Networks - https://www.alfa.com.tw<br>
aircrack-ng. - https://www.aircrack-ng.org<br> * Finish up the elimination of the wrapper _rtw_memset.
<br> I didn't have more time after "rtw_beamforming.c"
And all those who may be using or contributing to it of anykind. Thanks!<br>
* Add more VID/PIDS for all 3 chipsets supported.
-2
View File
@@ -6051,7 +6051,6 @@ ssize_t proc_set_lck(struct file *file, const char __user *buffer, size_t count,
inline void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring, inline void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring,
bool _idx_show, const u8 *_hexdata, int _hexdatalen) bool _idx_show, const u8 *_hexdata, int _hexdatalen)
{ {
#ifdef CONFIG_RTW_DEBUG
int __i; int __i;
u8 *ptr = (u8 *)_hexdata; u8 *ptr = (u8 *)_hexdata;
@@ -6077,7 +6076,6 @@ inline void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring,
} }
_RTW_PRINT_SEL(sel, "\n"); _RTW_PRINT_SEL(sel, "\n");
} }
#endif
} }
#else #else
inline void _RTW_STR_DUMP_SEL(void *sel, char *str_out) inline void _RTW_STR_DUMP_SEL(void *sel, char *str_out)
+1 -5
View File
@@ -1831,11 +1831,7 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
ptable->func = &OnAuth; ptable->func = &OnAuth;
else else
ptable->func = &OnAuthClient; ptable->func = &OnAuthClient;
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) /* pass through */
__attribute__ ((fallthrough));
#else
__attribute__ ((__fallthrough__));
#endif
case WIFI_ASSOCREQ: case WIFI_ASSOCREQ:
case WIFI_REASSOCREQ: case WIFI_REASSOCREQ:
_mgt_dispatcher(padapter, ptable, precv_frame); _mgt_dispatcher(padapter, ptable, precv_frame);
+10 -25
View File
@@ -982,6 +982,13 @@ static void next_key(u8 *key, sint round);
static void byte_sub(u8 *in, u8 *out); static void byte_sub(u8 *in, u8 *out);
static void shift_row(u8 *in, u8 *out); static void shift_row(u8 *in, u8 *out);
static void mix_column(u8 *in, u8 *out); static void mix_column(u8 *in, u8 *out);
#ifndef PLATFORM_FREEBSD
static void add_round_key(u8 *shiftrow_in,
u8 *mcol_in,
u8 *block_in,
sint round,
u8 *out);
#endif /* PLATFORM_FREEBSD */
static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext); static void aes128k128d(u8 *key, u8 *data, u8 *ciphertext);
@@ -1922,6 +1929,7 @@ u32 rtw_aes_decrypt(_adapter *padapter, u8 *precvframe)
sint length; sint length;
u32 prwskeylen;
u8 *pframe, *prwskey; /* , *payload,*iv */ u8 *pframe, *prwskey; /* , *payload,*iv */
struct sta_info *stainfo; struct sta_info *stainfo;
struct rx_pkt_attrib *prxattrib = &((union recv_frame *)precvframe)->u.hdr.attrib; struct rx_pkt_attrib *prxattrib = &((union recv_frame *)precvframe)->u.hdr.attrib;
@@ -2131,9 +2139,7 @@ BIP_exit:
#endif /* CONFIG_IEEE80211W */ #endif /* CONFIG_IEEE80211W */
#ifndef PLATFORM_FREEBSD #ifndef PLATFORM_FREEBSD
#if defined(CONFIG_TDLS)
/* compress 512-bits */ /* compress 512-bits */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
static int sha256_compress(struct sha256_state *md, unsigned char *buf) static int sha256_compress(struct sha256_state *md, unsigned char *buf)
{ {
u32 S[8], W[64], t0, t1; u32 S[8], W[64], t0, t1;
@@ -2180,10 +2186,8 @@ static int sha256_compress(struct sha256_state *md, unsigned char *buf)
md->state[i] = md->state[i] + S[i]; md->state[i] = md->state[i] + S[i];
return 0; return 0;
} }
#endif
/* Initialize the hash state */ /* Initialize the hash state */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
static void sha256_init(struct sha256_state *md) static void sha256_init(struct sha256_state *md)
{ {
md->curlen = 0; md->curlen = 0;
@@ -2197,7 +2201,6 @@ static void sha256_init(struct sha256_state *md)
md->state[6] = 0x1F83D9ABUL; md->state[6] = 0x1F83D9ABUL;
md->state[7] = 0x5BE0CD19UL; md->state[7] = 0x5BE0CD19UL;
} }
#endif
/** /**
Process a block of memory though the hash Process a block of memory though the hash
@@ -2206,8 +2209,6 @@ static void sha256_init(struct sha256_state *md)
@param inlen The length of the data (octets) @param inlen The length of the data (octets)
@return CRYPT_OK if successful @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, static int sha256_process(struct sha256_state *md, unsigned char *in,
unsigned long inlen) unsigned long inlen)
{ {
@@ -2241,7 +2242,7 @@ static int sha256_process(struct sha256_state *md, unsigned char *in,
return 0; return 0;
} }
#endif
/** /**
Terminate the hash to get the digest Terminate the hash to get the digest
@@ -2249,7 +2250,6 @@ static int sha256_process(struct sha256_state *md, unsigned char *in,
@param out [out] The destination of the hash (32 bytes) @param out [out] The destination of the hash (32 bytes)
@return CRYPT_OK if successful @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) static int sha256_done(struct sha256_state *md, unsigned char *out)
{ {
int i; int i;
@@ -2288,7 +2288,6 @@ static int sha256_done(struct sha256_state *md, unsigned char *out)
return 0; return 0;
} }
#endif
/** /**
* sha256_vector - SHA256 hash for data vector * sha256_vector - SHA256 hash for data vector
@@ -2298,8 +2297,6 @@ static int sha256_done(struct sha256_state *md, unsigned char *out)
* @mac: Buffer for the hash * @mac: Buffer for the hash
* Returns: 0 on success, -1 of failure * 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, static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len,
u8 *mac) u8 *mac)
{ {
@@ -2314,7 +2311,6 @@ static int sha256_vector(size_t num_elem, u8 *addr[], size_t *len,
return -1; return -1;
return 0; return 0;
} }
#endif
static u8 os_strlen(const char *s) static u8 os_strlen(const char *s)
{ {
@@ -2323,9 +2319,7 @@ static u8 os_strlen(const char *s)
p++; p++;
return p - s; return p - s;
} }
#endif
#if defined(CONFIG_TDLS) || defined(CONFIG_RTW_MESH_AEK)
static int os_memcmp(const void *s1, const void *s2, u8 n) static int os_memcmp(const void *s1, const void *s2, u8 n)
{ {
const unsigned char *p1 = s1, *p2 = s2; const unsigned char *p1 = s1, *p2 = s2;
@@ -2343,7 +2337,6 @@ static int os_memcmp(const void *s1, const void *s2, u8 n)
return *p1 - *p2; return *p1 - *p2;
} }
#endif
/** /**
* hmac_sha256_vector - HMAC-SHA256 over data vector (RFC 2104) * hmac_sha256_vector - HMAC-SHA256 over data vector (RFC 2104)
@@ -2354,8 +2347,6 @@ static int os_memcmp(const void *s1, const void *s2, u8 n)
* @len: Lengths of the data blocks * @len: Lengths of the data blocks
* @mac: Buffer for the hash (32 bytes) * @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, static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
u8 *addr[], size_t *len, u8 *mac) u8 *addr[], size_t *len, u8 *mac)
{ {
@@ -2417,8 +2408,6 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
_len[1] = 32; _len[1] = 32;
sha256_vector(2, _addr, _len, mac); sha256_vector(2, _addr, _len, mac);
} }
#endif
#endif /* CONFIG_TDLS */
#endif /* PLATFORM_FREEBSD */ #endif /* PLATFORM_FREEBSD */
/** /**
* sha256_prf - SHA256-based Pseudo-Random Function (IEEE 802.11r, 8.5.1.5.2) * sha256_prf - SHA256-based Pseudo-Random Function (IEEE 802.11r, 8.5.1.5.2)
@@ -2434,8 +2423,6 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem,
* given key. * given key.
*/ */
#ifndef PLATFORM_FREEBSD /* Baron */ #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, static void sha256_prf(u8 *key, size_t key_len, char *label,
u8 *data, size_t data_len, u8 *buf, size_t buf_len) u8 *data, size_t data_len, u8 *buf, size_t buf_len)
{ {
@@ -2472,8 +2459,6 @@ static void sha256_prf(u8 *key, size_t key_len, char *label,
counter++; counter++;
} }
} }
#endif
#endif
#endif /* PLATFORM_FREEBSD Baron */ #endif /* PLATFORM_FREEBSD Baron */
/* AES tables*/ /* AES tables*/
@@ -3098,7 +3083,7 @@ int aes_siv_decrypt(const u8 *key, const u8 *iv_crypt, size_t iv_c_len,
#endif /* CONFIG_RTW_MESH_AEK */ #endif /* CONFIG_RTW_MESH_AEK */
#ifdef CONFIG_TDLS #ifdef CONFIG_TDLS
void wpa_tdls_generate_tpk(_adapter *padapter, void *sta) void wpa_tdls_generate_tpk(_adapter *padapter, PVOID sta)
{ {
struct sta_info *psta = (struct sta_info *)sta; struct sta_info *psta = (struct sta_info *)sta;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+1 -1
View File
@@ -41,7 +41,7 @@ inline void rtw_st_ctl_init(struct st_ctl_t *st_ctl)
_rtw_init_queue(&st_ctl->tracker_q); _rtw_init_queue(&st_ctl->tracker_q);
} }
static inline void rtw_st_ctl_clear_tracker_q(struct st_ctl_t *st_ctl) inline void rtw_st_ctl_clear_tracker_q(struct st_ctl_t *st_ctl)
{ {
_irqL irqL; _irqL irqL;
_list *plist, *phead; _list *plist, *phead;
+1 -1
View File
@@ -1038,7 +1038,7 @@ exit:
return ret; return ret;
} }
static inline bool rtw_sec_camid_is_used(struct cam_ctl_t *cam_ctl, u8 id) inline bool rtw_sec_camid_is_used(struct cam_ctl_t *cam_ctl, u8 id)
{ {
_irqL irqL; _irqL irqL;
bool ret; bool ret;
+5
View 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.
+5
View File
@@ -0,0 +1,5 @@
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
View 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.4.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.
+33
View File
@@ -0,0 +1,33 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: realtek-rtl8188eus-dkms
Source: https://github.com/aircrack-ng/rtl8188eus
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".
+1
View File
@@ -0,0 +1 @@
README.md
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/dh-exec
core hal include Kconfig Makefile os_dep platform usr/src/realtek-rtl8188eus-${DEB_VERSION_UPSTREAM}
Vendored Executable
+21
View 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:
+1
View File
@@ -0,0 +1 @@
3.0 (quilt)
+4
View File
@@ -0,0 +1,4 @@
version=4
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
+1 -1
View File
@@ -1,5 +1,5 @@
PACKAGE_NAME="realtek-rtl8188eus" PACKAGE_NAME="realtek-rtl8188eus"
PACKAGE_VERSION="5.3.9~20200316" PACKAGE_VERSION="5.3.9~20191129"
CLEAN="'make' clean" CLEAN="'make' clean"
BUILT_MODULE_NAME[0]=8188eu BUILT_MODULE_NAME[0]=8188eu
PROCS_NUM=`nproc` PROCS_NUM=`nproc`
+1 -1
View File
@@ -939,7 +939,7 @@ s32 c2h_handler(_adapter *adapter, u8 id, u8 seq, u8 plen, u8 *payload)
#endif #endif
case C2H_EXTEND: case C2H_EXTEND:
sub_id = payload[0]; sub_id = payload[0];
__attribute__ ((__fallthrough__)); /* no handle, goto default */
default: default:
if (phydm_c2H_content_parsing(adapter_to_phydm(adapter), id, plen, payload) != TRUE) if (phydm_c2H_content_parsing(adapter_to_phydm(adapter), id, plen, payload) != TRUE)
+1 -1
View File
@@ -93,7 +93,7 @@
/*#define CONFIG_ANTENNA_DIVERSITY*/ /*#define CONFIG_ANTENNA_DIVERSITY*/
//#define CONFIG_CONCURRENT_MODE #define CONFIG_CONCURRENT_MODE
#ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_CONCURRENT_MODE
#define CONFIG_RUNTIME_PORT_SWITCH #define CONFIG_RUNTIME_PORT_SWITCH
#define CONFIG_SCAN_BACKOP #define CONFIG_SCAN_BACKOP
+1 -1
View File
@@ -12,7 +12,7 @@
* more details. * more details.
* *
*****************************************************************************/ *****************************************************************************/
#ifndef _RTL8812A_SRESET_H_ #ifndef _RTL88812A_SRESET_H_
#define _RTL8812A_SRESET_H_ #define _RTL8812A_SRESET_H_
#include <rtw_sreset.h> #include <rtw_sreset.h>
+1 -1
View File
@@ -12,7 +12,7 @@
* more details. * more details.
* *
*****************************************************************************/ *****************************************************************************/
#ifndef _RTL8812A_SRESET_H_ #ifndef _RTL88812A_SRESET_H_
#define _RTL8812A_SRESET_H_ #define _RTL8812A_SRESET_H_
#include <rtw_sreset.h> #include <rtw_sreset.h>
-2
View File
@@ -249,13 +249,11 @@ struct security_priv {
#define SEC_IS_BIP_KEY_INSTALLED(sec) _FALSE #define SEC_IS_BIP_KEY_INSTALLED(sec) _FALSE
#endif #endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0))
struct sha256_state { struct sha256_state {
u64 length; u64 length;
u32 state[8], curlen; u32 state[8], curlen;
u8 buf[64]; u8 buf[64];
}; };
#endif
#define GET_ENCRY_ALGO(psecuritypriv, psta, encry_algo, bmcst)\ #define GET_ENCRY_ALGO(psecuritypriv, psta, encry_algo, bmcst)\
do {\ do {\
+7 -40
View File
@@ -686,12 +686,14 @@ static int rtw_cfg80211_sync_iftype(_adapter *adapter)
static u64 rtw_get_systime_us(void) static u64 rtw_get_systime_us(void)
{ {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
struct timespec ts; struct timespec ts;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0))
getboottime(&ts);
#else
get_monotonic_boottime(&ts); get_monotonic_boottime(&ts);
#endif
return ((u64)ts.tv_sec * 1000000) + ts.tv_nsec / 1000; 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 #else
struct timeval tv; struct timeval tv;
do_gettimeofday(&tv); do_gettimeofday(&tv);
@@ -2365,7 +2367,6 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
case NL80211_IFTYPE_P2P_CLIENT: case NL80211_IFTYPE_P2P_CLIENT:
is_p2p = _TRUE; is_p2p = _TRUE;
#endif #endif
__attribute__ ((__fallthrough__));
case NL80211_IFTYPE_STATION: case NL80211_IFTYPE_STATION:
networkType = Ndis802_11Infrastructure; networkType = Ndis802_11Infrastructure;
@@ -2390,7 +2391,6 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
case NL80211_IFTYPE_P2P_GO: case NL80211_IFTYPE_P2P_GO:
is_p2p = _TRUE; is_p2p = _TRUE;
#endif #endif
__attribute__ ((__fallthrough__));
case NL80211_IFTYPE_AP: case NL80211_IFTYPE_AP:
networkType = Ndis802_11APMode; networkType = Ndis802_11APMode;
@@ -7094,26 +7094,11 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
#else #else
struct net_device *ndev, struct net_device *ndev,
#endif #endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
struct mgmt_frame_regs *upd)
#else
u16 frame_type, bool reg) 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)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
struct net_device *ndev = wdev_to_ndev(wdev); struct net_device *ndev = wdev_to_ndev(wdev);
#endif #endif
/* hardcoded always true, to make it pass compilation */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
bool reg = true;
#endif
_adapter *adapter; _adapter *adapter;
struct rtw_wdev_priv *pwdev_priv; struct rtw_wdev_priv *pwdev_priv;
@@ -7125,24 +7110,14 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
pwdev_priv = adapter_wdev_data(adapter); pwdev_priv = adapter_wdev_data(adapter);
#ifdef CONFIG_DEBUG_CFG80211 #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), RTW_INFO(FUNC_ADPT_FMT" frame_type:%x, reg:%d\n", FUNC_ADPT_ARG(adapter),
frame_type, reg); 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 #endif
/* Wait QC Verify */ /* Wait QC Verify */
return; return;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0))
switch (upd->interface_stypes) {
#else
switch (frame_type) { switch (frame_type) {
#endif
case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */ case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */
SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg); SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
break; break;
@@ -7152,12 +7127,6 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
default: default:
break; break;
} }
#else
if ((upd->interface_stypes & rtw_mask) == (pwdev_priv->mgmt_mask & rtw_mask))
return;
pwdev_priv->mgmt_mask = upd->interface_stypes;
#endif
exit: exit:
return; return;
@@ -9463,11 +9432,7 @@ static struct cfg80211_ops rtw_cfg80211_ops = {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
.mgmt_tx = cfg80211_rtw_mgmt_tx, .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, .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)) #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34) && LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 35))
.action = cfg80211_rtw_mgmt_tx, .action = cfg80211_rtw_mgmt_tx,
#endif #endif
@@ -9801,3 +9766,5 @@ void rtw_cfg80211_dev_res_unregister(struct dvobj_priv *dvobj)
rtw_wiphy_unregister(dvobj_to_wiphy(dvobj)); rtw_wiphy_unregister(dvobj_to_wiphy(dvobj));
#endif #endif
} }
#endif /* CONFIG_IOCTL_CFG80211 */
-4
View File
@@ -168,10 +168,6 @@ struct rtw_wdev_priv {
bool block_scan; bool block_scan;
bool power_mgmt; bool power_mgmt;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)
u32 mgmt_mask;
#endif
/* report mgmt_frame registered */ /* report mgmt_frame registered */
u16 report_mgmt; u16 report_mgmt;
+12 -13
View File
@@ -817,7 +817,7 @@ void rtw_regsty_load_target_tx_power(struct registry_priv *regsty)
#endif /* CONFIG_IEEE80211_BAND_5GHZ */ #endif /* CONFIG_IEEE80211_BAND_5GHZ */
} }
static inline void rtw_regsty_load_excl_chs(struct registry_priv *regsty) inline void rtw_regsty_load_excl_chs(struct registry_priv *regsty)
{ {
int i; int i;
int ch_num = 0; int ch_num = 0;
@@ -831,7 +831,7 @@ static inline void rtw_regsty_load_excl_chs(struct registry_priv *regsty)
} }
#ifdef CONFIG_80211N_HT #ifdef CONFIG_80211N_HT
static inline void rtw_regsty_init_rx_ampdu_sz_limit(struct registry_priv *regsty) inline void rtw_regsty_init_rx_ampdu_sz_limit(struct registry_priv *regsty)
{ {
int i, j; int i, j;
uint *sz_limit; uint *sz_limit;
@@ -1284,18 +1284,17 @@ unsigned int rtw_classify8021d(struct sk_buff *skb)
return dscp >> 5; return dscp >> 5;
} }
static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0))
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb,
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) struct net_device *sb_dev)
, void *accel_priv #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
#else static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb,
, struct net_device *sb_dev struct net_device *sb_dev,
#endif select_queue_fallback_t fallback)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)) #else
, select_queue_fallback_t fallback static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb,
#endif void *accel_priv, select_queue_fallback_t fallback)
#endif #endif
)
{ {
_adapter *padapter = rtw_netdev_priv(dev); _adapter *padapter = rtw_netdev_priv(dev);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
+1 -92
View File
@@ -62,12 +62,7 @@ inline struct proc_dir_entry *rtw_proc_create_dir(const char *name, struct proc_
} }
inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent, inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct proc_dir_entry *parent,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)) const struct file_operations *fops, void * data)
const struct proc_ops *fops, void * data)
#else
const struct file_operations *fops, void * data)
#endif
{ {
struct proc_dir_entry *entry; struct proc_dir_entry *entry;
@@ -235,26 +230,6 @@ static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer,
return -EROFS; return -EROFS;
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
static const struct proc_ops rtw_drv_proc_seq_fops = {
//.proc_owner = THIS_MODULE,
.proc_open = rtw_drv_proc_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = seq_release,
.proc_write = rtw_drv_proc_write,
};
static const struct proc_ops rtw_drv_proc_sseq_fops = {
//.proc_owner = THIS_MODULE,
.proc_open = rtw_drv_proc_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = single_release,
.proc_write = rtw_drv_proc_write,
};
#else
static const struct file_operations rtw_drv_proc_seq_fops = { static const struct file_operations rtw_drv_proc_seq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_drv_proc_open, .open = rtw_drv_proc_open,
@@ -272,7 +247,6 @@ static const struct file_operations rtw_drv_proc_sseq_fops = {
.release = single_release, .release = single_release,
.write = rtw_drv_proc_write, .write = rtw_drv_proc_write,
}; };
#endif
int rtw_drv_proc_init(void) int rtw_drv_proc_init(void)
{ {
@@ -3709,27 +3683,6 @@ static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buff
return -EROFS; return -EROFS;
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
static const struct proc_ops rtw_adapter_proc_seq_fops = {
//.proc_owner = THIS_MODULE,
.proc_open = rtw_adapter_proc_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = seq_release,
.proc_write = rtw_adapter_proc_write,
};
static const struct proc_ops rtw_adapter_proc_sseq_fops = {
//.proc_owner = THIS_MODULE,
.proc_open = rtw_adapter_proc_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = single_release,
.proc_write = rtw_adapter_proc_write,
};
#else
static const struct file_operations rtw_adapter_proc_seq_fops = { static const struct file_operations rtw_adapter_proc_seq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_adapter_proc_open, .open = rtw_adapter_proc_open,
@@ -3747,7 +3700,6 @@ static const struct file_operations rtw_adapter_proc_sseq_fops = {
.release = single_release, .release = single_release,
.write = rtw_adapter_proc_write, .write = rtw_adapter_proc_write,
}; };
#endif
int proc_get_odm_adaptivity(struct seq_file *m, void *v) int proc_get_odm_adaptivity(struct seq_file *m, void *v)
{ {
@@ -3903,26 +3855,6 @@ static ssize_t rtw_odm_proc_write(struct file *file, const char __user *buffer,
return -EROFS; return -EROFS;
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
static const struct proc_ops rtw_odm_proc_seq_fops = {
//.proc_owner = THIS_MODULE,
.proc_open = rtw_odm_proc_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = seq_release,
.proc_write = rtw_odm_proc_write,
};
static const struct proc_ops rtw_odm_proc_sseq_fops = {
//.proc_owner = THIS_MODULE,
.proc_open = rtw_odm_proc_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = single_release,
.proc_write = rtw_odm_proc_write,
};
#else
static const struct file_operations rtw_odm_proc_seq_fops = { static const struct file_operations rtw_odm_proc_seq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_odm_proc_open, .open = rtw_odm_proc_open,
@@ -3941,8 +3873,6 @@ static const struct file_operations rtw_odm_proc_sseq_fops = {
.write = rtw_odm_proc_write, .write = rtw_odm_proc_write,
}; };
#endif
struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev) struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
{ {
struct proc_dir_entry *dir_odm = NULL; struct proc_dir_entry *dir_odm = NULL;
@@ -4066,26 +3996,6 @@ static ssize_t rtw_mcc_proc_write(struct file *file, const char __user *buffer,
return -EROFS; return -EROFS;
} }
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0))
static const struct proc_ops rtw_mcc_proc_seq_fops = {
.proc_owner = THIS_MODULE,
.proc_open = rtw_mcc_proc_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = seq_release,
.proc_write = rtw_mcc_proc_write,
};
static const struct proc_ops rtw_mcc_proc_sseq_fops = {
.proc_owner = THIS_MODULE,
.proc_open = rtw_mcc_proc_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = single_release,
.proc_write = rtw_mcc_proc_write,
};
#else
static const struct file_operations rtw_mcc_proc_seq_fops = { static const struct file_operations rtw_mcc_proc_seq_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.open = rtw_mcc_proc_open, .open = rtw_mcc_proc_open,
@@ -4103,7 +4013,6 @@ static const struct file_operations rtw_mcc_proc_sseq_fops = {
.release = single_release, .release = single_release,
.write = rtw_mcc_proc_write, .write = rtw_mcc_proc_write,
}; };
#endif
struct proc_dir_entry *rtw_mcc_proc_init(struct net_device *dev) struct proc_dir_entry *rtw_mcc_proc_init(struct net_device *dev)
{ {
-1
View File
@@ -158,7 +158,6 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
{USB_DEVICE(0x2001, 0x330F), .driver_info = RTL8188E}, /* DLink DWA-125 REV D1 */ {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, 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, 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 */
#endif #endif
+2 -19
View File
@@ -286,7 +286,7 @@ inline struct sk_buff *_rtw_skb_clone(struct sk_buff *skb)
return skb_clone(skb); return skb_clone(skb);
#endif /* PLATFORM_FREEBSD */ #endif /* PLATFORM_FREEBSD */
} }
static inline struct sk_buff *_rtw_pskb_copy(struct sk_buff *skb) inline struct sk_buff *_rtw_pskb_copy(struct sk_buff *skb)
{ {
#ifdef PLATFORM_LINUX #ifdef PLATFORM_LINUX
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36))
@@ -2139,19 +2139,15 @@ static int isFileReadable(const char *path, u32 *sz)
{ {
struct file *fp; struct file *fp;
int ret = 0; int ret = 0;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
mm_segment_t oldfs; mm_segment_t oldfs;
#endif
char buf; char buf;
fp = filp_open(path, O_RDONLY, 0); fp = filp_open(path, O_RDONLY, 0);
if (IS_ERR(fp)) if (IS_ERR(fp))
ret = PTR_ERR(fp); ret = PTR_ERR(fp);
else { else {
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs(); oldfs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
#endif
if (1 != readFile(fp, &buf, 1)) if (1 != readFile(fp, &buf, 1))
ret = PTR_ERR(fp); ret = PTR_ERR(fp);
@@ -2163,9 +2159,8 @@ static int isFileReadable(const char *path, u32 *sz)
*sz = i_size_read(fp->f_dentry->d_inode); *sz = i_size_read(fp->f_dentry->d_inode);
#endif #endif
} }
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs); set_fs(oldfs);
#endif
filp_close(fp, NULL); filp_close(fp, NULL);
} }
return ret; return ret;
@@ -2181,9 +2176,7 @@ static int isFileReadable(const char *path, u32 *sz)
static int retriveFromFile(const char *path, u8 *buf, u32 sz) static int retriveFromFile(const char *path, u8 *buf, u32 sz)
{ {
int ret = -1; int ret = -1;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
mm_segment_t oldfs; mm_segment_t oldfs;
#endif
struct file *fp; struct file *fp;
if (path && buf) { if (path && buf) {
@@ -2191,14 +2184,10 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
if (0 == ret) { if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs(); oldfs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
#endif
ret = readFile(fp, buf, sz); ret = readFile(fp, buf, sz);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs); set_fs(oldfs);
#endif
closeFile(fp); closeFile(fp);
RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret); RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret);
@@ -2222,9 +2211,7 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
static int storeToFile(const char *path, u8 *buf, u32 sz) static int storeToFile(const char *path, u8 *buf, u32 sz)
{ {
int ret = 0; int ret = 0;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
mm_segment_t oldfs; mm_segment_t oldfs;
#endif
struct file *fp; struct file *fp;
if (path && buf) { if (path && buf) {
@@ -2232,14 +2219,10 @@ static int storeToFile(const char *path, u8 *buf, u32 sz)
if (0 == ret) { if (0 == ret) {
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
oldfs = get_fs(); oldfs = get_fs();
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
#endif
ret = writeFile(fp, buf, sz); ret = writeFile(fp, buf, sz);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
set_fs(oldfs); set_fs(oldfs);
#endif
closeFile(fp); closeFile(fp);
RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret); RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret);