hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/drivers/net/wireless/rockchip_wlan/rkwifi/bcmdhd/dhd_linux_priv.h
old mode 100644new mode 100755
....@@ -41,6 +41,7 @@
4141 #ifdef CONFIG_HAS_WAKELOCK
4242 #include <linux/pm_wakeup.h>
4343 #endif /* CONFIG_HAS_WAKELOCK */
44
+#include <linux/wakelock.h>
4445 #include <dngl_stats.h>
4546 #include <dhd.h>
4647 #include <dhd_dbg.h>
....@@ -128,22 +129,23 @@
128129
129130 /* Wakelocks */
130131 #if defined(CONFIG_HAS_WAKELOCK)
131
- struct wakeup_source *wl_wifi; /* Wifi wakelock */
132
- struct wakeup_source *wl_rxwake; /* Wifi rx wakelock */
133
- struct wakeup_source *wl_ctrlwake; /* Wifi ctrl wakelock */
134
- struct wakeup_source *wl_wdwake; /* Wifi wd wakelock */
135
- struct wakeup_source *wl_evtwake; /* Wifi event wakelock */
136
- struct wakeup_source *wl_pmwake; /* Wifi pm handler wakelock */
137
- struct wakeup_source *wl_txflwake; /* Wifi tx flow wakelock */
132
+ struct wakeup_source wl_wifi; /* Wifi wakelock */
133
+ struct wakeup_source wl_rxwake; /* Wifi rx wakelock */
134
+ struct wakeup_source wl_ctrlwake; /* Wifi ctrl wakelock */
135
+ struct wakeup_source wl_wdwake; /* Wifi wd wakelock */
136
+ struct wakeup_source wl_evtwake; /* Wifi event wakelock */
137
+ struct wakeup_source wl_pmwake; /* Wifi pm handler wakelock */
138
+ struct wakeup_source wl_txflwake; /* Wifi tx flow wakelock */
138139 #ifdef BCMPCIE_OOB_HOST_WAKE
139
- struct wakeup_source *wl_intrwake; /* Host wakeup wakelock */
140
+ struct wakeup_source wl_intrwake; /* Host wakeup wakelock */
140141 #endif /* BCMPCIE_OOB_HOST_WAKE */
141142 #ifdef DHD_USE_SCAN_WAKELOCK
142
- struct wakeup_source *wl_scanwake; /* Wifi scan wakelock */
143
+ struct wakeup_source wl_scanwake; /* Wifi scan wakelock */
143144 #endif /* DHD_USE_SCAN_WAKELOCK */
144
- struct wakeup_source *wl_nanwake; /* NAN wakelock */
145
+ struct wakeup_source wl_nanwake; /* NAN wakelock */
145146 #endif /* CONFIG_HAS_WAKELOCK */
146147
148
+ struct wake_lock rx_wakelock;
147149 #if defined(OEM_ANDROID)
148150 /* net_device interface lock, prevent race conditions among net_dev interface
149151 * calls and wifi_on or wifi_off
....@@ -501,29 +503,16 @@
501503 extern uint fis_enab;
502504 #endif /* DHD_SSSR_DUMP */
503505
504
-#if defined(ANDROID_VERSION) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
505
-#define WAKELOCK_BACKPORT
506
-#endif
507
-
508506 #ifdef CONFIG_HAS_WAKELOCK
509
-#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || defined(WAKELOCK_BACKPORT))
510
-#define dhd_wake_lock_init(wakeup_source, dev, name) \
511
-do { \
512
- wakeup_source = wakeup_source_register(dev, name); \
513
-} while (0);
514
-#else
515
-#define dhd_wake_lock_init(wakeup_source, dev, name) \
516
-do { \
517
- wakeup_source = wakeup_source_register(name); \
518
-} while (0);
519
-#endif /* LINUX_VERSION >= 5.4.0 */
520
-#define dhd_wake_lock_destroy(wakeup_source) \
521
-do { \
522
- wakeup_source_unregister(wakeup_source); \
523
-} while (0);
507
+enum {
508
+ WAKE_LOCK_SUSPEND, /* Prevent suspend */
509
+ WAKE_LOCK_TYPE_COUNT
510
+};
511
+#define dhd_wake_lock_init(wakeup_source, type, name) wakeup_source_add(wakeup_source)
512
+#define dhd_wake_lock_destroy(wakeup_source) wakeup_source_remove(wakeup_source)
524513 #define dhd_wake_lock(wakeup_source) __pm_stay_awake(wakeup_source)
525514 #define dhd_wake_unlock(wakeup_source) __pm_relax(wakeup_source)
526
-#define dhd_wake_lock_active(wakeup_source) ((wakeup_source)?((wakeup_source)->active):0)
515
+#define dhd_wake_lock_active(wakeup_source) ((wakeup_source)->active)
527516 #define dhd_wake_lock_timeout(wakeup_source, timeout) \
528517 __pm_wakeup_event(wakeup_source, jiffies_to_msecs(timeout))
529518 #endif /* CONFIG_HAS_WAKELOCK */