Skip to content

Commit 3c1c532

Browse files
committed
rtl8192eu: fix build against 7.1 and re-enable for meson64 and rockchip64
also re-enable rtl8723ds for meson64 by chance
1 parent 17f735f commit 3c1c532

4 files changed

Lines changed: 254 additions & 3 deletions

File tree

config/kernel/linux-meson64-edge.config

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,9 @@ CONFIG_WL12XX=m
11041104
CONFIG_WL18XX=m
11051105
CONFIG_WLCORE_SPI=m
11061106
CONFIG_WLCORE_SDIO=m
1107+
CONFIG_RTL8723DS=m
11071108
CONFIG_RTL8822CS=m
1109+
CONFIG_RTL8192EU=m
11081110
CONFIG_RTL8189FS=m
11091111
CONFIG_RTL8189ES=m
11101112
CONFIG_ZD1211RW=m
@@ -1430,6 +1432,7 @@ CONFIG_PINCTRL_SINGLE=y
14301432
CONFIG_PINCTRL_SX150X=y
14311433
CONFIG_PINCTRL_MESON_S4=m
14321434
CONFIG_GPIO_SYSFS=y
1435+
CONFIG_GPIO_CDEV_V1=y
14331436
CONFIG_GPIO_AMDPT=m
14341437
CONFIG_GPIO_CADENCE=m
14351438
CONFIG_GPIO_DWAPB=m
@@ -4019,4 +4022,3 @@ CONFIG_TEST_DYNAMIC_DEBUG=m
40194022
CONFIG_TEST_MEMCAT_P=m
40204023
CONFIG_TEST_FREE_PAGES=m
40214024
CONFIG_MEMTEST=y
4022-
CONFIG_GPIO_CDEV_V1=y

config/kernel/linux-rockchip64-edge.config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,8 +1100,9 @@ CONFIG_WL18XX=m
11001100
CONFIG_WLCORE_SPI=m
11011101
CONFIG_WLCORE_SDIO=m
11021102
CONFIG_RTL8723DS=m
1103-
CONFIG_RTL8189ES=m
1103+
CONFIG_RTL8192EU=m
11041104
CONFIG_RTL8189FS=m
1105+
CONFIG_RTL8189ES=m
11051106
CONFIG_ZD1211RW=m
11061107
CONFIG_QTNFMAC_PCIE=m
11071108
CONFIG_SPARD_WLAN_SUPPORT=y

lib/functions/compilation/patch/drivers_network.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ driver_rtl8192EU() {
150150

151151
# Wireless drivers for Realtek 8192EU chipsets
152152

153-
if linux-version compare "${version}" ge 3.14 && linux-version compare "${version}" lt 7.1; then
153+
if linux-version compare "${version}" ge 3.14 && linux-version compare "${version}" lt 7.2; then
154154

155155
# Attach to specific commit (was "branch:realtek-4.4.x")
156156
local rtl8192euver='commit:9c0511420da11214c68d8591b19459ba10892aab' # Commit date: 2026-03-13 (please update when updating commit ref)
@@ -188,6 +188,11 @@ driver_rtl8192EU() {
188188

189189
# fix compilation for kernels >= 5.4
190190
process_patch_file "${SRC}/patch/misc/wireless-rtl8192eu-Fix-VFS-import.patch" "applying"
191+
192+
# fix compilation for kernels >= 7.1
193+
if linux-version compare "${version}" ge 7.1; then
194+
process_patch_file "${SRC}/patch/misc/wireless-rtl8192eu-linux-7.1.patch" "applying"
195+
fi
191196
fi
192197
}
193198

Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,243 @@
1+
diff --git a/drivers/net/wireless/rtl8192eu/core/rtw_br_ext.c b/drivers/net/wireless/rtl8192eu/core/rtw_br_ext.c
2+
index a2c491e58b0a..5eaa74911801 100644
3+
--- a/drivers/net/wireless/rtl8192eu/core/rtw_br_ext.c
4+
+++ b/drivers/net/wireless/rtl8192eu/core/rtw_br_ext.c
5+
@@ -88,7 +88,7 @@ static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned shor
6+
unsigned char *cur_ptr, *start_ptr;
7+
unsigned short tagLen, tagType;
8+
9+
- start_ptr = cur_ptr = (unsigned char *)ph->tag;
10+
+ start_ptr = cur_ptr = (unsigned char *)(ph + 1);
11+
while ((cur_ptr - start_ptr) < ntohs(ph->length)) {
12+
/* prevent un-alignment access */
13+
tagType = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]);
14+
@@ -114,9 +114,9 @@ static int __nat25_add_pppoe_tag(struct sk_buff *skb, struct pppoe_tag *tag)
15+
16+
skb_put(skb, data_len);
17+
/* have a room for new tag */
18+
- memmove(((unsigned char *)ph->tag + data_len), (unsigned char *)ph->tag, ntohs(ph->length));
19+
+ memmove(((unsigned char *)(ph + 1) + data_len), (unsigned char *)(ph + 1), ntohs(ph->length));
20+
ph->length = htons(ntohs(ph->length) + data_len);
21+
- memcpy((unsigned char *)ph->tag, tag, data_len);
22+
+ memcpy((unsigned char *)(ph + 1), tag, data_len);
23+
return data_len;
24+
}
25+
26+
@@ -1143,8 +1143,8 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
27+
return -1;
28+
}
29+
30+
- memcpy(tag->tag_data + MAGIC_CODE_LEN + RTL_RELAY_TAG_LEN,
31+
- pOldTag->tag_data, old_tag_len);
32+
+ memcpy((tag + 1) + MAGIC_CODE_LEN + RTL_RELAY_TAG_LEN,
33+
+ (pOldTag + 1), old_tag_len);
34+
35+
if (skb_pull_and_merge(skb, (unsigned char *)pOldTag, TAG_HDR_LEN + old_tag_len) < 0) {
36+
DEBUG_ERR("call skb_pull_and_merge() failed in PADI/R packet!\n");
37+
@@ -1157,9 +1157,9 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
38+
tag->tag_len = htons(MAGIC_CODE_LEN + RTL_RELAY_TAG_LEN + old_tag_len);
39+
40+
/* insert the magic_code+client mac in relay tag */
41+
- pMagic = (unsigned short *)tag->tag_data;
42+
+ pMagic = (unsigned short *)(tag + 1);
43+
*pMagic = htons(MAGIC_CODE);
44+
- memcpy(tag->tag_data + MAGIC_CODE_LEN, skb->data + ETH_ALEN, ETH_ALEN);
45+
+ memcpy((tag + 1) + MAGIC_CODE_LEN, skb->data + ETH_ALEN, ETH_ALEN);
46+
47+
/* Add relay tag */
48+
if (__nat25_add_pppoe_tag(skb, tag) < 0)
49+
@@ -1220,14 +1220,14 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
50+
return -1;
51+
}
52+
53+
- pMagic = (unsigned short *)tag->tag_data;
54+
+ pMagic = (unsigned short *)(tag + 1);
55+
if (ntohs(*pMagic) != MAGIC_CODE) {
56+
DEBUG_ERR("Can't find MAGIC_CODE in %s packet!\n",
57+
(ph->code == PADO_CODE ? "PADO" : "PADS"));
58+
return -1;
59+
}
60+
61+
- memcpy(skb->data, tag->tag_data + MAGIC_CODE_LEN, ETH_ALEN);
62+
+ memcpy(skb->data, (tag + 1) + MAGIC_CODE_LEN, ETH_ALEN);
63+
64+
if (tagLen > MAGIC_CODE_LEN + RTL_RELAY_TAG_LEN)
65+
offset = TAG_HDR_LEN;
66+
diff --git a/drivers/net/wireless/rtl8192eu/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8192eu/os_dep/linux/ioctl_cfg80211.c
67+
index b08ddf93977c..42496d191e61 100644
68+
--- a/drivers/net/wireless/rtl8192eu/os_dep/linux/ioctl_cfg80211.c
69+
+++ b/drivers/net/wireless/rtl8192eu/os_dep/linux/ioctl_cfg80211.c
70+
@@ -1697,7 +1697,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
71+
return ret;
72+
}
73+
74+
-static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
75+
+static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct wireless_dev *wdev
76+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
77+
,int link_id
78+
#endif
79+
@@ -1707,6 +1707,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
80+
#endif
81+
, const u8 *mac_addr, struct key_params *params)
82+
{
83+
+ struct net_device *ndev = wdev->netdev;
84+
char *alg_name;
85+
u32 param_len;
86+
struct ieee_param *param = NULL;
87+
@@ -1844,7 +1845,7 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev
88+
89+
}
90+
91+
-static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev
92+
+static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct wireless_dev *wdev
93+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
94+
,int link_id
95+
#endif
96+
@@ -1855,6 +1856,7 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev
97+
, const u8 *mac_addr, void *cookie
98+
, void (*callback)(void *cookie, struct key_params *))
99+
{
100+
+ struct net_device *ndev = wdev->netdev;
101+
#define GET_KEY_PARAM_FMT_S " keyid=%d"
102+
#define GET_KEY_PARAM_ARG_S , keyid
103+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
104+
@@ -2012,7 +2014,7 @@ static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev
105+
return ret;
106+
}
107+
108+
-static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
109+
+static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct wireless_dev *wdev,
110+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
111+
int link_id,
112+
#endif
113+
@@ -2022,6 +2024,7 @@ static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
114+
u8 key_index, const u8 *mac_addr)
115+
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) */
116+
{
117+
+ struct net_device *ndev = wdev->netdev;
118+
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
119+
struct security_priv *psecuritypriv = &padapter->securitypriv;
120+
121+
@@ -2088,13 +2091,14 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
122+
123+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30))
124+
static int cfg80211_rtw_set_default_mgmt_key(struct wiphy *wiphy,
125+
- struct net_device *ndev,
126+
+ struct wireless_dev *wdev,
127+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
128+
int link_id,
129+
#endif
130+
u8 key_index)
131+
{
132+
#define SET_DEF_KEY_PARAM_FMT " key_index=%d"
133+
+ struct net_device *ndev = wdev->netdev;
134+
#define SET_DEF_KEY_PARAM_ARG , key_index
135+
136+
RTW_INFO(FUNC_NDEV_FMT
137+
@@ -2238,7 +2242,7 @@ static void rtw_cfg80211_fill_mesh_only_sta_info(struct mesh_plink_ent *plink, s
138+
#endif /* CONFIG_RTW_MESH */
139+
140+
static int cfg80211_rtw_get_station(struct wiphy *wiphy,
141+
- struct net_device *ndev,
142+
+ struct wireless_dev *wdev,
143+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0))
144+
u8 *mac,
145+
#else
146+
@@ -2247,6 +2251,7 @@ static int cfg80211_rtw_get_station(struct wiphy *wiphy,
147+
struct station_info *sinfo)
148+
{
149+
int ret = 0;
150+
+ struct net_device *ndev = wdev->netdev;
151+
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
152+
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
153+
struct sta_info *psta = NULL;
154+
@@ -4394,7 +4399,7 @@ void rtw_cfg80211_indicate_sta_assoc(_adapter *padapter, u8 *pmgmt_frame, uint f
155+
sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
156+
sinfo.assoc_req_ies = pmgmt_frame + WLAN_HDR_A3_LEN + ie_offset;
157+
sinfo.assoc_req_ies_len = frame_len - WLAN_HDR_A3_LEN - ie_offset;
158+
- cfg80211_new_sta(ndev, get_addr2_ptr(pmgmt_frame), &sinfo, GFP_ATOMIC);
159+
+ cfg80211_new_sta(padapter->rtw_wdev, get_addr2_ptr(pmgmt_frame), &sinfo, GFP_ATOMIC);
160+
}
161+
#else /* defined(RTW_USE_CFG80211_STA_EVENT) */
162+
channel = pmlmeext->cur_channel;
163+
@@ -4440,7 +4445,7 @@ void rtw_cfg80211_indicate_sta_disassoc(_adapter *padapter, const u8 *da, unsign
164+
RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
165+
166+
#if defined(RTW_USE_CFG80211_STA_EVENT) || defined(COMPAT_KERNEL_RELEASE)
167+
- cfg80211_del_sta(ndev, da, GFP_ATOMIC);
168+
+ cfg80211_del_sta(padapter->rtw_wdev, da, GFP_ATOMIC);
169+
#else /* defined(RTW_USE_CFG80211_STA_EVENT) */
170+
channel = pmlmeext->cur_channel;
171+
freq = rtw_ch2freq(channel);
172+
@@ -5379,7 +5384,7 @@ static void dump_station_parameters(void *sel, struct wiphy *wiphy, const struct
173+
#endif /* DBG_RTW_CFG80211_STA_PARAM */
174+
}
175+
176+
-static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev,
177+
+static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct wireless_dev *wdev,
178+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0))
179+
u8 *mac,
180+
#else
181+
@@ -5387,6 +5392,7 @@ static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev
182+
#endif
183+
struct station_parameters *params)
184+
{
185+
+ struct net_device *ndev = wdev->netdev;
186+
int ret = 0;
187+
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
188+
#if defined(CONFIG_TDLS) || defined(CONFIG_RTW_MESH)
189+
@@ -5525,7 +5531,7 @@ static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev
190+
191+
/* indicate new sta */
192+
memset(&sinfo, 0, sizeof(sinfo));
193+
- cfg80211_new_sta(ndev, mac, &sinfo, GFP_ATOMIC);
194+
+ cfg80211_new_sta(padapter->rtw_wdev, mac, &sinfo, GFP_ATOMIC);
195+
}
196+
goto exit;
197+
}
198+
@@ -5547,7 +5553,7 @@ static int cfg80211_rtw_add_station(struct wiphy *wiphy, struct net_device *ndev
199+
return ret;
200+
}
201+
202+
-static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev,
203+
+static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct wireless_dev *wdev,
204+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0))
205+
u8 *mac
206+
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0))
207+
@@ -5557,6 +5563,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
208+
#endif
209+
)
210+
{
211+
+ struct net_device *ndev = wdev->netdev;
212+
int ret = 0;
213+
_irqL irqL;
214+
_list *phead, *plist;
215+
@@ -5653,7 +5660,7 @@ static int cfg80211_rtw_del_station(struct wiphy *wiphy, struct net_device *ndev
216+
217+
}
218+
219+
-static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *ndev,
220+
+static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct wireless_dev *wdev,
221+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0))
222+
u8 *mac,
223+
#else
224+
@@ -5661,6 +5668,7 @@ static int cfg80211_rtw_change_station(struct wiphy *wiphy, struct net_device *n
225+
#endif
226+
struct station_parameters *params)
227+
{
228+
+ struct net_device *ndev = wdev->netdev;
229+
#ifdef CONFIG_RTW_MESH
230+
_adapter *adapter = (_adapter *)rtw_netdev_priv(ndev);
231+
struct sta_priv *stapriv = &adapter->stapriv;
232+
@@ -5807,9 +5815,10 @@ static struct sta_info *rtw_sta_info_get_by_idx(struct sta_priv *pstapriv, const
233+
return psta;
234+
}
235+
236+
-static int cfg80211_rtw_dump_station(struct wiphy *wiphy, struct net_device *ndev,
237+
+static int cfg80211_rtw_dump_station(struct wiphy *wiphy, struct wireless_dev *wdev,
238+
int idx, u8 *mac, struct station_info *sinfo)
239+
{
240+
+ struct net_device *ndev = wdev->netdev;
241+
#define DBG_DUMP_STATION 0
242+
243+
int ret = 0;

0 commit comments

Comments
 (0)