mirror of
https://github.com/Fishwaldo/build.git
synced 2025-03-16 03:41:26 +00:00
154 lines
4.6 KiB
Diff
154 lines
4.6 KiB
Diff
From 79b1aa78b51060fb21f12ee3057ded88c8610315 Mon Sep 17 00:00:00 2001
|
|
From: Igor Pecovnik <igor.pecovnik@gmail.com>
|
|
Date: Mon, 15 Feb 2021 15:24:19 +0100
|
|
Subject: [PATCH] wifiiii
|
|
|
|
Signed-off-by: Igor Pecovnik <igor.pecovnik@gmail.com>
|
|
---
|
|
.../rtl8811cu/os_dep/linux/ioctl_cfg80211.c | 24 ++++++++-----------
|
|
.../wireless/rtl8811cu/os_dep/osdep_service.c | 22 +++++++++++++----
|
|
2 files changed, 28 insertions(+), 18 deletions(-)
|
|
|
|
diff --git a/drivers/net/wireless/rtl8811cu/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8811cu/os_dep/linux/ioctl_cfg80211.c
|
|
index c0df148f5..579bbca73 100755
|
|
--- a/drivers/net/wireless/rtl8811cu/os_dep/linux/ioctl_cfg80211.c
|
|
+++ b/drivers/net/wireless/rtl8811cu/os_dep/linux/ioctl_cfg80211.c
|
|
@@ -7143,6 +7143,11 @@ static int cfg80211_rtw_mgmt_tx(struct wiphy *wiphy,
|
|
return ret;
|
|
}
|
|
|
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0))
|
|
+static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy,
|
|
+ struct wireless_dev *wdev,
|
|
+ struct mgmt_frame_regs *upd)
|
|
+#else
|
|
static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
|
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
|
|
struct wireless_dev *wdev,
|
|
@@ -7150,6 +7155,7 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
|
|
struct net_device *ndev,
|
|
#endif
|
|
u16 frame_type, bool reg)
|
|
+#endif
|
|
{
|
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0))
|
|
struct net_device *ndev = wdev_to_ndev(wdev);
|
|
@@ -7169,20 +7175,6 @@ static void cfg80211_rtw_mgmt_frame_register(struct wiphy *wiphy,
|
|
frame_type, reg);
|
|
#endif
|
|
|
|
- /* Wait QC Verify */
|
|
- return;
|
|
-
|
|
- switch (frame_type) {
|
|
- case IEEE80211_STYPE_PROBE_REQ: /* 0x0040 */
|
|
- SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_PROBE_REQ, reg);
|
|
- break;
|
|
- case IEEE80211_STYPE_ACTION: /* 0x00D0 */
|
|
- SET_CFG80211_REPORT_MGMT(pwdev_priv, IEEE80211_STYPE_ACTION, reg);
|
|
- break;
|
|
- default:
|
|
- break;
|
|
- }
|
|
-
|
|
exit:
|
|
return;
|
|
}
|
|
@@ -9457,7 +9449,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_update_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
|
|
diff --git a/drivers/net/wireless/rtl8811cu/os_dep/osdep_service.c b/drivers/net/wireless/rtl8811cu/os_dep/osdep_service.c
|
|
index c27d3b0ad..c7dd6a6d7 100755
|
|
--- a/drivers/net/wireless/rtl8811cu/os_dep/osdep_service.c
|
|
+++ b/drivers/net/wireless/rtl8811cu/os_dep/osdep_service.c
|
|
@@ -2193,15 +2193,18 @@ static int isFileReadable(const char *path, u32 *sz)
|
|
{
|
|
struct file *fp;
|
|
int ret = 0;
|
|
+#ifdef set_fs
|
|
mm_segment_t oldfs;
|
|
+#endif
|
|
char buf;
|
|
|
|
fp = filp_open(path, O_RDONLY, 0);
|
|
if (IS_ERR(fp))
|
|
ret = PTR_ERR(fp);
|
|
else {
|
|
+#ifdef set_fs
|
|
oldfs = get_fs();
|
|
-
|
|
+#endif
|
|
if (1 != readFile(fp, &buf, 1))
|
|
ret = PTR_ERR(fp);
|
|
|
|
@@ -2212,8 +2215,9 @@ static int isFileReadable(const char *path, u32 *sz)
|
|
*sz = i_size_read(fp->f_dentry->d_inode);
|
|
#endif
|
|
}
|
|
-
|
|
+#ifdef set_fs
|
|
set_fs(oldfs);
|
|
+#endif
|
|
filp_close(fp, NULL);
|
|
}
|
|
return ret;
|
|
@@ -2229,17 +2233,22 @@ static int isFileReadable(const char *path, u32 *sz)
|
|
static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
|
{
|
|
int ret = -1;
|
|
+#ifdef set_fs
|
|
mm_segment_t oldfs;
|
|
+#endif
|
|
struct file *fp;
|
|
|
|
if (path && buf) {
|
|
ret = openFile(&fp, path, O_RDONLY, 0);
|
|
if (0 == ret) {
|
|
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
|
|
-
|
|
+#ifdef set_fs
|
|
oldfs = get_fs();
|
|
ret = readFile(fp, buf, sz);
|
|
set_fs(oldfs);
|
|
+#else
|
|
+ ret = readFile(fp, buf, sz);
|
|
+#endif
|
|
closeFile(fp);
|
|
|
|
RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret);
|
|
@@ -2263,17 +2272,22 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
|
static int storeToFile(const char *path, u8 *buf, u32 sz)
|
|
{
|
|
int ret = 0;
|
|
+#ifdef set_fs
|
|
mm_segment_t oldfs;
|
|
+#endif
|
|
struct file *fp;
|
|
|
|
if (path && buf) {
|
|
ret = openFile(&fp, path, O_CREAT | O_WRONLY, 0666);
|
|
if (0 == ret) {
|
|
RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp);
|
|
-
|
|
+#ifdef set_fs
|
|
oldfs = get_fs();
|
|
ret = writeFile(fp, buf, sz);
|
|
set_fs(oldfs);
|
|
+#else
|
|
+ ret = writeFile(fp, buf, sz);
|
|
+#endif
|
|
closeFile(fp);
|
|
|
|
RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret);
|
|
--
|
|
Created with Armbian build tools https://github.com/armbian/build
|
|
|