old mode 100644new mode 100755.. | .. |
---|
41 | 41 | #ifdef CONFIG_HAS_WAKELOCK |
---|
42 | 42 | #include <linux/pm_wakeup.h> |
---|
43 | 43 | #endif /* CONFIG_HAS_WAKELOCK */ |
---|
| 44 | +#include <linux/wakelock.h> |
---|
44 | 45 | #include <dngl_stats.h> |
---|
45 | 46 | #include <dhd.h> |
---|
46 | 47 | #include <dhd_dbg.h> |
---|
.. | .. |
---|
128 | 129 | |
---|
129 | 130 | /* Wakelocks */ |
---|
130 | 131 | #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 */ |
---|
138 | 139 | #ifdef BCMPCIE_OOB_HOST_WAKE |
---|
139 | | - struct wakeup_source *wl_intrwake; /* Host wakeup wakelock */ |
---|
| 140 | + struct wakeup_source wl_intrwake; /* Host wakeup wakelock */ |
---|
140 | 141 | #endif /* BCMPCIE_OOB_HOST_WAKE */ |
---|
141 | 142 | #ifdef DHD_USE_SCAN_WAKELOCK |
---|
142 | | - struct wakeup_source *wl_scanwake; /* Wifi scan wakelock */ |
---|
| 143 | + struct wakeup_source wl_scanwake; /* Wifi scan wakelock */ |
---|
143 | 144 | #endif /* DHD_USE_SCAN_WAKELOCK */ |
---|
144 | | - struct wakeup_source *wl_nanwake; /* NAN wakelock */ |
---|
| 145 | + struct wakeup_source wl_nanwake; /* NAN wakelock */ |
---|
145 | 146 | #endif /* CONFIG_HAS_WAKELOCK */ |
---|
146 | 147 | |
---|
| 148 | + struct wake_lock rx_wakelock; |
---|
147 | 149 | #if defined(OEM_ANDROID) |
---|
148 | 150 | /* net_device interface lock, prevent race conditions among net_dev interface |
---|
149 | 151 | * calls and wifi_on or wifi_off |
---|
.. | .. |
---|
501 | 503 | extern uint fis_enab; |
---|
502 | 504 | #endif /* DHD_SSSR_DUMP */ |
---|
503 | 505 | |
---|
504 | | -#if defined(ANDROID_VERSION) && (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) |
---|
505 | | -#define WAKELOCK_BACKPORT |
---|
506 | | -#endif |
---|
507 | | - |
---|
508 | 506 | #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) |
---|
524 | 513 | #define dhd_wake_lock(wakeup_source) __pm_stay_awake(wakeup_source) |
---|
525 | 514 | #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) |
---|
527 | 516 | #define dhd_wake_lock_timeout(wakeup_source, timeout) \ |
---|
528 | 517 | __pm_wakeup_event(wakeup_source, jiffies_to_msecs(timeout)) |
---|
529 | 518 | #endif /* CONFIG_HAS_WAKELOCK */ |
---|