From bedbef8ad3e75a304af6361af235302bcc61d06b Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Tue, 14 May 2024 06:39:01 +0000
Subject: [PATCH] 修改内核路径

---
 kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux_priv.h |   49 +++++++++++++++++++------------------------------
 1 files changed, 19 insertions(+), 30 deletions(-)

diff --git a/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux_priv.h b/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux_priv.h
old mode 100644
new mode 100755
index 019884b..88a3abb
--- a/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux_priv.h
+++ b/kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux_priv.h
@@ -41,6 +41,7 @@
 #ifdef CONFIG_HAS_WAKELOCK
 #include <linux/pm_wakeup.h>
 #endif /* CONFIG_HAS_WAKELOCK */
+#include <linux/wakelock.h>
 #include <dngl_stats.h>
 #include <dhd.h>
 #include <dhd_dbg.h>
@@ -128,22 +129,23 @@
 
 	/* Wakelocks */
 #if defined(CONFIG_HAS_WAKELOCK)
-	struct wakeup_source *wl_wifi;   /* Wifi wakelock */
-	struct wakeup_source *wl_rxwake; /* Wifi rx wakelock */
-	struct wakeup_source *wl_ctrlwake; /* Wifi ctrl wakelock */
-	struct wakeup_source *wl_wdwake; /* Wifi wd wakelock */
-	struct wakeup_source *wl_evtwake; /* Wifi event wakelock */
-	struct wakeup_source *wl_pmwake;   /* Wifi pm handler wakelock */
-	struct wakeup_source *wl_txflwake; /* Wifi tx flow wakelock */
+	struct wakeup_source wl_wifi;   /* Wifi wakelock */
+	struct wakeup_source wl_rxwake; /* Wifi rx wakelock */
+	struct wakeup_source wl_ctrlwake; /* Wifi ctrl wakelock */
+	struct wakeup_source wl_wdwake; /* Wifi wd wakelock */
+	struct wakeup_source wl_evtwake; /* Wifi event wakelock */
+	struct wakeup_source wl_pmwake;   /* Wifi pm handler wakelock */
+	struct wakeup_source wl_txflwake; /* Wifi tx flow wakelock */
 #ifdef BCMPCIE_OOB_HOST_WAKE
-	struct wakeup_source *wl_intrwake; /* Host wakeup wakelock */
+	struct wakeup_source wl_intrwake; /* Host wakeup wakelock */
 #endif /* BCMPCIE_OOB_HOST_WAKE */
 #ifdef DHD_USE_SCAN_WAKELOCK
-	struct wakeup_source *wl_scanwake;  /* Wifi scan wakelock */
+	struct wakeup_source wl_scanwake;  /* Wifi scan wakelock */
 #endif /* DHD_USE_SCAN_WAKELOCK */
-	struct wakeup_source *wl_nanwake; /* NAN wakelock */
+	struct wakeup_source wl_nanwake; /* NAN wakelock */
 #endif /* CONFIG_HAS_WAKELOCK */
 
+	struct wake_lock rx_wakelock;
 #if defined(OEM_ANDROID)
 	/* net_device interface lock, prevent race conditions among net_dev interface
 	 * calls and wifi_on or wifi_off
@@ -501,29 +503,16 @@
 extern uint fis_enab;
 #endif /* DHD_SSSR_DUMP */
 
-#if defined(ANDROID_VERSION) && (LINUX_VERSION_CODE  >= KERNEL_VERSION(4, 19, 0))
-#define WAKELOCK_BACKPORT
-#endif
-
 #ifdef CONFIG_HAS_WAKELOCK
-#if ((LINUX_VERSION_CODE  >= KERNEL_VERSION(5, 4, 0)) || defined(WAKELOCK_BACKPORT))
-#define dhd_wake_lock_init(wakeup_source, dev, name) \
-do { \
-	wakeup_source = wakeup_source_register(dev, name); \
-} while (0);
-#else
-#define dhd_wake_lock_init(wakeup_source, dev, name) \
-do { \
-	wakeup_source = wakeup_source_register(name); \
-} while (0);
-#endif /* LINUX_VERSION >= 5.4.0 */
-#define dhd_wake_lock_destroy(wakeup_source) \
-do { \
-	wakeup_source_unregister(wakeup_source); \
-} while (0);
+enum {
+	WAKE_LOCK_SUSPEND, /* Prevent suspend */
+	WAKE_LOCK_TYPE_COUNT
+};
+#define dhd_wake_lock_init(wakeup_source, type, name)	wakeup_source_add(wakeup_source)
+#define dhd_wake_lock_destroy(wakeup_source)		wakeup_source_remove(wakeup_source)
 #define dhd_wake_lock(wakeup_source)			__pm_stay_awake(wakeup_source)
 #define dhd_wake_unlock(wakeup_source)			__pm_relax(wakeup_source)
-#define dhd_wake_lock_active(wakeup_source)		((wakeup_source)?((wakeup_source)->active):0)
+#define dhd_wake_lock_active(wakeup_source)		((wakeup_source)->active)
 #define dhd_wake_lock_timeout(wakeup_source, timeout)	\
 	__pm_wakeup_event(wakeup_source, jiffies_to_msecs(timeout))
 #endif /* CONFIG_HAS_WAKELOCK */

--
Gitblit v1.6.2