• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * DHD Linux header file - contains private structure definition of the Linux specific layer
3  *
4  * Copyright (C) 2020, Broadcom.
5  *
6  *      Unless you and Broadcom execute a separate written software license
7  * agreement governing use of this software, this software is licensed to you
8  * under the terms of the GNU General Public License version 2 (the "GPL"),
9  * available at http://www.broadcom.com/licenses/GPLv2.php, with the
10  * following added to such license:
11  *
12  *      As a special exception, the copyright holders of this software give you
13  * permission to link this software with independent modules, and to copy and
14  * distribute the resulting executable under terms of your choice, provided that
15  * you also meet, for each linked independent module, the terms and conditions of
16  * the license of that module.  An independent module is a module which is not
17  * derived from this software.  The special exception does not apply to any
18  * modifications of the software.
19  *
20  *
21  * <<Broadcom-WL-IPTag/Open:>>
22  *
23  * $Id$
24  */
25 
26 #ifndef __DHD_LINUX_PRIV_H__
27 #define __DHD_LINUX_PRIV_H__
28 
29 #include <osl.h>
30 
31 #ifdef SHOW_LOGTRACE
32 #include <linux/syscalls.h>
33 #include <event_log.h>
34 #endif /* SHOW_LOGTRACE */
35 #include <linux/skbuff.h>
36 #include <linux/spinlock.h>
37 #include <linux/interrupt.h>
38 #ifdef CONFIG_COMPAT
39 #include <linux/compat.h>
40 #endif /* CONFIG COMPAT */
41 #ifdef CONFIG_HAS_WAKELOCK
42 #include <linux/pm_wakeup.h>
43 #endif /* CONFIG_HAS_WAKELOCK */
44 #include <dngl_stats.h>
45 #include <dhd.h>
46 #include <dhd_dbg.h>
47 #include <dhd_debug.h>
48 #include <dhd_linux.h>
49 #include <dhd_bus.h>
50 
51 #ifdef PCIE_FULL_DONGLE
52 #include <bcmmsgbuf.h>
53 #include <dhd_flowring.h>
54 #endif /* PCIE_FULL_DONGLE */
55 
56 #ifdef DHD_QOS_ON_SOCK_FLOW
57 struct dhd_sock_qos_info;
58 #endif /* DHD_QOS_ON_SOCK_FLOW */
59 
60 /*
61  * Do not include this header except for the dhd_linux.c dhd_linux_sysfs.c
62  * Local private structure (extension of pub)
63  */
64 typedef struct dhd_info {
65 #if defined(WL_WIRELESS_EXT)
66 	wl_iw_t		iw;		/* wireless extensions state (must be first) */
67 #endif /* defined(WL_WIRELESS_EXT) */
68 	dhd_pub_t pub;
69 	/* for supporting multiple interfaces.
70 	* static_ifs hold the net ifaces without valid FW IF
71 	*/
72 	dhd_if_t *iflist[DHD_MAX_IFS + DHD_MAX_STATIC_IFS];
73 	wifi_adapter_info_t *adapter;			/* adapter information, interrupt, fw path etc. */
74 	char fw_path[PATH_MAX];		/* path to firmware image */
75 	char nv_path[PATH_MAX];		/* path to nvram vars file */
76 	char clm_path[PATH_MAX];		/* path to clm vars file */
77 	char conf_path[PATH_MAX];	/* path to config vars file */
78 #ifdef DHD_UCODE_DOWNLOAD
79 	char uc_path[PATH_MAX];	/* path to ucode image */
80 #endif /* DHD_UCODE_DOWNLOAD */
81 
82 	/* serialize dhd iovars */
83 	struct mutex dhd_iovar_mutex;
84 
85 	struct semaphore proto_sem;
86 #ifdef PROP_TXSTATUS
87 	spinlock_t	wlfc_spinlock;
88 
89 #ifdef BCMDBUS
90 	ulong		wlfc_lock_flags;
91 	ulong		wlfc_pub_lock_flags;
92 #endif
93 #endif /* PROP_TXSTATUS */
94 	wait_queue_head_t ioctl_resp_wait;
95 	wait_queue_head_t d3ack_wait;
96 	wait_queue_head_t dhd_bus_busy_state_wait;
97 	wait_queue_head_t dmaxfer_wait;
98 #ifdef BT_OVER_PCIE
99 	wait_queue_head_t quiesce_wait;
100 #endif /* BT_OVER_PCIE */
101 	uint32	default_wd_interval;
102 
103 	timer_list_compat_t timer;
104 	bool wd_timer_valid;
105 #ifdef DHD_PCIE_RUNTIMEPM
106 	timer_list_compat_t rpm_timer;
107 	bool rpm_timer_valid;
108 	tsk_ctl_t	  thr_rpm_ctl;
109 #endif /* DHD_PCIE_RUNTIMEPM */
110 	struct tasklet_struct tasklet;
111 	spinlock_t	sdlock;
112 	spinlock_t	txqlock;
113 	spinlock_t	dhd_lock;
114 #ifdef BCMDBUS
115 	ulong		txqlock_flags;
116 #else
117 
118 	struct semaphore sdsem;
119 	tsk_ctl_t	thr_dpc_ctl;
120 	tsk_ctl_t	thr_wdt_ctl;
121 #endif /* BCMDBUS */
122 
123 	tsk_ctl_t	thr_rxf_ctl;
124 	spinlock_t	rxf_lock;
125 	bool		rxthread_enabled;
126 
127 	/* Wakelocks */
128 #if defined(CONFIG_HAS_WAKELOCK)
129 	struct wakeup_source wl_wifi;   /* Wifi wakelock */
130 	struct wakeup_source wl_rxwake; /* Wifi rx wakelock */
131 	struct wakeup_source wl_ctrlwake; /* Wifi ctrl wakelock */
132 	struct wakeup_source wl_wdwake; /* Wifi wd wakelock */
133 	struct wakeup_source wl_evtwake; /* Wifi event wakelock */
134 	struct wakeup_source wl_pmwake;   /* Wifi pm handler wakelock */
135 	struct wakeup_source wl_txflwake; /* Wifi tx flow wakelock */
136 #ifdef BCMPCIE_OOB_HOST_WAKE
137 	struct wakeup_source wl_intrwake; /* Host wakeup wakelock */
138 #endif /* BCMPCIE_OOB_HOST_WAKE */
139 #ifdef DHD_USE_SCAN_WAKELOCK
140 	struct wakeup_source wl_scanwake;  /* Wifi scan wakelock */
141 #endif /* DHD_USE_SCAN_WAKELOCK */
142 	struct wakeup_source wl_nanwake; /* NAN wakelock */
143 #endif /* CONFIG_HAS_WAKELOCK */
144 
145 #if defined(OEM_ANDROID)
146 	/* net_device interface lock, prevent race conditions among net_dev interface
147 	 * calls and wifi_on or wifi_off
148 	 */
149 	struct mutex dhd_net_if_mutex;
150 	struct mutex dhd_suspend_mutex;
151 #if defined(PKT_FILTER_SUPPORT) && defined(APF)
152 	struct mutex dhd_apf_mutex;
153 #endif /* PKT_FILTER_SUPPORT && APF */
154 #endif /* OEM_ANDROID */
155 	spinlock_t wakelock_spinlock;
156 	spinlock_t wakelock_evt_spinlock;
157 	uint32 wakelock_counter;
158 	int wakelock_wd_counter;
159 	int wakelock_rx_timeout_enable;
160 	int wakelock_ctrl_timeout_enable;
161 	bool waive_wakelock;
162 	uint32 wakelock_before_waive;
163 
164 	/* Thread to issue ioctl for multicast */
165 	wait_queue_head_t ctrl_wait;
166 	atomic_t pend_8021x_cnt;
167 	dhd_attach_states_t dhd_state;
168 #ifdef SHOW_LOGTRACE
169 	dhd_event_log_t event_data;
170 #endif /* SHOW_LOGTRACE */
171 
172 #if defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND)
173 	struct early_suspend early_suspend;
174 #endif /* CONFIG_HAS_EARLYSUSPEND && DHD_USE_EARLYSUSPEND */
175 
176 #ifdef ARP_OFFLOAD_SUPPORT
177 	u32 pend_ipaddr;
178 #endif /* ARP_OFFLOAD_SUPPORT */
179 #ifdef DHDTCPACK_SUPPRESS
180 	spinlock_t	tcpack_lock;
181 #endif /* DHDTCPACK_SUPPRESS */
182 #ifdef FIX_CPU_MIN_CLOCK
183 	bool cpufreq_fix_status;
184 	struct mutex cpufreq_fix;
185 	struct pm_qos_request dhd_cpu_qos;
186 #ifdef FIX_BUS_MIN_CLOCK
187 	struct pm_qos_request dhd_bus_qos;
188 #endif /* FIX_BUS_MIN_CLOCK */
189 #endif /* FIX_CPU_MIN_CLOCK */
190 	void			*dhd_deferred_wq;
191 #if (defined(BCM_ROUTER_DHD) && defined(HNDCTF))
192 	ctf_t		*cih;		/* ctf instance handle */
193 	ctf_brc_hot_t *brc_hot;			/* hot ctf bridge cache entry */
194 #endif /* BCM_ROUTER_DHD && HNDCTF */
195 #ifdef DEBUG_CPU_FREQ
196 	struct notifier_block freq_trans;
197 	int __percpu *new_freq;
198 #endif
199 	unsigned int unit;
200 	struct notifier_block pm_notifier;
201 #ifdef DHD_PSTA
202 	uint32	psta_mode;	/* PSTA or PSR */
203 #endif /* DHD_PSTA */
204 #ifdef DHD_WET
205 	        uint32  wet_mode;
206 #endif /* DHD_WET */
207 #ifdef DHD_DEBUG
208 	dhd_dump_t *dump;
209 	timer_list_compat_t join_timer;
210 	u32 join_timeout_val;
211 	bool join_timer_active;
212 	uint scan_time_count;
213 	timer_list_compat_t scan_timer;
214 	bool scan_timer_active;
215 #endif
216 	struct delayed_work	dhd_dpc_dispatcher_work;
217 
218 	/* CPU on which the DHD DPC is running */
219 	atomic_t	dpc_cpu;
220 	atomic_t	prev_dpc_cpu;
221 #if defined(DHD_LB)
222 #if defined(DHD_LB_HOST_CTRL)
223 	bool permitted_primary_cpu;
224 #endif /* DHD_LB_HOST_CTRL */
225 	/* CPU Load Balance dynamic CPU selection */
226 
227 	/* Variable that tracks the currect CPUs available for candidacy */
228 	cpumask_var_t cpumask_curr_avail;
229 
230 	/* Primary and secondary CPU mask */
231 	cpumask_var_t cpumask_primary, cpumask_secondary; /* configuration */
232 	cpumask_var_t cpumask_primary_new, cpumask_secondary_new; /* temp */
233 
234 	struct notifier_block cpu_notifier;
235 
236 	/* Napi struct for handling rx packet sendup. Packets are removed from
237 	 * H2D RxCompl ring and placed into rx_pend_queue. rx_pend_queue is then
238 	 * appended to rx_napi_queue (w/ lock) and the rx_napi_struct is scheduled
239 	 * to run to rx_napi_cpu.
240 	 */
241 	struct sk_buff_head   rx_pend_queue  ____cacheline_aligned;
242 	struct sk_buff_head   rx_napi_queue  ____cacheline_aligned;
243 	struct sk_buff_head   rx_process_queue  ____cacheline_aligned;
244 	struct napi_struct    rx_napi_struct ____cacheline_aligned;
245 	atomic_t                   rx_napi_cpu; /* cpu on which the napi is dispatched */
246 	struct net_device    *rx_napi_netdev; /* netdev of primary interface */
247 
248 	struct work_struct    rx_napi_dispatcher_work;
249 	struct work_struct    tx_compl_dispatcher_work;
250 	struct work_struct    tx_dispatcher_work;
251 	struct work_struct    rx_compl_dispatcher_work;
252 
253 	/* Number of times DPC Tasklet ran */
254 	uint32	dhd_dpc_cnt;
255 	/* Number of times NAPI processing got scheduled */
256 	uint32	napi_sched_cnt;
257 	/* NAPI latency stats */
258 	uint64  *napi_latency;
259 	uint64 napi_schedule_time;
260 	/* Number of times NAPI processing ran on each available core */
261 	uint32	*napi_percpu_run_cnt;
262 	/* Number of times RX Completions got scheduled */
263 	uint32	rxc_sched_cnt;
264 	/* Number of times RX Completion ran on each available core */
265 	uint32	*rxc_percpu_run_cnt;
266 	/* Number of times TX Completions got scheduled */
267 	uint32	txc_sched_cnt;
268 	/* Number of times TX Completions ran on each available core */
269 	uint32	*txc_percpu_run_cnt;
270 	/* CPU status */
271 	/* Number of times each CPU came online */
272 	uint32	*cpu_online_cnt;
273 	/* Number of times each CPU went offline */
274 	uint32	*cpu_offline_cnt;
275 
276 	/* Number of times TX processing run on each core */
277 	uint32	*txp_percpu_run_cnt;
278 	/* Number of times TX start run on each core */
279 	uint32	*tx_start_percpu_run_cnt;
280 
281 	/* Tx load balancing */
282 
283 	/* TODO: Need to see if batch processing is really required in case of TX
284 	 * processing. In case of RX the Dongle can send a bunch of rx completions,
285 	 * hence we took a 3 queue approach
286 	 * enque - adds the skbs to rx_pend_queue
287 	 * dispatch - uses a lock and adds the list of skbs from pend queue to
288 	 *            napi queue
289 	 * napi processing - copies the pend_queue into a local queue and works
290 	 * on it.
291 	 * But for TX its going to be 1 skb at a time, so we are just thinking
292 	 * of using only one queue and use the lock supported skb queue functions
293 	 * to add and process it. If its in-efficient we'll re-visit the queue
294 	 * design.
295 	 */
296 
297 	/* When the NET_TX tries to send a TX packet put it into tx_pend_queue */
298 	/* struct sk_buff_head		tx_pend_queue  ____cacheline_aligned;  */
299 	/*
300 	 * From the Tasklet that actually sends out data
301 	 * copy the list tx_pend_queue into tx_active_queue. There by we need
302 	 * to spinlock to only perform the copy the rest of the code ie to
303 	 * construct the tx_pend_queue and the code to process tx_active_queue
304 	 * can be lockless. The concept is borrowed as is from RX processing
305 	 */
306 	/* struct sk_buff_head		tx_active_queue  ____cacheline_aligned; */
307 
308 	/* Control TXP in runtime, enable by default */
309 	atomic_t                lb_txp_active;
310 
311 	/* Control RXP in runtime, enable by default */
312 	atomic_t                lb_rxp_active;
313 
314 	/*
315 	 * When the NET_TX tries to send a TX packet put it into tx_pend_queue
316 	 * For now, the processing tasklet will also direcly operate on this
317 	 * queue
318 	 */
319 	struct sk_buff_head	tx_pend_queue  ____cacheline_aligned;
320 
321 	/* cpu on which the DHD Tx is happenning */
322 	atomic_t		tx_cpu;
323 
324 	/* CPU on which the Network stack is calling the DHD's xmit function */
325 	atomic_t		net_tx_cpu;
326 
327 	/* Tasklet context from which the DHD's TX processing happens */
328 	struct tasklet_struct tx_tasklet;
329 
330 	/*
331 	 * Consumer Histogram - NAPI RX Packet processing
332 	 * -----------------------------------------------
333 	 * On Each CPU, when the NAPI RX Packet processing call back was invoked
334 	 * how many packets were processed is captured in this data structure.
335 	 * Now its difficult to capture the "exact" number of packets processed.
336 	 * So considering the packet counter to be a 32 bit one, we have a
337 	 * bucket with 8 bins (2^1, 2^2 ... 2^8). The "number" of packets
338 	 * processed is rounded off to the next power of 2 and put in the
339 	 * approriate "bin" the value in the bin gets incremented.
340 	 * For example, assume that in CPU 1 if NAPI Rx runs 3 times
341 	 * and the packet count processed is as follows (assume the bin counters are 0)
342 	 * iteration 1 - 10 (the bin counter 2^4 increments to 1)
343 	 * iteration 2 - 30 (the bin counter 2^5 increments to 1)
344 	 * iteration 3 - 15 (the bin counter 2^4 increments by 1 to become 2)
345 	 */
346 	uint32 *napi_rx_hist[HIST_BIN_SIZE];
347 	uint32 *txc_hist[HIST_BIN_SIZE];
348 	uint32 *rxc_hist[HIST_BIN_SIZE];
349 	struct kobject dhd_lb_kobj;
350 	bool dhd_lb_candidacy_override;
351 #endif /* DHD_LB */
352 #if defined(DNGL_AXI_ERROR_LOGGING) && defined(DHD_USE_WQ_FOR_DNGL_AXI_ERROR)
353 	struct work_struct	  axi_error_dispatcher_work;
354 #endif /* DNGL_AXI_ERROR_LOGGING && DHD_USE_WQ_FOR_DNGL_AXI_ERROR */
355 #ifdef SHOW_LOGTRACE
356 #ifdef DHD_USE_KTHREAD_FOR_LOGTRACE
357 	tsk_ctl_t	  thr_logtrace_ctl;
358 #else
359 	struct delayed_work	  event_log_dispatcher_work;
360 #endif /* DHD_USE_KTHREAD_FOR_LOGTRACE */
361 #endif /* SHOW_LOGTRACE */
362 
363 #ifdef BTLOG
364 	struct work_struct	  bt_log_dispatcher_work;
365 #endif /* SHOW_LOGTRACE */
366 #ifdef EWP_EDL
367 	struct delayed_work edl_dispatcher_work;
368 #endif
369 #if defined(WLAN_ACCEL_BOOT)
370 	int fs_check_retry;
371 	struct delayed_work wl_accel_work;
372 	bool wl_accel_force_reg_on;
373 	bool wl_accel_boot_on_done;
374 #endif
375 #if defined(BCM_DNGL_EMBEDIMAGE) || defined(BCM_REQUEST_FW)
376 #if defined(BCMDBUS)
377 	struct task_struct *fw_download_task;
378 	struct semaphore fw_download_lock;
379 #endif /* BCMDBUS */
380 #endif /* defined(BCM_DNGL_EMBEDIMAGE) || defined(BCM_REQUEST_FW) */
381 	struct kobject dhd_kobj;
382 	timer_list_compat_t timesync_timer;
383 #if defined(BT_OVER_SDIO)
384     char btfw_path[PATH_MAX];
385 #endif /* defined (BT_OVER_SDIO) */
386 #ifdef WL_MONITOR
387 	struct net_device *monitor_dev; /* monitor pseudo device */
388 	struct sk_buff *monitor_skb;
389 	uint	monitor_len;
390 	uint	monitor_type;   /* monitor pseudo device */
391 #ifdef HOST_RADIOTAP_CONV
392 	monitor_info_t *monitor_info;
393 	uint host_radiotap_conv;
394 #endif /* HOST_RADIOTAP_CONV */
395 #endif /* WL_MONITOR */
396 #if defined (BT_OVER_SDIO)
397     struct mutex bus_user_lock; /* lock for sdio bus apis shared between WLAN & BT */
398     int     bus_user_count; /* User counts of sdio bus shared between WLAN & BT */
399 #endif /* BT_OVER_SDIO */
400 #ifdef SHOW_LOGTRACE
401 	struct sk_buff_head   evt_trace_queue     ____cacheline_aligned;
402 #endif
403 #ifdef DHD_PCIE_NATIVE_RUNTIMEPM
404 	struct workqueue_struct *tx_wq;
405 	struct workqueue_struct *rx_wq;
406 #endif /* DHD_PCIE_NATIVE_RUNTIMEPM */
407 #ifdef BTLOG
408 	struct sk_buff_head   bt_log_queue     ____cacheline_aligned;
409 #endif	/* BTLOG */
410 #ifdef PCIE_INB_DW
411 	wait_queue_head_t ds_exit_wait;
412 #endif /* PCIE_INB_DW */
413 #ifdef DHD_DEBUG_UART
414 	bool duart_execute;
415 #endif	/* DHD_DEBUG_UART */
416 #ifdef BT_OVER_PCIE
417 	struct mutex quiesce_flr_lock;
418 	struct mutex quiesce_lock;
419 	enum dhd_bus_quiesce_state dhd_quiesce_state;
420 #endif /* BT_OVER_PCIE */
421 	struct mutex logdump_lock;
422 #if defined(GDB_PROXY) && defined(PCIE_FULL_DONGLE) && defined(BCMINTERNAL)
423 	/* Root directory for GDB Proxy's (proc)fs files, used by first (default) interface */
424 	struct proc_dir_entry *gdb_proxy_fs_root;
425 	/* Name of procfs root directory */
426 	char gdb_proxy_fs_root_name[100];
427 #endif /* defined(GDB_PROXY) && defined(PCIE_FULL_DONGLE) && defined(BCMINTERNAL) */
428 #if defined(DHD_MQ) && defined(DHD_MQ_STATS)
429 	uint64 pktcnt_qac_histo[MQ_MAX_QUEUES][AC_COUNT];
430 	uint64 pktcnt_per_ac[AC_COUNT];
431 	uint64 cpu_qstats[MQ_MAX_QUEUES][MQ_MAX_CPUS];
432 #endif /* DHD_MQ && DHD_MQ_STATS */
433 	/* indicates mem_dump was scheduled as work queue or called directly */
434 	bool scheduled_memdump;
435 #ifdef DHD_PKTTS
436 	bool latency; /* pktts enab flag */
437 	pktts_flow_t config[PKTTS_CONFIG_MAX]; /* pktts user config */
438 #endif /* DHD_PKTTS */
439 	struct work_struct dhd_hang_process_work;
440 #ifdef DHD_HP2P
441 	spinlock_t	hp2p_lock;
442 #endif /* DHD_HP2P */
443 #ifdef DHD_QOS_ON_SOCK_FLOW
444 	struct dhd_sock_qos_info *psk_qos;
445 #endif
446 } dhd_info_t;
447 
448 #ifdef WL_MONITOR
449 #define MONPKT_EXTRA_LEN	48u
450 #endif /* WL_MONITOR */
451 
452 extern int dhd_sysfs_init(dhd_info_t *dhd);
453 extern void dhd_sysfs_exit(dhd_info_t *dhd);
454 extern void dhd_dbg_ring_proc_create(dhd_pub_t *dhdp);
455 extern void dhd_dbg_ring_proc_destroy(dhd_pub_t *dhdp);
456 
457 int __dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, void *pktbuf);
458 
459 void dhd_dpc_tasklet_dispatcher_work(struct work_struct * work);
460 #if defined(DHD_LB)
461 #if defined(DHD_LB_TXP)
462 int dhd_lb_sendpkt(dhd_info_t *dhd, struct net_device *net, int ifidx, void *skb);
463 void dhd_tx_dispatcher_work(struct work_struct * work);
464 void dhd_tx_dispatcher_fn(dhd_pub_t *dhdp);
465 void dhd_lb_tx_dispatch(dhd_pub_t *dhdp);
466 void dhd_lb_tx_handler(unsigned long data);
467 #endif /* DHD_LB_TXP */
468 
469 #if defined(DHD_LB_RXP)
470 int dhd_napi_poll(struct napi_struct *napi, int budget);
471 void dhd_rx_napi_dispatcher_work(struct work_struct * work);
472 void dhd_lb_rx_napi_dispatch(dhd_pub_t *dhdp);
473 void dhd_lb_rx_pkt_enqueue(dhd_pub_t *dhdp, void *pkt, int ifidx);
474 unsigned long dhd_read_lb_rxp(dhd_pub_t *dhdp);
475 #endif /* DHD_LB_RXP */
476 
477 void dhd_lb_set_default_cpus(dhd_info_t *dhd);
478 void dhd_cpumasks_deinit(dhd_info_t *dhd);
479 int dhd_cpumasks_init(dhd_info_t *dhd);
480 
481 void dhd_select_cpu_candidacy(dhd_info_t *dhd);
482 
483 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0))
484 int dhd_cpu_startup_callback(unsigned int cpu);
485 int dhd_cpu_teardown_callback(unsigned int cpu);
486 #else
487 int dhd_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu);
488 #endif /* LINUX_VERSION_CODE < 4.10.0 */
489 
490 int dhd_register_cpuhp_callback(dhd_info_t *dhd);
491 int dhd_unregister_cpuhp_callback(dhd_info_t *dhd);
492 #endif /* DHD_LB */
493 
494 #if defined(DHD_CONTROL_PCIE_CPUCORE_WIFI_TURNON)
495 void dhd_irq_set_affinity(dhd_pub_t *dhdp, const struct cpumask *cpumask);
496 #endif /* DHD_CONTROL_PCIE_CPUCORE_WIFI_TURNON */
497 #ifdef DHD_SSSR_DUMP
498 extern uint sssr_enab;
499 extern uint fis_enab;
500 #endif /* DHD_SSSR_DUMP */
501 
502 #ifdef CONFIG_HAS_WAKELOCK
503 enum {
504 	WAKE_LOCK_SUSPEND, /* Prevent suspend */
505 	WAKE_LOCK_TYPE_COUNT
506 };
507 #define dhd_wake_lock_init(wakeup_source, type, name)	wakeup_source_add(wakeup_source)
508 #define dhd_wake_lock_destroy(wakeup_source)		wakeup_source_remove(wakeup_source)
509 #define dhd_wake_lock(wakeup_source)			__pm_stay_awake(wakeup_source)
510 #define dhd_wake_unlock(wakeup_source)			__pm_relax(wakeup_source)
511 #define dhd_wake_lock_active(wakeup_source)		((wakeup_source)->active)
512 #define dhd_wake_lock_timeout(wakeup_source, timeout)	\
513 	__pm_wakeup_event(wakeup_source, jiffies_to_msecs(timeout))
514 #endif /* CONFIG_HAS_WAKELOCK */
515 
516 #endif /* __DHD_LINUX_PRIV_H__ */
517