Skip to content

Commit d96e9bb

Browse files
add the rlt8192eu inspired from @Mange
1 parent 8d68944 commit d96e9bb

424 files changed

Lines changed: 782317 additions & 1789 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,29 @@
1-
# SPDX-License-Identifier: GPL-2.0
21
config RTL8192EU
3-
tristate "Realtek RTL8192EU USB 802.11n Wi-Fi"
4-
depends on MAC80211 && USB
5-
select LIB80211
2+
tristate "Realtek RTL8192EU USB Wireless Network Adapter"
3+
depends on USB && CFG80211
4+
select WIRELESS_EXT
5+
select WEXT_PRIV
6+
select CFG80211_WEXT
67
help
7-
This option adds support for the Realtek RTL8192EU USB
8-
802.11n 2T2R (300 Mbps) Wi-Fi chipset.
8+
This option adds the driver for Realtek RTL8192EU 802.11n USB
9+
wireless adapters, including:
910

10-
Devices using this chipset:
11-
- TP-Link TL-WN823N v2 (2357:6109)
12-
- TP-Link TL-WN823N v3 (2357:6109)
13-
- Realtek RTL8192EU reference board (0bda:818b)
14-
- ASUS USB-N13 C1 (0b05:18f0)
15-
- D-Link DWA-131 rev E1 (2001:3319)
16-
- Edimax EW-7822ULC (7392:b611)
11+
* TP-Link TL-WN823N v2/v3 (USB ID 2357:6109)
12+
* Realtek reference board (USB ID 0bda:818b / 0bda:0179)
13+
* ASUS USB-N13 C1 (USB ID 0b05:18f0)
14+
* D-Link DWA-131 rev E1 (USB ID 2001:3319)
15+
* Edimax EW-7822ULC (USB ID 7392:b611)
1716

18-
The chip supports IEEE 802.11b/g/n on 2.4 GHz with up to
19-
300 Mbps PHY rate using two spatial streams (2T2R).
17+
This is a Realtek vendor driver port using the cfg80211 wireless
18+
stack. It supports STA, AP, and monitor modes.
2019

21-
The driver requires the firmware file:
22-
/lib/firmware/rtlwifi/rtl8192eufw.bin
23-
Available in the linux-firmware package:
24-
pacman -S linux-firmware (Arch Linux)
25-
apt install firmware-realtek (Debian/Ubuntu)
20+
Note: If the adapter is not recognised after loading this module,
21+
ensure any conflicting in-tree rtlwifi/rtl8xxxu driver is
22+
blacklisted:
23+
echo "blacklist rtl8xxxu" | sudo tee /etc/modprobe.d/rtl8192eu.conf
2624

27-
If you want to build this driver as a module, say M here
28-
and it will be called rtl8192eu. For built-in use (required
29-
for Hyperion monolithic builds), say Y here.
25+
To improve USB suspend stability on laptops, set:
26+
options 8192eu rtw_power_mgnt=1 rtw_enusbss=0
3027

31-
Source: https://github.com/Mange/rtl8192eu-linux-driver
32-
In-tree port: Hyperion Kernel Project v2.2.2
28+
To compile this driver into the kernel, choose Y here.
29+
To compile it as a module (recommended), choose M here.
Lines changed: 262 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,267 @@
11
# SPDX-License-Identifier: GPL-2.0
2+
# Makefile for Realtek RTL8192EU USB 802.11n driver
3+
# Hyperion Kernel Project โ€“ in-tree port of the Realtek vendor driver.
24
#
3-
# Makefile for Realtek RTL8192EU in-tree driver
4-
# Hyperion Kernel Project v2.2.2
5-
#
5+
# Architecture notes:
6+
# This driver uses the Realtek private wireless stack (wext/cfg80211 wrapper).
7+
# It does NOT use mac80211. This is intentional โ€“ a proper mac80211 port
8+
# would require porting ~20,000 lines of chip HAL from scratch and does not
9+
# exist anywhere publicly as of 2026. The cfg80211 path used here is the
10+
# only architecture that correctly programs the RTL8192EU hardware and gives
11+
# working internet.
12+
13+
# ---- fixed chip/HCI choices for this in-tree driver ----
14+
CONFIG_RTL8192E := y
15+
CONFIG_USB_HCI := y
16+
17+
MODULE_NAME := 8192eu
18+
19+
# ---- feature knobs (edit to taste) ----
20+
CONFIG_POWER_SAVING := y
21+
CONFIG_USB_AUTOSUSPEND := n
22+
CONFIG_BT_COEXIST := y
23+
CONFIG_MP_INCLUDED := y
24+
CONFIG_80211W := y
25+
CONFIG_EFUSE_CONFIG_FILE := y
26+
CONFIG_LOAD_PHY_PARA_FROM_FILE := y
27+
CONFIG_TXPWR_BY_RATE := y
28+
CONFIG_TXPWR_BY_RATE_EN := n
29+
CONFIG_TXPWR_LIMIT := y
30+
CONFIG_TXPWR_LIMIT_EN := n
31+
CONFIG_RTW_CHPLAN := 0xFF
32+
CONFIG_RTW_ADAPTIVITY_EN := disable
33+
CONFIG_RTW_ADAPTIVITY_MODE := normal
34+
CONFIG_BR_EXT := y
35+
CONFIG_WIFI_MONITOR := y
36+
CONFIG_RTW_NAPI := y
37+
CONFIG_RTW_GRO := n
38+
CONFIG_RTW_NETIF_SG := y
39+
CONFIG_RTW_DEBUG := n
40+
CONFIG_RTW_LOG_LEVEL := 2
41+
42+
# ---- compiler flags ----
43+
ccflags-y += -O2
44+
ccflags-y += -Wno-unused-variable -Wno-unused-label -Wno-unused-function
45+
46+
ccflags-y += -I$(src)/include
47+
ccflags-y += -I$(src)/hal/phydm
48+
ccflags-y += -I$(src)/platform
49+
ccflags-y += -I$(src)/hal/btc
50+
51+
ccflags-y += -DCONFIG_RTL8192E
52+
ccflags-y += -DCONFIG_USB_HCI
53+
ccflags-y += -DCONFIG_LITTLE_ENDIAN
54+
# cfg80211 glue โ€“ required for NetworkManager / wpa_supplicant to see the adapter
55+
ccflags-y += -DCONFIG_IOCTL_CFG80211
56+
ccflags-y += -DRTW_USE_CFG80211_STA_EVENT
57+
ccflags-y += -DDM_ODM_SUPPORT_TYPE=0x04
58+
59+
ifeq ($(CONFIG_POWER_SAVING), y)
60+
ccflags-y += -DCONFIG_POWER_SAVING
61+
endif
62+
63+
ifeq ($(CONFIG_USB_AUTOSUSPEND), y)
64+
ccflags-y += -DCONFIG_USB_AUTOSUSPEND
65+
endif
66+
67+
ifeq ($(CONFIG_BT_COEXIST), y)
68+
ccflags-y += -DCONFIG_BT_COEXIST
69+
endif
70+
71+
ifeq ($(CONFIG_MP_INCLUDED), y)
72+
ccflags-y += -DCONFIG_MP_INCLUDED
73+
endif
74+
75+
ifeq ($(CONFIG_80211W), y)
76+
ccflags-y += -DCONFIG_IEEE80211W
77+
endif
78+
79+
ifeq ($(CONFIG_EFUSE_CONFIG_FILE), y)
80+
ccflags-y += -DCONFIG_EFUSE_CONFIG_FILE
81+
ccflags-y += -DEFUSE_MAP_PATH=\"/system/etc/wifi/wifi_efuse_8192eu.map\"
82+
ccflags-y += -DWIFIMAC_PATH=\"/data/wifimac.txt\"
83+
endif
84+
85+
ifeq ($(CONFIG_LOAD_PHY_PARA_FROM_FILE), y)
86+
ccflags-y += -DCONFIG_LOAD_PHY_PARA_FROM_FILE
87+
ccflags-y += -DREALTEK_CONFIG_PATH=\"/lib/firmware/\"
88+
endif
89+
90+
ifeq ($(CONFIG_TXPWR_BY_RATE), y)
91+
ccflags-y += -DCONFIG_TXPWR_BY_RATE=1
92+
else
93+
ccflags-y += -DCONFIG_TXPWR_BY_RATE=0
94+
endif
95+
96+
ifeq ($(CONFIG_TXPWR_BY_RATE_EN), y)
97+
ccflags-y += -DCONFIG_TXPWR_BY_RATE_EN=1
98+
else
99+
ccflags-y += -DCONFIG_TXPWR_BY_RATE_EN=0
100+
endif
101+
102+
ifeq ($(CONFIG_TXPWR_LIMIT), y)
103+
ccflags-y += -DCONFIG_TXPWR_LIMIT=1
104+
else
105+
ccflags-y += -DCONFIG_TXPWR_LIMIT=0
106+
endif
107+
108+
ifeq ($(CONFIG_TXPWR_LIMIT_EN), y)
109+
ccflags-y += -DCONFIG_TXPWR_LIMIT_EN=1
110+
else
111+
ccflags-y += -DCONFIG_TXPWR_LIMIT_EN=0
112+
endif
113+
114+
ifeq ($(CONFIG_RTW_ADAPTIVITY_EN), disable)
115+
ccflags-y += -DCONFIG_RTW_ADAPTIVITY_EN=0
116+
else ifeq ($(CONFIG_RTW_ADAPTIVITY_EN), enable)
117+
ccflags-y += -DCONFIG_RTW_ADAPTIVITY_EN=1
118+
endif
119+
120+
ifeq ($(CONFIG_RTW_ADAPTIVITY_MODE), normal)
121+
ccflags-y += -DCONFIG_RTW_ADAPTIVITY_MODE=0
122+
else ifeq ($(CONFIG_RTW_ADAPTIVITY_MODE), carrier_sense)
123+
ccflags-y += -DCONFIG_RTW_ADAPTIVITY_MODE=1
124+
endif
125+
126+
ifeq ($(CONFIG_BR_EXT), y)
127+
ccflags-y += -DCONFIG_BR_EXT
128+
ccflags-y += '-DCONFIG_BR_EXT_BRNAME="br0"'
129+
endif
130+
131+
ifeq ($(CONFIG_WIFI_MONITOR), y)
132+
ccflags-y += -DCONFIG_WIFI_MONITOR
133+
endif
134+
135+
ifeq ($(CONFIG_RTW_NAPI), y)
136+
ccflags-y += -DCONFIG_RTW_NAPI
137+
endif
138+
139+
ifeq ($(CONFIG_RTW_GRO), y)
140+
ccflags-y += -DCONFIG_RTW_GRO
141+
endif
142+
143+
ifeq ($(CONFIG_RTW_NETIF_SG), y)
144+
ccflags-y += -DCONFIG_RTW_NETIF_SG
145+
endif
146+
147+
ifeq ($(CONFIG_RTW_DEBUG), y)
148+
ccflags-y += -DCONFIG_RTW_DEBUG
149+
ccflags-y += -DRTW_LOG_LEVEL=$(CONFIG_RTW_LOG_LEVEL)
150+
endif
151+
152+
# ---- phydm ----
153+
include $(src)/hal/phydm/phydm.mk
154+
155+
# ---- core ----
156+
rtk_core := \
157+
core/rtw_cmd.o \
158+
core/rtw_security.o \
159+
core/rtw_debug.o \
160+
core/rtw_io.o \
161+
core/rtw_ioctl_set.o \
162+
core/rtw_ieee80211.o \
163+
core/rtw_mlme.o \
164+
core/rtw_mlme_ext.o \
165+
core/rtw_mi.o \
166+
core/rtw_wlan_util.o \
167+
core/rtw_vht.o \
168+
core/rtw_pwrctrl.o \
169+
core/rtw_rf.o \
170+
core/rtw_chplan.o \
171+
core/rtw_recv.o \
172+
core/rtw_sta_mgt.o \
173+
core/rtw_ap.o \
174+
core/mesh/rtw_mesh.o \
175+
core/mesh/rtw_mesh_pathtbl.o \
176+
core/mesh/rtw_mesh_hwmp.o \
177+
core/rtw_xmit.o \
178+
core/rtw_p2p.o \
179+
core/rtw_rson.o \
180+
core/rtw_tdls.o \
181+
core/rtw_br_ext.o \
182+
core/rtw_iol.o \
183+
core/rtw_sreset.o \
184+
core/rtw_btcoex_wifionly.o \
185+
core/rtw_btcoex.o \
186+
core/rtw_beamforming.o \
187+
core/rtw_odm.o \
188+
core/rtw_rm.o \
189+
core/rtw_rm_fsm.o \
190+
core/efuse/rtw_efuse.o
191+
192+
$(MODULE_NAME)-y += $(rtk_core)
193+
$(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += core/rtw_mp.o
194+
195+
# ---- OS / USB interface ----
196+
$(MODULE_NAME)-y += \
197+
os_dep/osdep_service.o \
198+
os_dep/linux/os_intfs.o \
199+
os_dep/linux/usb_intf.o \
200+
os_dep/linux/usb_ops_linux.o \
201+
os_dep/linux/ioctl_linux.o \
202+
os_dep/linux/xmit_linux.o \
203+
os_dep/linux/mlme_linux.o \
204+
os_dep/linux/recv_linux.o \
205+
os_dep/linux/ioctl_cfg80211.o \
206+
os_dep/linux/rtw_cfgvendor.o \
207+
os_dep/linux/wifi_regd.o \
208+
os_dep/linux/rtw_android.o \
209+
os_dep/linux/rtw_proc.o \
210+
os_dep/linux/rtw_rhashtable.o
211+
212+
$(MODULE_NAME)-$(CONFIG_MP_INCLUDED) += os_dep/linux/ioctl_mp.o
213+
214+
# ---- HAL common ----
215+
$(MODULE_NAME)-y += \
216+
hal/hal_intf.o \
217+
hal/hal_com.o \
218+
hal/hal_com_phycfg.o \
219+
hal/hal_phy.o \
220+
hal/hal_dm.o \
221+
hal/hal_dm_acs.o \
222+
hal/hal_btcoex_wifionly.o \
223+
hal/hal_btcoex.o \
224+
hal/hal_mp.o \
225+
hal/hal_mcc.o \
226+
hal/hal_hci/hal_usb.o \
227+
hal/led/hal_led.o \
228+
hal/led/hal_usb_led.o
229+
230+
# ---- HAL RTL8192E + USB ----
231+
$(MODULE_NAME)-y += \
232+
hal/HalPwrSeqCmd.o \
233+
hal/rtl8192e/Hal8192EPwrSeq.o \
234+
hal/rtl8192e/rtl8192e_xmit.o \
235+
hal/rtl8192e/rtl8192e_sreset.o \
236+
hal/rtl8192e/rtl8192e_hal_init.o \
237+
hal/rtl8192e/rtl8192e_phycfg.o \
238+
hal/rtl8192e/rtl8192e_rf6052.o \
239+
hal/rtl8192e/rtl8192e_dm.o \
240+
hal/rtl8192e/rtl8192e_rxdesc.o \
241+
hal/rtl8192e/rtl8192e_cmd.o \
242+
hal/rtl8192e/hal8192e_fw.o \
243+
hal/rtl8192e/usb/usb_halinit.o \
244+
hal/rtl8192e/usb/rtl8192eu_led.o \
245+
hal/rtl8192e/usb/rtl8192eu_xmit.o \
246+
hal/rtl8192e/usb/rtl8192eu_recv.o \
247+
hal/rtl8192e/usb/usb_ops_linux.o \
248+
hal/efuse/rtl8192e/HalEfuseMask8192E_USB.o
249+
250+
# ---- BT coexistence for 8192e ----
251+
ifeq ($(CONFIG_BT_COEXIST), y)
252+
$(MODULE_NAME)-y += \
253+
hal/btc/halbtc8192e1ant.o \
254+
hal/btc/halbtc8192e2ant.o
255+
endif
256+
257+
# ---- phydm ----
258+
$(MODULE_NAME)-y += $(_PHYDM_FILES)
6259

7-
# โ”€โ”€ Module object list โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
8-
rtl8192eu-objs := \
9-
rtl8192eu_usb.o
260+
# ---- platform ----
261+
$(MODULE_NAME)-y += platform/platform_ops.o
10262

11-
# โ”€โ”€ Build target โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
12-
obj-$(CONFIG_RTL8192EU) += rtl8192eu.o
263+
# ---- wire it all together ----
264+
obj-$(CONFIG_RTL8192EU) := $(MODULE_NAME).o
13265

14-
# โ”€โ”€ Compiler flags โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
15-
# -Wno-unused-function: some HAL stubs are intentionally unused
16-
# -Wno-implicit-fallthrough: Realtek code has some intentional fallthroughs
17-
ccflags-y += -I$(srctree)/drivers/net/wireless/realtek/rtl8192eu/include
18-
ccflags-y += -Wno-unused-function
19-
ccflags-y += -Wno-implicit-fallthrough
266+
EXTRA_CFLAGS += $(ccflags-y)
267+
EXTRA_LDFLAGS += $(ldflags-y)

0 commit comments

Comments
ย (0)