forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/net/wireless/rockchip_wlan/cywdhd/bcmdhd/dhd.h
....@@ -1,18 +1,19 @@
1
-/* SPDX-License-Identifier: GPL-2.0 */
21 /*
32 * Header file describing the internal (inter-module) DHD interfaces.
43 *
54 * Provides type definitions and function prototypes used to link the
65 * DHD OS, bus, and protocol modules.
76 *
8
- * Copyright (C) 1999-2019, Broadcom Corporation
9
- *
7
+ * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation
8
+ *
9
+ * Copyright (C) 1999-2017, Broadcom Corporation
10
+ *
1011 * Unless you and Broadcom execute a separate written software license
1112 * agreement governing use of this software, this software is licensed to you
1213 * under the terms of the GNU General Public License version 2 (the "GPL"),
1314 * available at http://www.broadcom.com/licenses/GPLv2.php, with the
1415 * following added to such license:
15
- *
16
+ *
1617 * As a special exception, the copyright holders of this software give you
1718 * permission to link this software with independent modules, and to copy and
1819 * distribute the resulting executable under terms of your choice, provided that
....@@ -20,7 +21,7 @@
2021 * the license of that module. An independent module is a module which is not
2122 * derived from this software. The special exception does not apply to any
2223 * modifications of the software.
23
- *
24
+ *
2425 * Notwithstanding the above, under no circumstances may you combine this
2526 * software in any way with any other Broadcom software provided under a license
2627 * other than the GPL, without Broadcom's express prior written consent.
....@@ -28,7 +29,7 @@
2829 *
2930 * <<Broadcom-WL-IPTag/Open:>>
3031 *
31
- * $Id: dhd.h 715966 2019-05-30 02:36:59Z $
32
+ * $Id: dhd.h 701844 2017-05-26 18:56:40Z $
3233 */
3334
3435 /****************
....@@ -47,38 +48,60 @@
4748 #include <linux/random.h>
4849 #include <linux/spinlock.h>
4950 #include <linux/ethtool.h>
50
-#include <linux/uaccess.h>
51
+#include <linux/fs.h>
52
+#include <linux/proc_fs.h>
53
+#include <asm/uaccess.h>
5154 #include <asm/unaligned.h>
52
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_HAS_WAKELOCK)
55
+#if defined(CONFIG_PM_WAKELOCKS) || defined(CONFIG_HAS_WAKELOCK)
5356 #include <linux/wakelock.h>
54
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined (CONFIG_HAS_WAKELOCK) */
55
-#include <dhd_buzzz.h>
57
+#endif /* CONFIG_PM_WAKELOCKS || CONFIG_HAS_WAKELOCK */
58
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
59
+#include <linux/sched/types.h>
60
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) */
5661 /* The kernel threading is sdio-specific */
5762 struct task_struct;
5863 struct sched_param;
64
+#if defined(BT_OVER_SDIO)
65
+#include <dhd_bt_interface.h>
66
+#endif /* defined (BT_OVER_SDIO) */
5967 int setScheduler(struct task_struct *p, int policy, struct sched_param *param);
6068 int get_scheduler_policy(struct task_struct *p);
6169 #define MAX_EVENT 16
6270
6371 #define ALL_INTERFACES 0xff
6472
73
+/* H2D and D2H ring dump is enabled by default */
74
+#ifdef PCIE_FULL_DONGLE
75
+#define DHD_DUMP_PCIE_RINGS
76
+#endif /* PCIE_FULL_DONGLE */
77
+
6578 #include <wlioctl.h>
79
+#include <bcmstdlib_s.h>
80
+#include <dhdioctl.h>
6681 #include <wlfc_proto.h>
67
-#include <hnd_pktq.h>
82
+#include <hnd_armtrap.h>
83
+#if defined(DUMP_IOCTL_IOV_LIST) || defined(DHD_DEBUG)
84
+#include <bcmutils.h>
85
+#endif /* DUMP_IOCTL_IOV_LIST || DHD_DEBUG */
6886
6987 #if defined(BCMWDF)
7088 #include <wdf.h>
7189 #include <WdfMiniport.h>
7290 #endif /* (BCMWDF) */
7391
74
-#if defined(CUSTOMER_IPCAM)
75
-#define MAX_RESCHED_CNT 600
76
-#endif
92
+#ifdef WL_CFGVENDOR_SEND_HANG_EVENT
93
+#include <rte_ioctl.h>
94
+#endif /* WL_CFGVENDOR_SEND_HANG_EVENT */
7795
78
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0) || \
79
- defined(CONFIG_BCMDHD_VENDOR_EXT))
80
-#define WL_VENDOR_EXT_SUPPORT
81
-#endif /* 3.14.0 <= LINUX_KERNEL_VERSION || CONFIG_BCMDHD_VENDOR_EXT */
96
+#ifdef DHD_ERPOM
97
+#include <pom.h>
98
+#endif /* DHD_ERPOM */
99
+
100
+#include <dngl_stats.h>
101
+
102
+#ifdef DEBUG_DPC_THREAD_WATCHDOG
103
+#define MAX_RESCHED_CNT 600
104
+#endif /* DEBUG_DPC_THREAD_WATCHDOG */
82105
83106 #if defined(KEEP_ALIVE)
84107 /* Default KEEP_ALIVE Period is 55 sec to prevent AP from sending Keep Alive probe frame */
....@@ -86,12 +109,25 @@
86109 #define NULL_PKT_STR "null_pkt"
87110 #endif /* KEEP_ALIVE */
88111
112
+/* By default enabled from here, later the WQ code will be removed */
113
+#define DHD_USE_KTHREAD_FOR_LOGTRACE
114
+
115
+/*
116
+ * Earlier DHD used to have it own time stamp for printk and
117
+ * Dongle used to have its own time stamp for console messages
118
+ * With this flag, DHD and Dongle console messges will have same time zone
119
+ */
120
+#define DHD_H2D_LOG_TIME_SYNC
89121 /* Forward decls */
90122 struct dhd_bus;
91123 struct dhd_prot;
92124 struct dhd_info;
93125 struct dhd_ioctl;
94126 struct dhd_dbg;
127
+struct dhd_ts;
128
+#ifdef DNGL_AXI_ERROR_LOGGING
129
+struct dhd_axi_error_dump;
130
+#endif /* DNGL_AXI_ERROR_LOGGING */
95131
96132 /* The level of bus communication with the dongle */
97133 enum dhd_bus_state {
....@@ -102,6 +138,15 @@
102138 DHD_BUS_DOWN_IN_PROGRESS, /* Bus going Down */
103139 };
104140
141
+/* The level of bus communication with the dongle */
142
+enum dhd_bus_devreset_type {
143
+ DHD_BUS_DEVRESET_ON = 0, /* ON */
144
+ DHD_BUS_DEVRESET_OFF = 1, /* OFF */
145
+ DHD_BUS_DEVRESET_FLR = 2, /* FLR */
146
+ DHD_BUS_DEVRESET_FLR_FORCE_FAIL = 3, /* FLR FORCE FAIL */
147
+ DHD_BUS_DEVRESET_QUIESCE = 4, /* FLR */
148
+};
149
+
105150 /*
106151 * Bit fields to Indicate clean up process that wait till they are finished.
107152 * Future synchronizable processes can add their bit filed below and update
....@@ -110,23 +155,186 @@
110155 #define DHD_BUS_BUSY_IN_TX 0x01
111156 #define DHD_BUS_BUSY_IN_SEND_PKT 0x02
112157 #define DHD_BUS_BUSY_IN_DPC 0x04
113
-#define DHD_BUS_BUSY_IN_IOVAR 0x08
114
-#define DHD_BUS_BUSY_IN_WD 0x10
115
-#define DHD_BUS_BUSY_IN_SUSPEND 0x20
116
-#define DHD_BUS_BUSY_IN_RESUME 0x40
158
+#define DHD_BUS_BUSY_IN_WD 0x08
159
+#define DHD_BUS_BUSY_IN_IOVAR 0x10
160
+#define DHD_BUS_BUSY_IN_DHD_IOVAR 0x20
161
+#define DHD_BUS_BUSY_SUSPEND_IN_PROGRESS 0x40
162
+#define DHD_BUS_BUSY_RESUME_IN_PROGRESS 0x80
163
+#define DHD_BUS_BUSY_RPM_SUSPEND_IN_PROGRESS 0x100
164
+#define DHD_BUS_BUSY_RPM_SUSPEND_DONE 0x200
165
+#define DHD_BUS_BUSY_RPM_RESUME_IN_PROGRESS 0x400
166
+#define DHD_BUS_BUSY_RPM_ALL (DHD_BUS_BUSY_RPM_SUSPEND_DONE | \
167
+ DHD_BUS_BUSY_RPM_SUSPEND_IN_PROGRESS | \
168
+ DHD_BUS_BUSY_RPM_RESUME_IN_PROGRESS)
169
+#define DHD_BUS_BUSY_IN_CHECKDIED 0x800
170
+#define DHD_BUS_BUSY_IN_MEMDUMP 0x1000
171
+#define DHD_BUS_BUSY_IN_SSSRDUMP 0x2000
172
+#define DHD_BUS_BUSY_IN_LOGDUMP 0x4000
173
+#define DHD_BUS_BUSY_IN_HALDUMP 0x8000
174
+
175
+#define DHD_BUS_BUSY_SET_IN_TX(dhdp) \
176
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_IN_TX
177
+#define DHD_BUS_BUSY_SET_IN_SEND_PKT(dhdp) \
178
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_IN_SEND_PKT
179
+#define DHD_BUS_BUSY_SET_IN_DPC(dhdp) \
180
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_IN_DPC
181
+#define DHD_BUS_BUSY_SET_IN_WD(dhdp) \
182
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_IN_WD
183
+#define DHD_BUS_BUSY_SET_IN_IOVAR(dhdp) \
184
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_IN_IOVAR
185
+#define DHD_BUS_BUSY_SET_IN_DHD_IOVAR(dhdp) \
186
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_IN_DHD_IOVAR
187
+#define DHD_BUS_BUSY_SET_SUSPEND_IN_PROGRESS(dhdp) \
188
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_SUSPEND_IN_PROGRESS
189
+#define DHD_BUS_BUSY_SET_RESUME_IN_PROGRESS(dhdp) \
190
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_RESUME_IN_PROGRESS
191
+#define DHD_BUS_BUSY_SET_RPM_SUSPEND_IN_PROGRESS(dhdp) \
192
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_RPM_SUSPEND_IN_PROGRESS
193
+#define DHD_BUS_BUSY_SET_RPM_SUSPEND_DONE(dhdp) \
194
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_RPM_SUSPEND_DONE
195
+#define DHD_BUS_BUSY_SET_RPM_RESUME_IN_PROGRESS(dhdp) \
196
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_RPM_RESUME_IN_PROGRESS
197
+#define DHD_BUS_BUSY_SET_IN_CHECKDIED(dhdp) \
198
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_IN_CHECKDIED
199
+#define DHD_BUS_BUSY_SET_IN_MEMDUMP(dhdp) \
200
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_IN_MEMDUMP
201
+#define DHD_BUS_BUSY_SET_IN_SSSRDUMP(dhdp) \
202
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_IN_SSSRDUMP
203
+#define DHD_BUS_BUSY_SET_IN_LOGDUMP(dhdp) \
204
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_IN_LOGDUMP
205
+#define DHD_BUS_BUSY_SET_IN_HALDUMP(dhdp) \
206
+ (dhdp)->dhd_bus_busy_state |= DHD_BUS_BUSY_IN_HALDUMP
207
+
208
+#define DHD_BUS_BUSY_CLEAR_IN_TX(dhdp) \
209
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_TX
210
+#define DHD_BUS_BUSY_CLEAR_IN_SEND_PKT(dhdp) \
211
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_SEND_PKT
212
+#define DHD_BUS_BUSY_CLEAR_IN_DPC(dhdp) \
213
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_DPC
214
+#define DHD_BUS_BUSY_CLEAR_IN_WD(dhdp) \
215
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_WD
216
+#define DHD_BUS_BUSY_CLEAR_IN_IOVAR(dhdp) \
217
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_IOVAR
218
+#define DHD_BUS_BUSY_CLEAR_IN_DHD_IOVAR(dhdp) \
219
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_DHD_IOVAR
220
+#define DHD_BUS_BUSY_CLEAR_SUSPEND_IN_PROGRESS(dhdp) \
221
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_SUSPEND_IN_PROGRESS
222
+#define DHD_BUS_BUSY_CLEAR_RESUME_IN_PROGRESS(dhdp) \
223
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_RESUME_IN_PROGRESS
224
+#define DHD_BUS_BUSY_CLEAR_RPM_SUSPEND_IN_PROGRESS(dhdp) \
225
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_RPM_SUSPEND_IN_PROGRESS
226
+#define DHD_BUS_BUSY_CLEAR_RPM_SUSPEND_DONE(dhdp) \
227
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_RPM_SUSPEND_DONE
228
+#define DHD_BUS_BUSY_CLEAR_RPM_RESUME_IN_PROGRESS(dhdp) \
229
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_RPM_RESUME_IN_PROGRESS
230
+#define DHD_BUS_BUSY_CLEAR_IN_CHECKDIED(dhdp) \
231
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_CHECKDIED
232
+#define DHD_BUS_BUSY_CLEAR_IN_MEMDUMP(dhdp) \
233
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_MEMDUMP
234
+#define DHD_BUS_BUSY_CLEAR_IN_SSSRDUMP(dhdp) \
235
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_SSSRDUMP
236
+#define DHD_BUS_BUSY_CLEAR_IN_LOGDUMP(dhdp) \
237
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_LOGDUMP
238
+#define DHD_BUS_BUSY_CLEAR_IN_HALDUMP(dhdp) \
239
+ (dhdp)->dhd_bus_busy_state &= ~DHD_BUS_BUSY_IN_HALDUMP
240
+
241
+#define DHD_BUS_BUSY_CHECK_IN_TX(dhdp) \
242
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_IN_TX)
243
+#define DHD_BUS_BUSY_CHECK_IN_SEND_PKT(dhdp) \
244
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_IN_SEND_PKT)
245
+#define DHD_BUS_BUSY_CHECK_IN_DPC(dhdp) \
246
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_IN_DPC)
247
+#define DHD_BUS_BUSY_CHECK_IN_WD(dhdp) \
248
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_IN_WD)
249
+#define DHD_BUS_BUSY_CHECK_IN_IOVAR(dhdp) \
250
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_IN_IOVAR)
251
+#define DHD_BUS_BUSY_CHECK_IN_DHD_IOVAR(dhdp) \
252
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_IN_DHD_IOVAR)
253
+#define DHD_BUS_BUSY_CHECK_SUSPEND_IN_PROGRESS(dhdp) \
254
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_SUSPEND_IN_PROGRESS)
255
+#define DHD_BUS_BUSY_CHECK_RESUME_IN_PROGRESS(dhdp) \
256
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_RESUME_IN_PROGRESS)
257
+#define DHD_BUS_BUSY_CHECK_RPM_SUSPEND_IN_PROGRESS(dhdp) \
258
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_RPM_SUSPEND_IN_PROGRESS)
259
+#define DHD_BUS_BUSY_CHECK_RPM_SUSPEND_DONE(dhdp) \
260
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_RPM_SUSPEND_DONE)
261
+#define DHD_BUS_BUSY_CHECK_RPM_RESUME_IN_PROGRESS(dhdp) \
262
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_RPM_RESUME_IN_PROGRESS)
263
+#define DHD_BUS_BUSY_CHECK_RPM_ALL(dhdp) \
264
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_RPM_ALL)
265
+#define DHD_BUS_BUSY_CHECK_IN_CHECKDIED(dhdp) \
266
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_IN_CHECKDIED)
267
+#define DHD_BUS_BUSY_CHECK_IN_MEMDUMP(dhdp) \
268
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_IN_MEMDUMP)
269
+#define DHD_BUS_BUSY_CHECK_IN_SSSRDUMP(dhdp) \
270
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_IN_SSSRDUMP)
271
+#define DHD_BUS_BUSY_CHECK_IN_LOGDUMP(dhdp) \
272
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_IN_LOGDUMP)
273
+#define DHD_BUS_BUSY_CHECK_IN_HALDUMP(dhdp) \
274
+ ((dhdp)->dhd_bus_busy_state & DHD_BUS_BUSY_IN_HALDUMP)
275
+#define DHD_BUS_BUSY_CHECK_IDLE(dhdp) \
276
+ ((dhdp)->dhd_bus_busy_state == 0)
277
+
278
+#define DHD_BUS_CHECK_SUSPEND_OR_SUSPEND_IN_PROGRESS(dhdp) \
279
+ ((dhdp)->busstate == DHD_BUS_SUSPEND || DHD_BUS_BUSY_CHECK_SUSPEND_IN_PROGRESS(dhdp))
280
+
281
+#define DHD_BUS_CHECK_ANY_SUSPEND_IN_PROGRESS(dhdp) \
282
+ (DHD_BUS_BUSY_CHECK_SUSPEND_IN_PROGRESS(dhdp) || \
283
+ DHD_BUS_BUSY_CHECK_RPM_SUSPEND_IN_PROGRESS(dhdp))
284
+
285
+#define DHD_BUS_CHECK_SUSPEND_OR_ANY_SUSPEND_IN_PROGRESS(dhdp) \
286
+ ((dhdp)->busstate == DHD_BUS_SUSPEND || DHD_BUS_CHECK_ANY_SUSPEND_IN_PROGRESS(dhdp))
287
+
288
+#define DHD_BUS_CHECK_DOWN_OR_DOWN_IN_PROGRESS(dhdp) \
289
+ ((dhdp)->busstate == DHD_BUS_DOWN || (dhdp)->busstate == DHD_BUS_DOWN_IN_PROGRESS)
290
+
291
+/* IOVar flags for common error checks */
292
+#define DHD_IOVF_PWRREQ_BYPASS (1<<0) /* flags to prevent bp access during host sleep state */
293
+
294
+#define MAX_MTU_SZ (1600u)
295
+
296
+/* (u64)result = (u64)dividend / (u64)divisor */
297
+#define DIV_U64_BY_U64(dividend, divisor) div64_u64(dividend, divisor)
298
+
299
+/* (u64)result = (u64)dividend / (u32)divisor */
300
+#define DIV_U64_BY_U32(dividend, divisor) div_u64(dividend, divisor)
301
+
302
+/* Be careful while using this, as it divides dividend also
303
+ * (u32)remainder = (u64)dividend % (u32)divisor
304
+ * (u64)dividend = (u64)dividend / (u32)divisor
305
+ */
306
+#define DIV_AND_MOD_U64_BY_U32(dividend, divisor) do_div(dividend, divisor)
307
+
308
+/* (u32)remainder = (u64)dividend % (u32)divisor */
309
+#define MOD_U64_BY_U32(dividend, divisor) ({ \
310
+ uint64 temp_dividend = (dividend); \
311
+ uint32 rem = DIV_AND_MOD_U64_BY_U32(temp_dividend, (divisor)); \
312
+ rem; \
313
+})
314
+
315
+#define SEC_USEC_FMT \
316
+ "%5llu.%06u"
317
+
318
+/* t: time in nano second */
319
+#define GET_SEC_USEC(t) \
320
+ DIV_U64_BY_U32(t, NSEC_PER_SEC), \
321
+ ((uint32)(MOD_U64_BY_U32(t, NSEC_PER_SEC) / (uint32)NSEC_PER_USEC))
117322
118323 /* Download Types */
119324 typedef enum download_type {
120325 FW,
121326 NVRAM,
122
- CLM_BLOB
327
+ CLM_BLOB,
328
+ TXCAP_BLOB
123329 } download_type_t;
124330
125
-
126331 /* For supporting multiple interfaces */
127
-#define DHD_MAX_IFS 16
128
-#define DHD_DEL_IF -0xE
129
-#define DHD_BAD_IF -0xF
332
+#define DHD_MAX_IFS 16
333
+#define DHD_MAX_STATIC_IFS 5
334
+#define DHD_DEL_IF -0xE
335
+#define DHD_BAD_IF -0xF
336
+#define DHD_DUMMY_INFO_IF 0xDEAF /* Hack i/f to handle events from INFO Ring */
337
+#define DHD_EVENT_IF DHD_DUMMY_INFO_IF
130338
131339 enum dhd_op_flags {
132340 /* Firmware requested operation mode */
....@@ -135,6 +343,8 @@
135343 DHD_FLAG_P2P_MODE = (1 << (2)), /* P2P Only */
136344 /* STA + P2P */
137345 DHD_FLAG_CONCURR_SINGLE_CHAN_MODE = (DHD_FLAG_STA_MODE | DHD_FLAG_P2P_MODE),
346
+ /* STA + SoftAP */
347
+ DHD_FLAG_CONCURR_STA_HOSTAP_MODE = (DHD_FLAG_STA_MODE | DHD_FLAG_HOSTAP_MODE),
138348 DHD_FLAG_CONCURR_MULTI_CHAN_MODE = (1 << (4)), /* STA + P2P */
139349 /* Current P2P mode for P2P connection */
140350 DHD_FLAG_P2P_GC_MODE = (1 << (5)),
....@@ -148,6 +358,9 @@
148358
149359 #define DHD_OPMODE_SUPPORTED(dhd, opmode_flag) \
150360 (dhd ? ((((dhd_pub_t *)dhd)->op_mode) & opmode_flag) : -1)
361
+#define DHD_OPMODE_STA_SOFTAP_CONCURR(dhd) \
362
+ (dhd ? (((dhd->op_mode) & DHD_FLAG_CONCURR_STA_HOSTAP_MODE) == \
363
+ DHD_FLAG_CONCURR_STA_HOSTAP_MODE) : 0)
151364
152365 /* Max sequential TX/RX Control timeouts to set HANG event */
153366 #ifndef MAX_CNTL_TX_TIMEOUT
....@@ -159,77 +372,20 @@
159372
160373 #define DHD_SCAN_ASSOC_ACTIVE_TIME 40 /* ms: Embedded default Active setting from DHD */
161374 #define DHD_SCAN_UNASSOC_ACTIVE_TIME 80 /* ms: Embedded def. Unassoc Active setting from DHD */
375
+#define DHD_SCAN_HOME_TIME 45 /* ms: Embedded default Home time setting from DHD */
376
+#define DHD_SCAN_HOME_AWAY_TIME 100 /* ms: Embedded default Home Away time setting from DHD */
377
+#ifndef CUSTOM_SCAN_PASSIVE_TIME
162378 #define DHD_SCAN_PASSIVE_TIME 130 /* ms: Embedded default Passive setting from DHD */
379
+#else
380
+#define DHD_SCAN_PASSIVE_TIME CUSTOM_SCAN_PASSIVE_TIME /* ms: Custom Passive setting from DHD */
381
+#endif /* CUSTOM_SCAN_PASSIVE_TIME */
163382
164383 #ifndef POWERUP_MAX_RETRY
165384 #define POWERUP_MAX_RETRY 3 /* how many times we retry to power up the chip */
166
-#endif
385
+#endif // endif
167386 #ifndef POWERUP_WAIT_MS
168387 #define POWERUP_WAIT_MS 2000 /* ms: time out in waiting wifi to come up */
169
-#endif
170
-#define MAX_NVRAMBUF_SIZE (16 * 1024) /* max nvram buf size */
171
-#ifdef DHD_DEBUG
172
-#define DHD_JOIN_MAX_TIME_DEFAULT 10000 /* ms: Max time out for joining AP */
173
-#define DHD_SCAN_DEF_TIMEOUT 10000 /* ms: Max time out for scan in progress */
174
-#endif
175
-
176
-
177
-enum dhd_bus_wake_state {
178
- WAKE_LOCK_OFF,
179
- WAKE_LOCK_PRIV,
180
- WAKE_LOCK_DPC,
181
- WAKE_LOCK_IOCTL,
182
- WAKE_LOCK_DOWNLOAD,
183
- WAKE_LOCK_TMOUT,
184
- WAKE_LOCK_WATCHDOG,
185
- WAKE_LOCK_LINK_DOWN_TMOUT,
186
- WAKE_LOCK_PNO_FIND_TMOUT,
187
- WAKE_LOCK_SOFTAP_SET,
188
- WAKE_LOCK_SOFTAP_STOP,
189
- WAKE_LOCK_SOFTAP_START,
190
- WAKE_LOCK_SOFTAP_THREAD
191
-};
192
-
193
-enum dhd_prealloc_index {
194
- DHD_PREALLOC_PROT = 0,
195
- DHD_PREALLOC_RXBUF,
196
- DHD_PREALLOC_DATABUF,
197
- DHD_PREALLOC_OSL_BUF,
198
-#if defined(STATIC_WL_PRIV_STRUCT)
199
- DHD_PREALLOC_WIPHY_ESCAN0 = 5,
200
-#endif /* STATIC_WL_PRIV_STRUCT */
201
- DHD_PREALLOC_DHD_INFO = 7,
202
- DHD_PREALLOC_DHD_WLFC_INFO = 8,
203
- DHD_PREALLOC_IF_FLOW_LKUP = 9,
204
- /* 10 */
205
- DHD_PREALLOC_MEMDUMP_RAM = 11,
206
- DHD_PREALLOC_DHD_WLFC_HANGER = 12,
207
- DHD_PREALLOC_PKTID_MAP = 13,
208
- DHD_PREALLOC_PKTID_MAP_IOCTL = 14
209
-};
210
-
211
-enum dhd_dongledump_mode {
212
- DUMP_DISABLED = 0,
213
- DUMP_MEMONLY,
214
- DUMP_MEMFILE,
215
- DUMP_MEMFILE_BUGON,
216
- DUMP_MEMFILE_MAX
217
-};
218
-
219
-enum dhd_dongledump_type {
220
- DUMP_TYPE_RESUMED_ON_TIMEOUT = 1,
221
- DUMP_TYPE_D3_ACK_TIMEOUT,
222
- DUMP_TYPE_DONGLE_TRAP,
223
- DUMP_TYPE_MEMORY_CORRUPTION,
224
- DUMP_TYPE_PKTID_AUDIT_FAILURE,
225
- DUMP_TYPE_SCAN_TIMEOUT
226
-};
227
-
228
-/* Packet alignment for most efficient SDIO (can change based on platform) */
229
-#ifndef DHD_SDALIGN
230
-#define DHD_SDALIGN 32
231
-#endif
232
-
388
+#endif // endif
233389 /*
234390 * MAX_NVRAMBUF_SIZE determines the size of the Buffer in the DHD that holds
235391 * the NVRAM data. That is the size of the buffer pointed by bus->vars
....@@ -237,13 +393,193 @@
237393 */
238394 #define MAX_NVRAMBUF_SIZE (16 * 1024) /* max nvram buf size */
239395 #define MAX_CLM_BUF_SIZE (48 * 1024) /* max clm blob size */
396
+#define MAX_TXCAP_BUF_SIZE (16 * 1024) /* max txcap blob size */
397
+#ifdef DHD_DEBUG
398
+#define DHD_JOIN_MAX_TIME_DEFAULT 10000 /* ms: Max time out for joining AP */
399
+#define DHD_SCAN_DEF_TIMEOUT 10000 /* ms: Max time out for scan in progress */
400
+#endif /* DHD_DEBUG */
240401
241402 #ifndef CONFIG_BCMDHD_CLM_PATH
242
-#define CONFIG_BCMDHD_CLM_PATH "/system/etc/wifi/bcmdhd_clm.blob"
403
+#ifdef OEM_ANDROID
404
+#define CONFIG_BCMDHD_CLM_PATH "/vendor/etc/firmware/bcmdhd_clm.blob"
405
+#else
406
+#define CONFIG_BCMDHD_CLM_PATH "/vendor/etc/firmware/bcmdhd_clm.blob"
407
+#endif /* OEM_ANDROID */
243408 #endif /* CONFIG_BCMDHD_CLM_PATH */
244409 #define WL_CCODE_NULL_COUNTRY "#n"
245410
411
+#define FW_VER_STR_LEN 128
412
+#define FWID_STR_LEN 256
413
+#define CLM_VER_STR_LEN 128
414
+#define BUS_API_REV_STR_LEN 128
415
+#define FW_VER_STR "Version"
416
+#define FWID_STR_1 "FWID: 01-"
417
+#define FWID_STR_2 "FWID=01-"
418
+extern char bus_api_revision[];
246419
420
+enum dhd_bus_wake_state {
421
+ WAKE_LOCK_OFF = 0,
422
+ WAKE_LOCK_PRIV = 1,
423
+ WAKE_LOCK_DPC = 2,
424
+ WAKE_LOCK_IOCTL = 3,
425
+ WAKE_LOCK_DOWNLOAD = 4,
426
+ WAKE_LOCK_TMOUT = 5,
427
+ WAKE_LOCK_WATCHDOG = 6,
428
+ WAKE_LOCK_LINK_DOWN_TMOUT = 7,
429
+ WAKE_LOCK_PNO_FIND_TMOUT = 8,
430
+ WAKE_LOCK_SOFTAP_SET = 9,
431
+ WAKE_LOCK_SOFTAP_STOP = 10,
432
+ WAKE_LOCK_SOFTAP_START = 11,
433
+ WAKE_LOCK_SOFTAP_THREAD = 12
434
+};
435
+
436
+enum dhd_prealloc_index {
437
+ DHD_PREALLOC_PROT = 0,
438
+ DHD_PREALLOC_RXBUF = 1,
439
+ DHD_PREALLOC_DATABUF = 2,
440
+ DHD_PREALLOC_OSL_BUF = 3,
441
+ /* 4 */
442
+ DHD_PREALLOC_WIPHY_ESCAN0 = 5,
443
+ DHD_PREALLOC_WIPHY_ESCAN1 = 6,
444
+ DHD_PREALLOC_DHD_INFO = 7,
445
+ DHD_PREALLOC_DHD_WLFC_INFO = 8,
446
+ DHD_PREALLOC_IF_FLOW_LKUP = 9,
447
+ /* 10 */
448
+ DHD_PREALLOC_MEMDUMP_RAM = 11,
449
+ DHD_PREALLOC_DHD_WLFC_HANGER = 12,
450
+ DHD_PREALLOC_PKTID_MAP = 13,
451
+ DHD_PREALLOC_PKTID_MAP_IOCTL = 14,
452
+ DHD_PREALLOC_DHD_LOG_DUMP_BUF = 15,
453
+ DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX = 16,
454
+ DHD_PREALLOC_DHD_PKTLOG_DUMP_BUF = 17
455
+};
456
+
457
+enum dhd_dongledump_mode {
458
+ DUMP_DISABLED = 0,
459
+ DUMP_MEMONLY = 1,
460
+ DUMP_MEMFILE = 2,
461
+ DUMP_MEMFILE_BUGON = 3,
462
+ DUMP_MEMFILE_MAX = 4
463
+};
464
+
465
+enum dhd_dongledump_type {
466
+ DUMP_TYPE_RESUMED_ON_TIMEOUT = 1,
467
+ DUMP_TYPE_D3_ACK_TIMEOUT = 2,
468
+ DUMP_TYPE_DONGLE_TRAP = 3,
469
+ DUMP_TYPE_MEMORY_CORRUPTION = 4,
470
+ DUMP_TYPE_PKTID_AUDIT_FAILURE = 5,
471
+ DUMP_TYPE_PKTID_INVALID = 6,
472
+ DUMP_TYPE_SCAN_TIMEOUT = 7,
473
+ DUMP_TYPE_SCAN_BUSY = 8,
474
+ DUMP_TYPE_BY_SYSDUMP = 9,
475
+ DUMP_TYPE_BY_LIVELOCK = 10,
476
+ DUMP_TYPE_AP_LINKUP_FAILURE = 11,
477
+ DUMP_TYPE_AP_ABNORMAL_ACCESS = 12,
478
+ DUMP_TYPE_CFG_VENDOR_TRIGGERED = 13,
479
+ DUMP_TYPE_RESUMED_ON_TIMEOUT_TX = 14,
480
+ DUMP_TYPE_RESUMED_ON_TIMEOUT_RX = 15,
481
+ DUMP_TYPE_RESUMED_ON_INVALID_RING_RDWR = 16,
482
+ DUMP_TYPE_TRANS_ID_MISMATCH = 17,
483
+ DUMP_TYPE_IFACE_OP_FAILURE = 18,
484
+ DUMP_TYPE_DONGLE_INIT_FAILURE = 19,
485
+ DUMP_TYPE_READ_SHM_FAIL = 20,
486
+ DUMP_TYPE_DONGLE_HOST_EVENT = 21,
487
+ DUMP_TYPE_SMMU_FAULT = 22,
488
+ DUMP_TYPE_RESUMED_UNKNOWN = 23,
489
+ DUMP_TYPE_DUE_TO_BT = 24,
490
+ DUMP_TYPE_LOGSET_BEYOND_RANGE = 25,
491
+ DUMP_TYPE_BY_USER = 26,
492
+ DUMP_TYPE_CTO_RECOVERY = 27,
493
+ DUMP_TYPE_SEQUENTIAL_PRIVCMD_ERROR = 28,
494
+ DUMP_TYPE_PROXD_TIMEOUT = 29,
495
+ DUMP_TYPE_PKTID_POOL_DEPLETED = 30
496
+};
497
+
498
+enum dhd_hang_reason {
499
+ HANG_REASON_MASK = 0x8000,
500
+ HANG_REASON_IOCTL_RESP_TIMEOUT = 0x8001,
501
+ HANG_REASON_DONGLE_TRAP = 0x8002,
502
+ HANG_REASON_D3_ACK_TIMEOUT = 0x8003,
503
+ HANG_REASON_BUS_DOWN = 0x8004,
504
+ HANG_REASON_MSGBUF_LIVELOCK = 0x8006,
505
+ HANG_REASON_IFACE_DEL_FAILURE = 0x8007,
506
+ HANG_REASON_HT_AVAIL_ERROR = 0x8008,
507
+ HANG_REASON_PCIE_RC_LINK_UP_FAIL = 0x8009,
508
+ HANG_REASON_PCIE_PKTID_ERROR = 0x800A,
509
+ HANG_REASON_IFACE_ADD_FAILURE = 0x800B,
510
+ HANG_REASON_IOCTL_RESP_TIMEOUT_SCHED_ERROR = 0x800C,
511
+ HANG_REASON_D3_ACK_TIMEOUT_SCHED_ERROR = 0x800D,
512
+ HANG_REASON_SEQUENTIAL_PRIVCMD_ERROR = 0x800E,
513
+ HANG_REASON_PCIE_LINK_DOWN_RC_DETECT = 0x8805,
514
+ HANG_REASON_INVALID_EVENT_OR_DATA = 0x8806,
515
+ HANG_REASON_UNKNOWN = 0x8807,
516
+ HANG_REASON_PCIE_LINK_DOWN_EP_DETECT = 0x8808,
517
+ HANG_REASON_PCIE_CTO_DETECT = 0x8809,
518
+ HANG_REASON_MAX = 0x880A
519
+};
520
+
521
+#define WLC_E_DEAUTH_MAX_REASON 0x0FFF
522
+
523
+enum dhd_rsdb_scan_features {
524
+ /* Downgraded scan feature for AP active */
525
+ RSDB_SCAN_DOWNGRADED_AP_SCAN = 0x01,
526
+ /* Downgraded scan feature for P2P Discovery */
527
+ RSDB_SCAN_DOWNGRADED_P2P_DISC_SCAN = 0x02,
528
+ /* Enable channel pruning for ROAM SCAN */
529
+ RSDB_SCAN_DOWNGRADED_CH_PRUNE_ROAM = 0x10,
530
+ /* Enable channel pruning for any SCAN */
531
+ RSDB_SCAN_DOWNGRADED_CH_PRUNE_ALL = 0x20
532
+};
533
+
534
+#define VENDOR_SEND_HANG_EXT_INFO_LEN (800 + 1)
535
+
536
+#ifdef DHD_EWPR_VER2
537
+#define VENDOR_SEND_HANG_EXT_INFO_VER 20181111
538
+#else
539
+#define VENDOR_SEND_HANG_EXT_INFO_VER 20170905
540
+#endif // endif
541
+
542
+#define HANG_INFO_TRAP_T_NAME_MAX 6
543
+#define HANG_INFO_TRAP_T_REASON_IDX 0
544
+#define HANG_INFO_TRAP_T_SUBTYPE_IDX 2
545
+#define HANG_INFO_TRAP_T_OFFSET_IDX 3
546
+#define HANG_INFO_TRAP_T_EPC_IDX 4
547
+#define HANG_FIELD_STR_MAX_LEN 9
548
+#define HANG_FIELD_CNT_MAX 69
549
+#define HANG_FIELD_IF_FAILURE_CNT 10
550
+#define HANG_FIELD_IOCTL_RESP_TIMEOUT_CNT 8
551
+#define HANG_FIELD_TRAP_T_STACK_CNT_MAX 16
552
+#define HANG_FIELD_MISMATCH_CNT 10
553
+#define HANG_INFO_BIGDATA_KEY_STACK_CNT 4
554
+
555
+#define DEBUG_DUMP_TIME_BUF_LEN (16 + 1)
556
+/* delimiter between values */
557
+#define HANG_KEY_DEL ' '
558
+#define HANG_RAW_DEL '_'
559
+
560
+#ifdef DHD_EWPR_VER2
561
+#define HANG_INFO_BIGDATA_EXTRA_KEY 4
562
+#define HANG_INFO_TRAP_T_EXTRA_KEY_IDX 5
563
+#endif // endif
564
+
565
+/* Packet alignment for most efficient SDIO (can change based on platform) */
566
+#ifndef DHD_SDALIGN
567
+#if defined(BCMSPI)
568
+#define DHD_SDALIGN 4
569
+#else
570
+#define DHD_SDALIGN 32
571
+#endif /* BCMSPI */
572
+#endif /* !DHD_SDALIGN */
573
+
574
+#define DHD_TX_CONTEXT_MASK 0xff
575
+#define DHD_TX_START_XMIT 0x01
576
+#define DHD_TX_SEND_PKT 0x02
577
+#define DHD_IF_SET_TX_ACTIVE(ifp, context) \
578
+ ifp->tx_paths_active |= context;
579
+#define DHD_IF_CLR_TX_ACTIVE(ifp, context) \
580
+ ifp->tx_paths_active &= ~context;
581
+#define DHD_IF_IS_TX_ACTIVE(ifp) \
582
+ (ifp->tx_paths_active)
247583 /**
248584 * DMA-able buffer parameters
249585 * - dmaaddr_t is 32bits on a 32bit host.
....@@ -270,6 +606,27 @@
270606 uint8 pend_pkts;
271607 } reorder_info_t;
272608
609
+/* throughput test packet format */
610
+typedef struct tput_pkt {
611
+ /* header */
612
+ uint8 mac_sta[ETHER_ADDR_LEN];
613
+ uint8 mac_ap[ETHER_ADDR_LEN];
614
+ uint16 pkt_type;
615
+ uint8 PAD[2];
616
+ /* data */
617
+ uint32 crc32;
618
+ uint32 pkt_id;
619
+ uint32 num_pkts;
620
+} tput_pkt_t;
621
+
622
+typedef enum {
623
+ TPUT_PKT_TYPE_NORMAL,
624
+ TPUT_PKT_TYPE_STOP
625
+} tput_pkt_type_t;
626
+
627
+#define TPUT_TEST_MAX_PAYLOAD 1500
628
+#define TPUT_TEST_WAIT_TIMEOUT_DEFAULT 5000
629
+
273630 #ifdef DHDTCPACK_SUPPRESS
274631
275632 enum {
....@@ -287,28 +644,6 @@
287644 TCPACK_SUP_LAST_MODE
288645 };
289646 #endif /* DHDTCPACK_SUPPRESS */
290
-
291
-#if defined(TRAFFIC_MGMT_DWM)
292
-#define DHD_DWM_TBL_SIZE 57
293
-/* DSCP WMM AC Mapping macros and structures */
294
-#define DHD_TRF_MGMT_DWM_FILTER_BIT 0x8
295
-#define DHD_TRF_MGMT_DWM_PRIO_BITS 0x7
296
-#define DHD_TRF_MGMT_DWM_FAVORED_BIT 0x10
297
-#define DHD_TRF_MGMT_DWM_PRIO(dwm_tbl_entry) ((dwm_tbl_entry) & DHD_TRF_MGMT_DWM_PRIO_BITS)
298
-#define DHD_TRF_MGMT_DWM_IS_FAVORED_SET(dwm_tbl_entry) \
299
- ((dwm_tbl_entry) & DHD_TRF_MGMT_DWM_FAVORED_BIT)
300
-#define DHD_TRF_MGMT_DWM_SET_FAVORED(dwm_tbl_entry) \
301
- ((dwm_tbl_entry) |= DHD_TRF_MGMT_DWM_FAVORED_BIT)
302
-#define DHD_TRF_MGMT_DWM_IS_FILTER_SET(dwm_tbl_entry) \
303
- ((dwm_tbl_entry) & DHD_TRF_MGMT_DWM_FILTER_BIT)
304
-#define DHD_TRF_MGMT_DWM_SET_FILTER(dwm_tbl_entry) \
305
- ((dwm_tbl_entry) |= DHD_TRF_MGMT_DWM_FILTER_BIT)
306
-
307
-typedef struct {
308
- uint8 dhd_dwm_enabled;
309
- uint8 dhd_dwm_tbl[DHD_DWM_TBL_SIZE];
310
-} dhd_trf_mgmt_dwm_tbl_t;
311
-#endif
312647
313648 #define DHD_NULL_CHK_AND_RET(cond) \
314649 if (!cond) { \
....@@ -360,15 +695,6 @@
360695 #define DHD_CUMM_CTR_DECR(clen) \
361696 ASSERT(DHD_CUMM_CTR_PTR(clen) != DHD_CUMM_CTR_PTR(NULL));
362697
363
-/* DMA'ing r/w indices for rings supported */
364
-#ifdef BCM_INDX_TCM /* FW gets r/w indices in TCM */
365
-#define DMA_INDX_ENAB(dma_indxsup) 0
366
-#elif defined BCM_INDX_DMA /* FW gets r/w indices from Host memory */
367
-#define DMA_INDX_ENAB(dma_indxsup) 1
368
-#else /* r/w indices in TCM or host memory based on FW/Host agreement */
369
-#define DMA_INDX_ENAB(dma_indxsup) dma_indxsup
370
-#endif /* BCM_INDX_TCM */
371
-
372698 #if defined(WLTDLS) && defined(PCIE_FULL_DONGLE)
373699 struct tdls_peer_node {
374700 uint8 addr[ETHER_ADDR_LEN];
....@@ -381,7 +707,235 @@
381707 } tdls_peer_tbl_t;
382708 #endif /* defined(WLTDLS) && defined(PCIE_FULL_DONGLE) */
383709
384
-/* Common structure for module and instance linkage */
710
+#ifdef DHD_LOG_DUMP
711
+#define DUMP_SSSR_ATTR_START 2
712
+#define DUMP_SSSR_ATTR_COUNT 6
713
+
714
+typedef enum {
715
+ SSSR_C0_D11_BEFORE = 0,
716
+ SSSR_C0_D11_AFTER = 1,
717
+ SSSR_C1_D11_BEFORE = 2,
718
+ SSSR_C1_D11_AFTER = 3,
719
+ SSSR_DIG_BEFORE = 4,
720
+ SSSR_DIG_AFTER = 5
721
+} EWP_SSSR_DUMP;
722
+
723
+typedef enum {
724
+ DLD_BUF_TYPE_GENERAL = 0,
725
+ DLD_BUF_TYPE_PRESERVE = 1,
726
+ DLD_BUF_TYPE_SPECIAL = 2,
727
+ DLD_BUF_TYPE_ECNTRS = 3,
728
+ DLD_BUF_TYPE_FILTER = 4,
729
+ DLD_BUF_TYPE_ALL = 5
730
+} log_dump_type_t;
731
+
732
+#define LOG_DUMP_MAGIC 0xDEB3DEB3
733
+#define HEALTH_CHK_BUF_SIZE 256
734
+
735
+#ifdef EWP_ECNTRS_LOGGING
736
+#define ECNTR_RING_ID 0xECDB
737
+#define ECNTR_RING_NAME "ewp_ecntr_ring"
738
+#endif /* EWP_ECNTRS_LOGGING */
739
+
740
+#ifdef EWP_RTT_LOGGING
741
+#define RTT_RING_ID 0xADCD
742
+#define RTT_RING_NAME "ewp_rtt_ring"
743
+#endif /* EWP_ECNTRS_LOGGING */
744
+
745
+#if defined(DEBUGABILITY) && defined(EWP_ECNTRS_LOGGING)
746
+#error "Duplicate rings will be created since both the features are enabled"
747
+#endif /* DEBUGABILITY && EWP_ECNTRS_LOGGING */
748
+
749
+typedef enum {
750
+ LOG_DUMP_SECTION_GENERAL = 0,
751
+ LOG_DUMP_SECTION_ECNTRS,
752
+ LOG_DUMP_SECTION_SPECIAL,
753
+ LOG_DUMP_SECTION_DHD_DUMP,
754
+ LOG_DUMP_SECTION_EXT_TRAP,
755
+ LOG_DUMP_SECTION_HEALTH_CHK,
756
+ LOG_DUMP_SECTION_PRESERVE,
757
+ LOG_DUMP_SECTION_COOKIE,
758
+ LOG_DUMP_SECTION_FLOWRING,
759
+ LOG_DUMP_SECTION_STATUS,
760
+ LOG_DUMP_SECTION_RTT
761
+} log_dump_section_type_t;
762
+
763
+/* Each section in the debug_dump log file shall begin with a header */
764
+typedef struct {
765
+ uint32 magic; /* 0xDEB3DEB3 */
766
+ uint32 type; /* of type log_dump_section_type_t */
767
+ uint64 timestamp;
768
+ uint32 length; /* length of the section that follows */
769
+ uint32 pad;
770
+} log_dump_section_hdr_t;
771
+
772
+/* below structure describe ring buffer. */
773
+struct dhd_log_dump_buf
774
+{
775
+ spinlock_t lock;
776
+ void *dhd_pub;
777
+ unsigned int enable;
778
+ unsigned int wraparound;
779
+ unsigned long max;
780
+ unsigned int remain;
781
+ char* present;
782
+ char* front;
783
+ char* buffer;
784
+};
785
+
786
+#define DHD_LOG_DUMP_MAX_TEMP_BUFFER_SIZE 256
787
+#define DHD_LOG_DUMP_MAX_TAIL_FLUSH_SIZE (80 * 1024)
788
+
789
+extern void dhd_log_dump_write(int type, char *binary_data,
790
+ int binary_len, const char *fmt, ...);
791
+#endif /* DHD_LOG_DUMP */
792
+
793
+/* DEBUG_DUMP SUB COMMAND */
794
+enum {
795
+ CMD_DEFAULT,
796
+ CMD_UNWANTED,
797
+ CMD_DISCONNECTED,
798
+ CMD_MAX
799
+};
800
+
801
+#define DHD_LOG_DUMP_TS_MULTIPLIER_VALUE 60
802
+#define DHD_LOG_DUMP_TS_FMT_YYMMDDHHMMSSMSMS "%02d%02d%02d%02d%02d%02d%04d"
803
+#define DHD_DEBUG_DUMP_TYPE "debug_dump_FORUSER"
804
+#define DHD_DUMP_SUBSTR_UNWANTED "_unwanted"
805
+#define DHD_DUMP_SUBSTR_DISCONNECTED "_disconnected"
806
+
807
+#ifdef DNGL_AXI_ERROR_LOGGING
808
+#define DHD_DUMP_AXI_ERROR_FILENAME "axi_error"
809
+#define DHD_DUMP_HAL_FILENAME_SUFFIX "_hal"
810
+#endif /* DNGL_AXI_ERROR_LOGGING */
811
+
812
+extern void get_debug_dump_time(char *str);
813
+extern void clear_debug_dump_time(char *str);
814
+#if defined(WL_CFGVENDOR_SEND_HANG_EVENT) || defined(DHD_PKT_LOGGING)
815
+extern void copy_debug_dump_time(char *dest, char *src);
816
+#endif /* WL_CFGVENDOR_SEND_HANG_EVENT || DHD_PKT_LOGGING */
817
+
818
+#define FW_LOGSET_MASK_ALL 0xFF
819
+
820
+#ifdef WL_MONITOR
821
+#define MONPKT_EXTRA_LEN 48u
822
+#endif /* WL_MONITOR */
823
+
824
+#define DHDIF_FWDER(dhdif) FALSE
825
+
826
+#if defined(CUSTOMER_HW2) || defined(BOARD_HIKEY)
827
+#define DHD_COMMON_DUMP_PATH "/data/misc/wifi/"
828
+#elif defined(OEM_ANDROID) && (defined(BOARD_PANDA) || defined(__ARM_ARCH_7A__))
829
+#define DHD_COMMON_DUMP_PATH "/data/vendor/wifi/"
830
+#elif defined(OEM_ANDROID) /* For Brix Live Image */
831
+#define DHD_COMMON_DUMP_PATH "/installmedia/"
832
+#else /* Default */
833
+#define DHD_COMMON_DUMP_PATH "/root/"
834
+#endif // endif
835
+
836
+struct cntry_locales_custom {
837
+ char iso_abbrev[WLC_CNTRY_BUF_SZ]; /* ISO 3166-1 country abbreviation */
838
+ char custom_locale[WLC_CNTRY_BUF_SZ]; /* Custom firmware locale */
839
+ int32 custom_locale_rev; /* Custom local revisin default -1 */
840
+};
841
+
842
+int dhd_send_msg_to_daemon(struct sk_buff *skb, void *data, int size);
843
+
844
+#ifdef DMAMAP_STATS
845
+typedef struct dmamap_stats {
846
+ uint64 txdata;
847
+ uint64 txdata_sz;
848
+ uint64 rxdata;
849
+ uint64 rxdata_sz;
850
+ uint64 ioctl_rx;
851
+ uint64 ioctl_rx_sz;
852
+ uint64 event_rx;
853
+ uint64 event_rx_sz;
854
+ uint64 info_rx;
855
+ uint64 info_rx_sz;
856
+ uint64 tsbuf_rx;
857
+ uint64 tsbuf_rx_sz;
858
+} dma_stats_t;
859
+#endif /* DMAMAP_STATS */
860
+
861
+/* see wlfc_proto.h for tx status details */
862
+#define DHD_MAX_TX_STATUS_MSGS 9u
863
+
864
+#ifdef TX_STATUS_LATENCY_STATS
865
+typedef struct dhd_if_tx_status_latency {
866
+ /* total number of tx_status received on this interface */
867
+ uint64 num_tx_status;
868
+ /* cumulative tx_status latency for this interface */
869
+ uint64 cum_tx_status_latency;
870
+} dhd_if_tx_status_latency_t;
871
+#endif /* TX_STATUS_LATENCY_STATS */
872
+
873
+#if defined(SHOW_LOGTRACE) && defined(DHD_USE_KTHREAD_FOR_LOGTRACE)
874
+/* Timestamps to trace dhd_logtrace_thread() */
875
+struct dhd_logtrace_thr_ts {
876
+ uint64 entry_time;
877
+ uint64 sem_down_time;
878
+ uint64 flush_time;
879
+ uint64 unexpected_break_time;
880
+ uint64 complete_time;
881
+};
882
+#endif /* SHOW_LOGTRACE && DHD_USE_KTHREAD_FOR_LOGTRACE */
883
+
884
+/* Enable Reserve STA flowrings only for Android */
885
+#if defined(OEM_ANDROID)
886
+#define DHD_LIMIT_MULTI_CLIENT_FLOWRINGS
887
+#endif /* OEM_ANDROID */
888
+
889
+typedef enum dhd_induce_error_states
890
+{
891
+ DHD_INDUCE_ERROR_CLEAR = 0x0,
892
+ DHD_INDUCE_IOCTL_TIMEOUT = 0x1,
893
+ DHD_INDUCE_D3_ACK_TIMEOUT = 0x2,
894
+ DHD_INDUCE_LIVELOCK = 0x3,
895
+ DHD_INDUCE_DROP_OOB_IRQ = 0x4,
896
+ DHD_INDUCE_DROP_AXI_SIG = 0x5,
897
+ DHD_INDUCE_ERROR_MAX = 0x6
898
+} dhd_induce_error_states_t;
899
+
900
+#ifdef DHD_HP2P
901
+#define MAX_TX_HIST_BIN 16
902
+#define MAX_RX_HIST_BIN 10
903
+#define MAX_HP2P_FLOWS 16
904
+#define HP2P_PRIO 7
905
+#define HP2P_PKT_THRESH 48
906
+#define HP2P_TIME_THRESH 200
907
+#define HP2P_PKT_EXPIRY 40
908
+#define HP2P_TIME_SCALE 32
909
+
910
+typedef struct hp2p_info {
911
+ void *dhd_pub;
912
+ uint16 flowid;
913
+ bool hrtimer_init;
914
+ void *ring;
915
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(5, 1, 21))
916
+ struct tasklet_hrtimer timer;
917
+#else
918
+ struct hrtimer timer;
919
+#endif /* (LINUX_VERSION_CODE <= KERNEL_VERSION(5, 1, 21) */
920
+ uint64 num_pkt_limit;
921
+ uint64 num_timer_limit;
922
+ uint64 num_timer_start;
923
+ uint64 tx_t0[MAX_TX_HIST_BIN];
924
+ uint64 tx_t1[MAX_TX_HIST_BIN];
925
+ uint64 rx_t0[MAX_RX_HIST_BIN];
926
+} hp2p_info_t;
927
+#endif /* DHD_HP2P */
928
+
929
+typedef enum {
930
+ FW_UNLOADED = 0,
931
+ FW_DOWNLOAD_IN_PROGRESS = 1,
932
+ FW_DOWNLOAD_DONE = 2
933
+} fw_download_status_t;
934
+
935
+/**
936
+ * Common structure for module and instance linkage.
937
+ * Instantiated once per hardware (dongle) instance that this DHD manages.
938
+ */
385939 typedef struct dhd_pub {
386940 /* Linkage ponters */
387941 osl_t *osh; /* OSL handle */
....@@ -389,20 +943,19 @@
389943 struct dhd_prot *prot; /* Protocol module handle */
390944 struct dhd_info *info; /* Info module handle */
391945 struct dhd_dbg *dbg; /* Debugability module handle */
946
+#if defined(SHOW_LOGTRACE) && defined(DHD_USE_KTHREAD_FOR_LOGTRACE)
947
+ struct dhd_logtrace_thr_ts logtrace_thr_ts;
948
+#endif /* SHOW_LOGTRACE && DHD_USE_KTHREAD_FOR_LOGTRACE */
392949
393950 /* to NDIS developer, the structure dhd_common is redundant,
394951 * please do NOT merge it back from other branches !!!
395952 */
396953
397
-#ifdef BCMDBUS
398
- struct dbus_pub *dbus;
399
-#endif
400
-
401954 /* Internal dhd items */
402955 bool up; /* Driver up/down (to OS) */
403956 #ifdef WL_CFG80211
404957 spinlock_t up_lock; /* Synchronization with CFG80211 down */
405
-#endif
958
+#endif /* WL_CFG80211 */
406959 bool txoff; /* Transmit flow-controlled */
407960 bool dongle_reset; /* TRUE = DEVRESET put dongle into reset */
408961 enum dhd_bus_state busstate;
....@@ -411,7 +964,11 @@
411964 uint maxctl; /* Max size rxctl request from proto to bus */
412965 uint rxsz; /* Rx buffer size bus module should use */
413966 uint8 wme_dp; /* wme discard priority */
414
-
967
+#ifdef DNGL_AXI_ERROR_LOGGING
968
+ uint32 axierror_logbuf_addr;
969
+ bool axi_error;
970
+ struct dhd_axi_error_dump *axi_err_dump;
971
+#endif /* DNGL_AXI_ERROR_LOGGING */
415972 /* Dongle media info */
416973 bool iswl; /* Dongle-resident driver is wl */
417974 ulong drv_version; /* Version of dongle-resident driver */
....@@ -438,6 +995,11 @@
438995 ulong rx_readahead_cnt; /* Number of packets where header read-ahead was used. */
439996 ulong tx_realloc; /* Number of tx packets we had to realloc for headroom */
440997 ulong fc_packets; /* Number of flow control pkts recvd */
998
+ ulong tx_big_packets; /* Dropped data packets that are larger than MAX_MTU_SZ */
999
+#ifdef DMAMAP_STATS
1000
+ /* DMA Mapping statistics */
1001
+ dma_stats_t dma_stats;
1002
+#endif /* DMAMAP_STATS */
4411003
4421004 /* Last error return */
4431005 int bcmerror;
....@@ -462,16 +1024,19 @@
4621024 #ifdef PKT_FILTER_SUPPORT
4631025 int early_suspended; /* Early suspend status */
4641026 int dhcp_in_progress; /* DHCP period */
465
-#endif
1027
+#endif // endif
4661028
4671029 /* Pkt filter defination */
4681030 char * pktfilter[100];
4691031 int pktfilter_count;
4701032
4711033 wl_country_t dhd_cspec; /* Current Locale info */
472
-#if defined(CUSTOM_COUNTRY_CODE) || defined(CUSTOM_FORCE_NODFS_FLAG)
473
- u32 dhd_cflags;
474
-#endif /* CUSTOM_COUNTRY_CODE || CUSTOM_FORCE_NODFS_FLAG */
1034
+#ifdef CUSTOM_COUNTRY_CODE
1035
+ uint dhd_cflags;
1036
+#endif /* CUSTOM_COUNTRY_CODE */
1037
+#if defined(DHD_BLOB_EXISTENCE_CHECK)
1038
+ bool is_blob; /* Checking for existance of Blob file */
1039
+#endif /* DHD_BLOB_EXISTENCE_CHECK */
4751040 bool force_country_change;
4761041 char eventmask[WL_EVENTING_MASK_LEN];
4771042 int op_mode; /* STA, HostAPD, WFD, SoftAP */
....@@ -482,10 +1047,10 @@
4821047 */
4831048 /* #define WL_ENABLE_P2P_IF 1 */
4841049
485
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
486
- struct mutex wl_start_stop_lock; /* lock/unlock for Android start/stop */
487
- struct mutex wl_softap_lock; /* lock/unlock for any SoftAP/STA settings */
488
-#endif
1050
+#if defined(OEM_ANDROID)
1051
+ struct mutex wl_start_stop_lock; /* lock/unlock for Android start/stop */
1052
+ struct mutex wl_softap_lock; /* lock/unlock for any SoftAP/STA settings */
1053
+#endif /* defined(OEM_ANDROID) */
4891054
4901055 #ifdef PROP_TXSTATUS
4911056 bool wlfc_enabled;
....@@ -507,13 +1072,13 @@
5071072
5081073 bool wlfc_rxpkt_chk;
5091074 #ifdef LIMIT_BORROW
510
- bool wlfc_borrow_allowed;
1075
+ bool wlfc_borrow_allowed;
5111076 #endif /* LIMIT_BORROW */
5121077 /*
5131078 * implement below functions in each platform if needed.
5141079 */
5151080 /* platform specific function whether to skip flow control */
516
- bool (*skip_fc)(void);
1081
+ bool (*skip_fc)(void * dhdp, uint8 ifx);
5171082 /* platform specific function for wlfc_enable and wlfc_deinit */
5181083 void (*plat_init)(void *dhd);
5191084 void (*plat_deinit)(void *dhd);
....@@ -525,27 +1090,59 @@
5251090 #endif /* PROP_TXSTATUS */
5261091 #ifdef PNO_SUPPORT
5271092 void *pno_state;
528
-#endif
1093
+#endif // endif
5291094 #ifdef RTT_SUPPORT
5301095 void *rtt_state;
531
-#endif
1096
+#endif // endif
1097
+#ifdef ROAM_AP_ENV_DETECTION
1098
+ bool roam_env_detection;
1099
+#endif // endif
5321100 bool dongle_isolation;
1101
+ bool is_pcie_watchdog_reset;
1102
+
1103
+/* Begin - Variables to track Bus Errors */
5331104 bool dongle_trap_occured; /* flag for sending HANG event to upper layer */
1105
+ bool iovar_timeout_occured; /* flag to indicate iovar resumed on timeout */
1106
+ bool is_sched_error; /* flag to indicate timeout due to scheduling issue */
1107
+#ifdef PCIE_FULL_DONGLE
1108
+ bool d3ack_timeout_occured; /* flag to indicate d3ack resumed on timeout */
1109
+ bool livelock_occured; /* flag to indicate livelock occured */
1110
+ bool pktid_audit_failed; /* flag to indicate pktid audit failure */
1111
+#endif /* PCIE_FULL_DONGLE */
1112
+ bool iface_op_failed; /* flag to indicate interface operation failed */
1113
+ bool scan_timeout_occurred; /* flag to indicate scan has timedout */
1114
+ bool scan_busy_occurred; /* flag to indicate scan busy occurred */
1115
+#ifdef BT_OVER_SDIO
1116
+ bool is_bt_recovery_required;
1117
+#endif // endif
1118
+ bool smmu_fault_occurred; /* flag to indicate SMMU Fault */
1119
+ /*
1120
+ * Add any new variables to track Bus errors above
1121
+ * this line. Also ensure that the variable is
1122
+ * cleared from dhd_clear_bus_errors
1123
+ */
1124
+/* End - Variables to track Bus Errors */
1125
+
5341126 int hang_was_sent;
1127
+ int hang_was_pending;
5351128 int rxcnt_timeout; /* counter rxcnt timeout to send HANG */
5361129 int txcnt_timeout; /* counter txcnt timeout to send HANG */
5371130 #ifdef BCMPCIE
5381131 int d3ackcnt_timeout; /* counter d3ack timeout to send HANG */
5391132 #endif /* BCMPCIE */
5401133 bool hang_report; /* enable hang report by default */
541
-#ifdef WLMEDIA_HTSF
542
- uint8 htsfdlystat_sz; /* Size of delay stats, max 255B */
543
-#endif
1134
+ uint16 hang_reason; /* reason codes for HANG event */
1135
+#if defined(DHD_HANG_SEND_UP_TEST)
1136
+ uint req_hang_type;
1137
+#endif /* DHD_HANG_SEND_UP_TEST */
1138
+#if defined(CONFIG_BCM_DETECT_CONSECUTIVE_HANG)
1139
+ uint hang_counts;
1140
+#endif /* CONFIG_BCM_DETECT_CONSECUTIVE_HANG */
5441141 #ifdef WLTDLS
5451142 bool tdls_enable;
546
-#endif
1143
+#endif // endif
5471144 struct reorder_info *reorder_bufs[WLHOST_REORDERDATA_MAXFLOWS];
548
- #define WLC_IOCTL_MAXBUF_FWCAP 512
1145
+ #define WLC_IOCTL_MAXBUF_FWCAP 1024
5491146 char fw_capabilities[WLC_IOCTL_MAXBUF_FWCAP];
5501147 #define MAXSKBPEND 1024
5511148 void *skbbuf[MAXSKBPEND];
....@@ -559,13 +1156,18 @@
5591156 #endif /* DHDTCPACK_SUPPRESS */
5601157 #if defined(ARP_OFFLOAD_SUPPORT)
5611158 uint32 arp_version;
562
-#endif
1159
+#endif // endif
1160
+#if defined(BCMSUP_4WAY_HANDSHAKE)
1161
+ bool fw_4way_handshake; /* Whether firmware will to do the 4way handshake. */
1162
+#endif // endif
1163
+#ifdef DEBUG_DPC_THREAD_WATCHDOG
1164
+ bool dhd_bug_on;
1165
+#endif /* DEBUG_DPC_THREAD_WATCHDOG */
5631166 #ifdef CUSTOM_SET_CPUCORE
5641167 struct task_struct * current_dpc;
5651168 struct task_struct * current_rxf;
5661169 int chan_isvht80;
5671170 #endif /* CUSTOM_SET_CPUCORE */
568
-
5691171
5701172 void *sta_pool; /* pre-allocated pool of sta objects */
5711173 void *staid_allocator; /* allocator of sta indexes */
....@@ -577,6 +1179,8 @@
5771179 void *if_flow_lkup; /* per interface flowid lkup hash table */
5781180 void *flowid_lock; /* per os lock for flowid info protection */
5791181 void *flowring_list_lock; /* per os lock for flowring list protection */
1182
+ uint8 max_multi_client_flow_rings;
1183
+ uint8 multi_client_flow_rings;
5801184 uint32 num_flow_rings;
5811185 cumm_ctr_t cumm_ctr; /* cumm queue length placeholder */
5821186 cumm_ctr_t l2cumm_ctr; /* level 2 cumm queue length placeholder */
....@@ -586,27 +1190,50 @@
5861190 char enable_log[MAX_EVENT];
5871191 bool dma_d2h_ring_upd_support;
5881192 bool dma_h2d_ring_upd_support;
1193
+ bool dma_ring_upd_overwrite; /* host overwrites support setting */
5891194
590
-#ifdef DHD_WMF
591
- bool wmf_ucast_igmp;
592
-#ifdef DHD_IGMP_UCQUERY
593
- bool wmf_ucast_igmp_query;
594
-#endif
595
-#ifdef DHD_UCAST_UPNP
596
- bool wmf_ucast_upnp;
597
-#endif
598
-#endif /* DHD_WMF */
599
-#if defined(TRAFFIC_MGMT_DWM)
600
- dhd_trf_mgmt_dwm_tbl_t dhd_tm_dwm_tbl;
601
-#endif
1195
+ bool hwa_enable;
1196
+ uint hwa_inited;
1197
+
1198
+ bool idma_enable;
1199
+ uint idma_inited;
1200
+
1201
+ bool ifrm_enable; /* implicit frm enable */
1202
+ uint ifrm_inited; /* implicit frm init */
1203
+
1204
+ bool dar_enable; /* use DAR registers */
1205
+ uint dar_inited;
1206
+
1207
+ bool fast_delete_ring_support; /* fast delete ring supported */
1208
+
6021209 #ifdef DHD_L2_FILTER
6031210 unsigned long l2_filter_cnt; /* for L2_FILTER ARP table timeout */
6041211 #endif /* DHD_L2_FILTER */
1212
+#ifdef DHD_SSSR_DUMP
1213
+ bool sssr_inited;
1214
+ bool sssr_dump_collected; /* Flag to indicate sssr dump is collected */
1215
+ sssr_reg_info_v1_t sssr_reg_info;
1216
+ uint8 *sssr_mempool;
1217
+ uint *sssr_d11_before[MAX_NUM_D11CORES];
1218
+ uint *sssr_d11_after[MAX_NUM_D11CORES];
1219
+ bool sssr_d11_outofreset[MAX_NUM_D11CORES];
1220
+ uint *sssr_dig_buf_before;
1221
+ uint *sssr_dig_buf_after;
1222
+ uint32 sssr_dump_mode;
1223
+ bool collect_sssr; /* Flag to indicate SSSR dump is required */
1224
+#endif /* DHD_SSSR_DUMP */
6051225 uint8 *soc_ram;
6061226 uint32 soc_ram_length;
6071227 uint32 memdump_type;
1228
+#ifdef DHD_RND_DEBUG
1229
+ uint8 *rnd_buf;
1230
+ uint32 rnd_len;
1231
+#endif /* DHD_RND_DEBUG */
6081232 #ifdef DHD_FW_COREDUMP
6091233 uint32 memdump_enabled;
1234
+#ifdef DHD_DEBUG_UART
1235
+ bool memdump_success;
1236
+#endif /* DHD_DEBUG_UART */
6101237 #endif /* DHD_FW_COREDUMP */
6111238 #ifdef PCIE_FULL_DONGLE
6121239 #ifdef WLTDLS
....@@ -616,39 +1243,226 @@
6161243 #endif /* PCIE_FULL_DONGLE */
6171244 #ifdef DHD_ULP
6181245 void *dhd_ulp;
619
-#endif
620
-#ifdef CACHE_FW_IMAGES
621
- char *cached_fw;
622
- int cached_fw_length;
623
- char *cached_nvram;
624
- int cached_nvram_length;
625
-#endif
1246
+#endif // endif
6261247 #ifdef WLTDLS
6271248 uint32 tdls_mode;
628
-#endif
629
-#ifdef DHD_LOSSLESS_ROAMING
630
- uint8 dequeue_prec_map;
631
-#endif
1249
+#endif // endif
6321250 #ifdef GSCAN_SUPPORT
6331251 bool lazy_roam_enable;
634
-#endif
635
- uint8 rand_mac_oui[DOT11_OUI_LEN];
1252
+#endif // endif
1253
+#if defined(PKT_FILTER_SUPPORT) && defined(APF)
1254
+ bool apf_set;
1255
+#endif /* PKT_FILTER_SUPPORT && APF */
6361256 void *macdbg_info;
6371257 #ifdef DHD_WET
6381258 void *wet_info;
639
-#endif
1259
+#endif // endif
1260
+ bool h2d_phase_supported;
1261
+ bool force_dongletrap_on_bad_h2d_phase;
1262
+ uint32 dongle_trap_data;
1263
+ fw_download_status_t fw_download_status;
1264
+ trap_t last_trap_info; /* trap info from the last trap */
1265
+ uint8 rand_mac_oui[DOT11_OUI_LEN];
1266
+#ifdef DHD_LOSSLESS_ROAMING
1267
+ uint8 dequeue_prec_map;
1268
+ uint8 prio_8021x;
1269
+#endif // endif
1270
+#ifdef WL_NATOE
1271
+ struct dhd_nfct_info *nfct;
1272
+ spinlock_t nfct_lock;
1273
+#endif /* WL_NATOE */
1274
+ /* timesync link */
1275
+ struct dhd_ts *ts;
1276
+ bool d2h_hostrdy_supported;
1277
+#ifdef DHD_PCIE_NATIVE_RUNTIMEPM
1278
+ atomic_t block_bus;
1279
+#endif /* DHD_PCIE_NATIVE_RUNTIMEPM */
1280
+#if defined(DBG_PKT_MON) || defined(DHD_PKT_LOGGING)
1281
+ bool d11_tx_status;
1282
+#endif /* DBG_PKT_MON || DHD_PKT_LOGGING */
1283
+ uint16 ndo_version; /* ND offload version supported */
1284
+#ifdef NDO_CONFIG_SUPPORT
1285
+ bool ndo_enable; /* ND offload feature enable */
1286
+ bool ndo_host_ip_overflow; /* # of host ip addr exceed FW capacity */
1287
+ uint32 ndo_max_host_ip; /* # of host ip addr supported by FW */
1288
+#endif /* NDO_CONFIG_SUPPORT */
1289
+#if defined(DHD_LOG_DUMP)
1290
+ /* buffer to hold 'dhd dump' data before dumping to file */
1291
+ uint8 *concise_dbg_buf;
1292
+ uint64 last_file_posn;
1293
+ int logdump_periodic_flush;
1294
+ /* ecounter debug ring */
1295
+#ifdef EWP_ECNTRS_LOGGING
1296
+ void *ecntr_dbg_ring;
1297
+#endif // endif
1298
+#ifdef EWP_RTT_LOGGING
1299
+ void *rtt_dbg_ring;
1300
+#endif // endif
1301
+#ifdef DNGL_EVENT_SUPPORT
1302
+ uint8 health_chk_event_data[HEALTH_CHK_BUF_SIZE];
1303
+#endif // endif
1304
+ void *logdump_cookie;
1305
+#endif /* DHD_LOG_DUMP */
1306
+ uint32 dhd_console_ms; /** interval for polling the dongle for console (log) messages */
1307
+ bool ext_trap_data_supported;
1308
+ uint32 *extended_trap_data;
1309
+#ifdef DUMP_IOCTL_IOV_LIST
1310
+ /* dump iovar list */
1311
+ dll_t dump_iovlist_head;
1312
+ uint8 dump_iovlist_len;
1313
+#endif /* DUMP_IOCTL_IOV_LIST */
1314
+#ifdef CUSTOM_SET_ANTNPM
1315
+ uint32 mimo_ant_set;
1316
+#endif /* CUSTOM_SET_ANTNPM */
1317
+#ifdef CUSTOM_SET_OCLOFF
1318
+ bool ocl_off;
1319
+#endif /* CUSTOM_SET_OCLOFF */
1320
+#ifdef DHD_DEBUG
1321
+ /* memwaste feature */
1322
+ dll_t mw_list_head; /* memwaste list head */
1323
+ uint32 mw_id; /* memwaste list unique id */
1324
+#endif /* DHD_DEBUG */
1325
+#ifdef WLTDLS
1326
+ spinlock_t tdls_lock;
1327
+#endif /* WLTDLS */
1328
+ uint pcie_txs_metadata_enable;
1329
+ uint wbtext_policy; /* wbtext policy of dongle */
1330
+ bool wbtext_support; /* for product policy only */
1331
+ bool max_dtim_enable; /* use MAX bcn_li_dtim value in suspend mode */
1332
+ tput_test_t tput_data;
1333
+ uint64 tput_start_ts;
1334
+ uint64 tput_stop_ts;
1335
+#ifdef WL_MONITOR
1336
+ bool monitor_enable;
1337
+#endif // endif
1338
+#ifdef DHD_PKT_LOGGING
1339
+ struct dhd_pktlog *pktlog;
1340
+ char debug_dump_time_pktlog_str[DEBUG_DUMP_TIME_BUF_LEN];
1341
+#endif /* DHD_PKT_LOGGING */
1342
+ uint dhd_watchdog_ms_backup;
1343
+ void *event_log_filter;
1344
+#ifdef WL_CFGVENDOR_SEND_HANG_EVENT
1345
+ char *hang_info;
1346
+ int hang_info_cnt;
1347
+ char debug_dump_time_hang_str[DEBUG_DUMP_TIME_BUF_LEN];
1348
+#endif /* WL_CFGVENDOR_SEND_HANG_EVENT */
1349
+ char debug_dump_time_str[DEBUG_DUMP_TIME_BUF_LEN];
1350
+ uint32 logset_prsrv_mask;
1351
+ bool wl_event_enabled;
1352
+ bool logtrace_pkt_sendup;
1353
+#ifdef DHD_DUMP_MNGR
1354
+ struct _dhd_dump_file_manage *dump_file_manage;
1355
+#endif /* DHD_DUMP_MNGR */
1356
+ int debug_dump_subcmd;
1357
+ uint64 debug_dump_time_sec;
1358
+ bool hscb_enable;
1359
+ wait_queue_head_t tx_completion_wait;
1360
+ uint32 batch_tx_pkts_cmpl;
1361
+ uint32 batch_tx_num_pkts;
1362
+#ifdef DHD_ERPOM
1363
+ bool enable_erpom;
1364
+ pom_func_handler_t pom_wlan_handler;
1365
+ int (*pom_func_register)(pom_func_handler_t *func);
1366
+ int (*pom_func_deregister)(pom_func_handler_t *func);
1367
+ int (*pom_toggle_reg_on)(uchar func_id, uchar reason);
1368
+#endif /* DHD_ERPOM */
1369
+#ifdef EWP_EDL
1370
+ bool dongle_edl_support;
1371
+ dhd_dma_buf_t edl_ring_mem;
1372
+#endif /* EWP_EDL */
1373
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
1374
+ struct mutex ndev_op_sync;
1375
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) */
1376
+
1377
+ bool debug_buf_dest_support;
1378
+ uint32 debug_buf_dest_stat[DEBUG_BUF_DEST_MAX];
1379
+#if defined(DHD_H2D_LOG_TIME_SYNC)
1380
+#define DHD_H2D_LOG_TIME_STAMP_MATCH (10000) /* 10 Seconds */
1381
+ /*
1382
+ * Interval for updating the dongle console message time stamp with the Host (DHD)
1383
+ * time stamp
1384
+ */
1385
+ uint32 dhd_rte_time_sync_ms;
1386
+#endif /* DHD_H2D_LOG_TIME_SYNC */
1387
+ int wlc_ver_major;
1388
+ int wlc_ver_minor;
1389
+#ifdef DHD_STATUS_LOGGING
1390
+ void *statlog;
1391
+#endif /* DHD_STATUS_LOGGING */
1392
+#ifdef DHD_HP2P
1393
+ bool hp2p_enable;
1394
+ bool hp2p_infra_enable;
1395
+ bool hp2p_capable;
1396
+ bool hp2p_ts_capable;
1397
+ uint16 pkt_thresh;
1398
+ uint16 time_thresh;
1399
+ uint16 pkt_expiry;
1400
+ hp2p_info_t hp2p_info[MAX_HP2P_FLOWS];
1401
+ bool hp2p_ring_active;
1402
+#endif /* D2H_HP2P */
1403
+#ifdef DHD_DB0TS
1404
+ bool db0ts_capable;
1405
+#endif /* DHD_DB0TS */
1406
+ bool event_log_max_sets_queried;
1407
+ uint32 event_log_max_sets;
1408
+ uint16 dhd_induce_error;
1409
+#ifdef CONFIG_SILENT_ROAM
1410
+ bool sroam_turn_on; /* Silent roam monitor enable flags */
1411
+ bool sroamed; /* Silent roam monitor check flags */
1412
+#endif /* CONFIG_SILENT_ROAM */
1413
+ bool extdtxs_in_txcpl;
1414
+ bool hostrdy_after_init;
1415
+#ifdef SUPPORT_SET_TID
1416
+ uint8 tid_mode;
1417
+ uint32 target_uid;
1418
+ uint8 target_tid;
1419
+#endif /* SUPPORT_SET_TID */
1420
+#ifdef DHD_PKTDUMP_ROAM
1421
+ void *pktcnts;
1422
+#endif /* DHD_PKTDUMP_ROAM */
1423
+ bool disable_dtim_in_suspend; /* Disable set bcn_li_dtim in suspend */
1424
+#ifdef REVERSE_AIFSN
1425
+ bool aifsn_reverse;
1426
+#endif /* REVERSE_AIFSN */
6401427 } dhd_pub_t;
1428
+
1429
+typedef struct {
1430
+ uint rxwake;
1431
+ uint rcwake;
1432
+#ifdef DHD_WAKE_RX_STATUS
1433
+ uint rx_bcast;
1434
+ uint rx_arp;
1435
+ uint rx_mcast;
1436
+ uint rx_multi_ipv6;
1437
+ uint rx_icmpv6;
1438
+ uint rx_icmpv6_ra;
1439
+ uint rx_icmpv6_na;
1440
+ uint rx_icmpv6_ns;
1441
+ uint rx_multi_ipv4;
1442
+ uint rx_multi_other;
1443
+ uint rx_ucast;
1444
+#endif /* DHD_WAKE_RX_STATUS */
1445
+#ifdef DHD_WAKE_EVENT_STATUS
1446
+ uint rc_event[WLC_E_LAST];
1447
+#endif /* DHD_WAKE_EVENT_STATUS */
1448
+} wake_counts_t;
6411449
6421450 #if defined(PCIE_FULL_DONGLE)
6431451
6441452 /* Packet Tag for PCIE Full Dongle DHD */
6451453 typedef struct dhd_pkttag_fd {
6461454 uint16 flowid; /* Flowring Id */
647
- uint16 dataoff; /* start of packet */
1455
+ uint16 ifid;
1456
+#ifndef DHD_PCIE_PKTID
6481457 uint16 dma_len; /* pkt len for DMA_MAP/UNMAP */
6491458 dmaaddr_t pa; /* physical address */
6501459 void *dmah; /* dma mapper handle */
6511460 void *secdma; /* secure dma sec_cma_info handle */
1461
+#endif /* !DHD_PCIE_PKTID */
1462
+#if defined(TX_STATUS_LATENCY_STATS)
1463
+ uint64 q_time_us; /* time when tx pkt queued to flowring */
1464
+#endif // endif
1465
+ uint16 flags;
6521466 } dhd_pkttag_fd_t;
6531467
6541468 /* Packet Tag for DHD PCIE Full Dongle */
....@@ -677,6 +1491,26 @@
6771491 #define DHD_PKT_GET_SECDMA(pkt) ((DHD_PKTTAG_FD(pkt))->secdma)
6781492 #define DHD_PKT_SET_SECDMA(pkt, pkt_secdma) \
6791493 DHD_PKTTAG_FD(pkt)->secdma = (void *)(pkt_secdma)
1494
+
1495
+#if defined(TX_STATUS_LATENCY_STATS)
1496
+#define DHD_PKT_GET_QTIME(pkt) ((DHD_PKTTAG_FD(pkt))->q_time_us)
1497
+#define DHD_PKT_SET_QTIME(pkt, pkt_q_time_us) \
1498
+ DHD_PKTTAG_FD(pkt)->q_time_us = (uint64)(pkt_q_time_us)
1499
+#endif // endif
1500
+
1501
+#define DHD_PKT_GET_FLAGS(pkt) ((DHD_PKTTAG_FD(pkt))->flags)
1502
+#define DHD_PKT_SET_FLAGS(pkt, pkt_flags) \
1503
+ DHD_PKTTAG_FD(pkt)->flags = (uint16)(pkt_flags)
1504
+
1505
+#define PKTFLAG_NO_FWD 0x8000
1506
+
1507
+#define DHD_PKT_FLAGS_SET_NO_FWD(pkt) \
1508
+ DHD_PKTTAG_FD(pkt)->flags |= PKTFLAG_NO_FWD
1509
+#define DHD_PKT_FLAGS_CLEAR_NO_FWD(pkt) \
1510
+ DHD_PKTTAG_FD(pkt)->flags &= ~PKTFLAG_NO_FWD
1511
+#define DHD_PKT_FLAGS_IS_NO_FWD(pkt) \
1512
+ (DHD_PKTTAG_FD(pkt)->flags & PKTFLAG_NO_FWD)
1513
+
6801514 #endif /* PCIE_FULL_DONGLE */
6811515
6821516 #if defined(BCMWDF)
....@@ -687,7 +1521,7 @@
6871521 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(dhd_workitem_context_t, dhd_get_dhd_workitem_context)
6881522 #endif /* (BCMWDF) */
6891523
690
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP)
1524
+ #if defined(CONFIG_PM_SLEEP)
6911525
6921526 #define DHD_PM_RESUME_WAIT_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
6931527 #define _DHD_PM_RESUME_WAIT(a, b) do {\
....@@ -700,18 +1534,13 @@
7001534 } while (0)
7011535 #define DHD_PM_RESUME_WAIT(a) _DHD_PM_RESUME_WAIT(a, 200)
7021536 #define DHD_PM_RESUME_WAIT_FOREVER(a) _DHD_PM_RESUME_WAIT(a, ~0)
703
- #ifdef CUSTOMER_HW4
704
- #define DHD_PM_RESUME_RETURN_ERROR(a) do { \
705
- if (dhd_mmc_suspend) { \
706
- printf("%s[%d]: mmc is still in suspend state!!!\n", \
707
- __FUNCTION__, __LINE__); \
708
- return a; \
709
- } \
710
- } while (0)
711
- #else
712
- #define DHD_PM_RESUME_RETURN_ERROR(a) do { \
713
- if (dhd_mmc_suspend) return a; } while (0)
714
- #endif
1537
+ #define DHD_PM_RESUME_RETURN_ERROR(a) do { \
1538
+ if (dhd_mmc_suspend) { \
1539
+ printf("%s[%d]: mmc is still in suspend state!!!\n", \
1540
+ __FUNCTION__, __LINE__); \
1541
+ return a; \
1542
+ } \
1543
+ } while (0)
7151544 #define DHD_PM_RESUME_RETURN do { if (dhd_mmc_suspend) return; } while (0)
7161545
7171546 #define DHD_SPINWAIT_SLEEP_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
....@@ -740,7 +1569,7 @@
7401569 } \
7411570 } while (0)
7421571
743
- #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP) */
1572
+ #endif /* CONFIG_PM_SLEEP */
7441573
7451574 #ifndef OSL_SLEEP
7461575 #define OSL_SLEEP(ms) OSL_DELAY(ms*1000)
....@@ -751,30 +1580,30 @@
7511580 #ifdef PNO_SUPPORT
7521581 int dhd_pno_clean(dhd_pub_t *dhd);
7531582 #endif /* PNO_SUPPORT */
1583
+
7541584 /*
7551585 * Wake locks are an Android power management concept. They are used by applications and services
7561586 * to request CPU resources.
7571587 */
1588
+#if defined(OEM_ANDROID)
7581589 extern int dhd_os_wake_lock(dhd_pub_t *pub);
7591590 extern int dhd_os_wake_unlock(dhd_pub_t *pub);
1591
+extern int dhd_os_wake_lock_waive(dhd_pub_t *pub);
1592
+extern int dhd_os_wake_lock_restore(dhd_pub_t *pub);
1593
+extern void dhd_event_wake_lock(dhd_pub_t *pub);
1594
+extern void dhd_event_wake_unlock(dhd_pub_t *pub);
1595
+extern void dhd_pm_wake_lock_timeout(dhd_pub_t *pub, int val);
1596
+extern void dhd_pm_wake_unlock(dhd_pub_t *pub);
1597
+extern void dhd_txfl_wake_lock_timeout(dhd_pub_t *pub, int val);
1598
+extern void dhd_txfl_wake_unlock(dhd_pub_t *pub);
7601599 extern int dhd_os_wake_lock_timeout(dhd_pub_t *pub);
7611600 extern int dhd_os_wake_lock_rx_timeout_enable(dhd_pub_t *pub, int val);
7621601 extern int dhd_os_wake_lock_ctrl_timeout_enable(dhd_pub_t *pub, int val);
7631602 extern int dhd_os_wake_lock_ctrl_timeout_cancel(dhd_pub_t *pub);
7641603 extern int dhd_os_wd_wake_lock(dhd_pub_t *pub);
7651604 extern int dhd_os_wd_wake_unlock(dhd_pub_t *pub);
766
-extern int dhd_os_wake_lock_waive(dhd_pub_t *pub);
767
-extern int dhd_os_wake_lock_restore(dhd_pub_t *pub);
768
-extern void dhd_event_wake_lock(dhd_pub_t *pub);
769
-extern void dhd_event_wake_unlock(dhd_pub_t *pub);
770
-extern void dhd_txfl_wake_lock_timeout(dhd_pub_t *pub, int val);
771
-extern void dhd_txfl_wake_unlock(dhd_pub_t *pub);
7721605 extern void dhd_os_wake_lock_init(struct dhd_info *dhd);
7731606 extern void dhd_os_wake_lock_destroy(struct dhd_info *dhd);
774
-#ifdef BCMPCIE_OOB_HOST_WAKE
775
-extern void dhd_os_oob_irq_wake_lock_timeout(dhd_pub_t *pub, int val);
776
-extern void dhd_os_oob_irq_wake_unlock(dhd_pub_t *pub);
777
-#endif /* BCMPCIE_OOB_HOST_WAKE */
7781607 #ifdef DHD_USE_SCAN_WAKELOCK
7791608 extern void dhd_os_scan_wake_lock_timeout(dhd_pub_t *pub, int val);
7801609 extern void dhd_os_scan_wake_unlock(dhd_pub_t *pub);
....@@ -782,27 +1611,127 @@
7821611
7831612 inline static void MUTEX_LOCK_SOFTAP_SET_INIT(dhd_pub_t * dhdp)
7841613 {
785
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
1614
+#if defined(OEM_ANDROID)
7861615 mutex_init(&dhdp->wl_softap_lock);
787
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
1616
+#endif /* OEM_ANDROID */
7881617 }
7891618
7901619 inline static void MUTEX_LOCK_SOFTAP_SET(dhd_pub_t * dhdp)
7911620 {
792
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
1621
+#if defined(OEM_ANDROID)
7931622 mutex_lock(&dhdp->wl_softap_lock);
794
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
1623
+#endif /* OEM_ANDROID */
7951624 }
7961625
7971626 inline static void MUTEX_UNLOCK_SOFTAP_SET(dhd_pub_t * dhdp)
7981627 {
799
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
1628
+#if defined(OEM_ANDROID)
8001629 mutex_unlock(&dhdp->wl_softap_lock);
801
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
1630
+#endif /* OEM_ANDROID */
8021631 }
8031632
1633
+#ifdef DHD_DEBUG_WAKE_LOCK
1634
+#define DHD_OS_WAKE_LOCK(pub) \
1635
+ do { \
1636
+ printf("call wake_lock: %s %d\n", \
1637
+ __FUNCTION__, __LINE__); \
1638
+ dhd_os_wake_lock(pub); \
1639
+ } while (0)
1640
+#define DHD_OS_WAKE_UNLOCK(pub) \
1641
+ do { \
1642
+ printf("call wake_unlock: %s %d\n", \
1643
+ __FUNCTION__, __LINE__); \
1644
+ dhd_os_wake_unlock(pub); \
1645
+ } while (0)
1646
+#define DHD_EVENT_WAKE_LOCK(pub) \
1647
+ do { \
1648
+ printf("call event wake_lock: %s %d\n", \
1649
+ __FUNCTION__, __LINE__); \
1650
+ dhd_event_wake_lock(pub); \
1651
+ } while (0)
1652
+#define DHD_EVENT_WAKE_UNLOCK(pub) \
1653
+ do { \
1654
+ printf("call event wake_unlock: %s %d\n", \
1655
+ __FUNCTION__, __LINE__); \
1656
+ dhd_event_wake_unlock(pub); \
1657
+ } while (0)
1658
+#define DHD_PM_WAKE_LOCK_TIMEOUT(pub, val) \
1659
+ do { \
1660
+ printf("call pm_wake_timeout enable\n"); \
1661
+ dhd_pm_wake_lock_timeout(pub, val); \
1662
+ } while (0)
1663
+#define DHD_PM_WAKE_UNLOCK(pub) \
1664
+ do { \
1665
+ printf("call pm_wake unlock\n"); \
1666
+ dhd_pm_wake_unlock(pub); \
1667
+ } while (0)
1668
+#define DHD_TXFL_WAKE_LOCK_TIMEOUT(pub, val) \
1669
+ do { \
1670
+ printf("call pm_wake_timeout enable\n"); \
1671
+ dhd_txfl_wake_lock_timeout(pub, val); \
1672
+ } while (0)
1673
+#define DHD_TXFL_WAKE_UNLOCK(pub) \
1674
+ do { \
1675
+ printf("call pm_wake unlock\n"); \
1676
+ dhd_txfl_wake_unlock(pub); \
1677
+ } while (0)
1678
+#define DHD_OS_WAKE_LOCK_TIMEOUT(pub) \
1679
+ do { \
1680
+ printf("call wake_lock_timeout: %s %d\n", \
1681
+ __FUNCTION__, __LINE__); \
1682
+ dhd_os_wake_lock_timeout(pub); \
1683
+ } while (0)
1684
+#define DHD_OS_WAKE_LOCK_RX_TIMEOUT_ENABLE(pub, val) \
1685
+ do { \
1686
+ printf("call wake_lock_rx_timeout_enable[%d]: %s %d\n", \
1687
+ val, __FUNCTION__, __LINE__); \
1688
+ dhd_os_wake_lock_rx_timeout_enable(pub, val); \
1689
+ } while (0)
1690
+#define DHD_OS_WAKE_LOCK_CTRL_TIMEOUT_ENABLE(pub, val) \
1691
+ do { \
1692
+ printf("call wake_lock_ctrl_timeout_enable[%d]: %s %d\n", \
1693
+ val, __FUNCTION__, __LINE__); \
1694
+ dhd_os_wake_lock_ctrl_timeout_enable(pub, val); \
1695
+ } while (0)
1696
+#define DHD_OS_WAKE_LOCK_CTRL_TIMEOUT_CANCEL(pub) \
1697
+ do { \
1698
+ printf("call wake_lock_ctrl_timeout_cancel: %s %d\n", \
1699
+ __FUNCTION__, __LINE__); \
1700
+ dhd_os_wake_lock_ctrl_timeout_cancel(pub); \
1701
+ } while (0)
1702
+#define DHD_OS_WAKE_LOCK_WAIVE(pub) \
1703
+ do { \
1704
+ printf("call wake_lock_waive: %s %d\n", \
1705
+ __FUNCTION__, __LINE__); \
1706
+ dhd_os_wake_lock_waive(pub); \
1707
+ } while (0)
1708
+#define DHD_OS_WAKE_LOCK_RESTORE(pub) \
1709
+ do { \
1710
+ printf("call wake_lock_restore: %s %d\n", \
1711
+ __FUNCTION__, __LINE__); \
1712
+ dhd_os_wake_lock_restore(pub); \
1713
+ } while (0)
1714
+#define DHD_OS_WAKE_LOCK_INIT(dhd) \
1715
+ do { \
1716
+ printf("call wake_lock_init: %s %d\n", \
1717
+ __FUNCTION__, __LINE__); \
1718
+ dhd_os_wake_lock_init(dhd); \
1719
+ } while (0)
1720
+#define DHD_OS_WAKE_LOCK_DESTROY(dhd) \
1721
+ do { \
1722
+ printf("call wake_lock_destroy: %s %d\n", \
1723
+ __FUNCTION__, __LINE__); \
1724
+ dhd_os_wake_lock_destroy(dhd); \
1725
+ } while (0)
1726
+#else
8041727 #define DHD_OS_WAKE_LOCK(pub) dhd_os_wake_lock(pub)
8051728 #define DHD_OS_WAKE_UNLOCK(pub) dhd_os_wake_unlock(pub)
1729
+#define DHD_EVENT_WAKE_LOCK(pub) dhd_event_wake_lock(pub)
1730
+#define DHD_EVENT_WAKE_UNLOCK(pub) dhd_event_wake_unlock(pub)
1731
+#define DHD_PM_WAKE_LOCK_TIMEOUT(pub, val) dhd_pm_wake_lock_timeout(pub, val)
1732
+#define DHD_PM_WAKE_UNLOCK(pub) dhd_pm_wake_unlock(pub)
1733
+#define DHD_TXFL_WAKE_LOCK_TIMEOUT(pub, val) dhd_txfl_wake_lock_timeout(pub, val)
1734
+#define DHD_TXFL_WAKE_UNLOCK(pub) dhd_txfl_wake_unlock(pub)
8061735 #define DHD_OS_WAKE_LOCK_TIMEOUT(pub) dhd_os_wake_lock_timeout(pub)
8071736 #define DHD_OS_WAKE_LOCK_RX_TIMEOUT_ENABLE(pub, val) \
8081737 dhd_os_wake_lock_rx_timeout_enable(pub, val)
....@@ -812,22 +1741,13 @@
8121741 dhd_os_wake_lock_ctrl_timeout_cancel(pub)
8131742 #define DHD_OS_WAKE_LOCK_WAIVE(pub) dhd_os_wake_lock_waive(pub)
8141743 #define DHD_OS_WAKE_LOCK_RESTORE(pub) dhd_os_wake_lock_restore(pub)
1744
+#define DHD_OS_WAKE_LOCK_INIT(dhd) dhd_os_wake_lock_init(dhd);
1745
+#define DHD_OS_WAKE_LOCK_DESTROY(dhd) dhd_os_wake_lock_destroy(dhd);
1746
+#endif /* DHD_DEBUG_WAKE_LOCK */
8151747
8161748 #define DHD_OS_WD_WAKE_LOCK(pub) dhd_os_wd_wake_lock(pub)
8171749 #define DHD_OS_WD_WAKE_UNLOCK(pub) dhd_os_wd_wake_unlock(pub)
8181750
819
-#define DHD_EVENT_WAKE_LOCK(pub) dhd_event_wake_lock(pub)
820
-#define DHD_EVENT_WAKE_UNLOCK(pub) dhd_event_wake_unlock(pub)
821
-#define DHD_TXFL_WAKE_LOCK_TIMEOUT(pub, val) dhd_txfl_wake_lock_timeout(pub, val)
822
-#define DHD_TXFL_WAKE_UNLOCK(pub) dhd_txfl_wake_unlock(pub)
823
-#define DHD_OS_WAKE_LOCK_INIT(dhd) dhd_os_wake_lock_init(dhd)
824
-#define DHD_OS_WAKE_LOCK_DESTROY(dhd) dhd_os_wake_lock_destroy(dhd)
825
-
826
-#ifdef BCMPCIE_OOB_HOST_WAKE
827
-#define OOB_WAKE_LOCK_TIMEOUT 500
828
-#define DHD_OS_OOB_IRQ_WAKE_LOCK_TIMEOUT(pub, val) dhd_os_oob_irq_wake_lock_timeout(pub, val)
829
-#define DHD_OS_OOB_IRQ_WAKE_UNLOCK(pub) dhd_os_oob_irq_wake_unlock(pub)
830
-#endif /* BCMPCIE_OOB_HOST_WAKE */
8311751 #ifdef DHD_USE_SCAN_WAKELOCK
8321752 #ifdef DHD_DEBUG_SCAN_WAKELOCK
8331753 #define DHD_OS_SCAN_WAKE_LOCK_TIMEOUT(pub, val) \
....@@ -850,10 +1770,46 @@
8501770 #define DHD_OS_SCAN_WAKE_LOCK_TIMEOUT(pub, val)
8511771 #define DHD_OS_SCAN_WAKE_UNLOCK(pub)
8521772 #endif /* DHD_USE_SCAN_WAKELOCK */
1773
+
1774
+#else
1775
+
1776
+/* Wake lock are used in Android only (until the Linux community accepts it) */
1777
+#define DHD_OS_WAKE_LOCK(pub)
1778
+#define DHD_OS_WAKE_UNLOCK(pub)
1779
+#define DHD_EVENT_WAKE_LOCK(pub)
1780
+#define DHD_EVENT_WAKE_UNLOCK(pub)
1781
+#define DHD_PM_WAKE_LOCK_TIMEOUT(pub, val)
1782
+#define DHD_PM_WAKE_UNLOCK(pub)
1783
+#define DHD_TXFL_WAKE_LOCK_TIMEOUT(pub, val)
1784
+#define DHD_TXFL_WAKE_UNLOCK(pub)
1785
+#define DHD_OS_WD_WAKE_LOCK(pub)
1786
+#define DHD_OS_WD_WAKE_UNLOCK(pub)
1787
+#define DHD_OS_WAKE_LOCK_TIMEOUT(pub)
1788
+#define DHD_OS_WAKE_LOCK_RX_TIMEOUT_ENABLE(pub, val) UNUSED_PARAMETER(val)
1789
+#define DHD_OS_WAKE_LOCK_CTRL_TIMEOUT_ENABLE(pub, val) UNUSED_PARAMETER(val)
1790
+#define DHD_OS_WAKE_LOCK_CTRL_TIMEOUT_CANCEL(pub, val)
1791
+#define DHD_OS_WAKE_LOCK_WAIVE(pub)
1792
+#define DHD_OS_WAKE_LOCK_RESTORE(pub)
1793
+#define DHD_OS_SCAN_WAKE_LOCK_TIMEOUT(pub, val)
1794
+#define DHD_OS_SCAN_WAKE_UNLOCK(pub)
1795
+#define DHD_OS_WAKE_LOCK_INIT(dhd)
1796
+#define DHD_OS_WAKE_LOCK_DESTROY(dhd)
1797
+
1798
+#endif // endif
1799
+
1800
+#ifdef BCMPCIE_OOB_HOST_WAKE
1801
+#define OOB_WAKE_LOCK_TIMEOUT 500
1802
+extern void dhd_os_oob_irq_wake_lock_timeout(dhd_pub_t *pub, int val);
1803
+extern void dhd_os_oob_irq_wake_unlock(dhd_pub_t *pub);
1804
+
1805
+#define DHD_OS_OOB_IRQ_WAKE_LOCK_TIMEOUT(pub, val) dhd_os_oob_irq_wake_lock_timeout(pub, val)
1806
+#define DHD_OS_OOB_IRQ_WAKE_UNLOCK(pub) dhd_os_oob_irq_wake_unlock(pub)
1807
+#endif /* BCMPCIE_OOB_HOST_WAKE */
1808
+
8531809 #define DHD_PACKET_TIMEOUT_MS 500
8541810 #define DHD_EVENT_TIMEOUT_MS 1500
8551811 #define SCAN_WAKE_LOCK_TIMEOUT 10000
856
-#define MAX_TX_TIMEOUT 500
1812
+#define MAX_TX_TIMEOUT 500
8571813
8581814 /* Enum for IOCTL recieved status */
8591815 typedef enum dhd_ioctl_recieved_status
....@@ -861,7 +1817,8 @@
8611817 IOCTL_WAIT = 0,
8621818 IOCTL_RETURN_ON_SUCCESS,
8631819 IOCTL_RETURN_ON_TRAP,
864
- IOCTL_RETURN_ON_BUS_STOP
1820
+ IOCTL_RETURN_ON_BUS_STOP,
1821
+ IOCTL_RETURN_ON_ERROR
8651822 } dhd_ioctl_recieved_status_t;
8661823
8671824 /* interface operations (register, remove) should be atomic, use this lock to prevent race
....@@ -870,6 +1827,11 @@
8701827 void dhd_net_if_lock(struct net_device *dev);
8711828 void dhd_net_if_unlock(struct net_device *dev);
8721829
1830
+#if defined(MULTIPLE_SUPPLICANT)
1831
+#if defined(OEM_ANDROID) && defined(BCMSDIO)
1832
+extern struct mutex _dhd_sdio_mutex_lock_;
1833
+#endif // endif
1834
+#endif /* MULTIPLE_SUPPLICANT */
8731835
8741836 typedef enum dhd_attach_states
8751837 {
....@@ -883,13 +1845,50 @@
8831845 DHD_ATTACH_STATE_WAKELOCKS_INIT = 0x40,
8841846 DHD_ATTACH_STATE_CFG80211 = 0x80,
8851847 DHD_ATTACH_STATE_EARLYSUSPEND_DONE = 0x100,
886
- DHD_ATTACH_STATE_DONE = 0x200
1848
+ DHD_ATTACH_TIMESYNC_ATTACH_DONE = 0x200,
1849
+ DHD_ATTACH_LOGTRACE_INIT = 0x400,
1850
+ DHD_ATTACH_STATE_LB_ATTACH_DONE = 0x800,
1851
+ DHD_ATTACH_STATE_DONE = 0x1000
8871852 } dhd_attach_states_t;
8881853
8891854 /* Value -1 means we are unsuccessful in creating the kthread. */
8901855 #define DHD_PID_KT_INVALID -1
8911856 /* Value -2 means we are unsuccessful in both creating the kthread and tasklet */
8921857 #define DHD_PID_KT_TL_INVALID -2
1858
+
1859
+/* default reporting period */
1860
+#define ECOUNTERS_DEFAULT_PERIOD 0
1861
+
1862
+/* default number of reports. '0' indicates forever */
1863
+#define ECOUNTERS_NUM_REPORTS 0
1864
+
1865
+typedef struct ecounters_cfg {
1866
+ uint16 type;
1867
+ uint16 if_slice_idx;
1868
+ uint16 stats_rep;
1869
+} ecounters_cfg_t;
1870
+
1871
+typedef struct event_ecounters_cfg {
1872
+ uint16 event_id;
1873
+ uint16 type;
1874
+ uint16 if_slice_idx;
1875
+ uint16 stats_rep;
1876
+} event_ecounters_cfg_t;
1877
+
1878
+typedef struct ecountersv2_xtlv_list_elt {
1879
+ /* Not quite the exact bcm_xtlv_t type as data could be pointing to other pieces in
1880
+ * memory at the time of parsing arguments.
1881
+ */
1882
+ uint16 id;
1883
+ uint16 len;
1884
+ uint8 *data;
1885
+ struct ecountersv2_xtlv_list_elt *next;
1886
+} ecountersv2_xtlv_list_elt_t;
1887
+
1888
+typedef struct ecountersv2_processed_xtlv_list_elt {
1889
+ uint8 *data;
1890
+ struct ecountersv2_processed_xtlv_list_elt *next;
1891
+} ecountersv2_processed_xtlv_list_elt;
8931892
8941893 /*
8951894 * Exported from dhd OS modules (dhd_linux/dhd_ndis)
....@@ -901,12 +1900,16 @@
9011900 * bus_hdrlen specifies required headroom for bus module header.
9021901 */
9031902 extern dhd_pub_t *dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen);
1903
+extern int dhd_attach_net(dhd_pub_t *dhdp, bool need_rtnl_lock);
9041904 #if defined(WLP2P) && defined(WL_CFG80211)
9051905 /* To allow attach/detach calls corresponding to p2p0 interface */
9061906 extern int dhd_attach_p2p(dhd_pub_t *);
9071907 extern int dhd_detach_p2p(dhd_pub_t *);
9081908 #endif /* WLP2P && WL_CFG80211 */
9091909 extern int dhd_register_if(dhd_pub_t *dhdp, int idx, bool need_rtnl_lock);
1910
+#ifdef WL_VIF_SUPPORT
1911
+extern int dhd_register_vif(dhd_pub_t *dhdp);
1912
+#endif /* WL_VIF_SUPPORT */
9101913
9111914 /* Indication from bus module regarding removal/absence of dongle */
9121915 extern void dhd_detach(dhd_pub_t *dhdp);
....@@ -921,18 +1924,29 @@
9211924
9221925 extern bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, void *pkt, int prec);
9231926
924
-/* Receive frame for delivery to OS. Callee disposes of rxp. */
9251927 extern void dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *rxp, int numpkt, uint8 chan);
9261928
9271929 /* Return pointer to interface name */
9281930 extern char *dhd_ifname(dhd_pub_t *dhdp, int idx);
1931
+
1932
+#ifdef DHD_UCODE_DOWNLOAD
1933
+/* Returns the ucode path */
1934
+extern char *dhd_get_ucode_path(dhd_pub_t *dhdp);
1935
+#endif /* DHD_UCODE_DOWNLOAD */
9291936
9301937 /* Request scheduling of the bus dpc */
9311938 extern void dhd_sched_dpc(dhd_pub_t *dhdp);
9321939
9331940 /* Notify tx completion */
9341941 extern void dhd_txcomplete(dhd_pub_t *dhdp, void *txp, bool success);
935
-extern void dhd_dpc_enable(dhd_pub_t *dhdp);
1942
+#ifdef DHD_4WAYM4_FAIL_DISCONNECT
1943
+extern void dhd_eap_txcomplete(dhd_pub_t *dhdp, void *txp, bool success, int ifidx);
1944
+extern void dhd_cleanup_m4_state_work(dhd_pub_t *dhdp, int ifidx);
1945
+#endif /* DHD_4WAYM4_FAIL_DISCONNECT */
1946
+
1947
+#ifdef DHD_PCIE_NATIVE_RUNTIMEPM
1948
+extern void dhd_bus_wakeup_work(dhd_pub_t *dhdp);
1949
+#endif /* DHD_PCIE_NATIVE_RUNTIMEPM */
9361950
9371951 #define WIFI_FEATURE_INFRA 0x0001 /* Basic infrastructure mode */
9381952 #define WIFI_FEATURE_INFRA_5G 0x0002 /* Support for 5 GHz Band */
....@@ -951,42 +1965,57 @@
9511965 #define WIFI_FEATURE_EPR 0x4000 /* Enhanced power reporting */
9521966 #define WIFI_FEATURE_AP_STA 0x8000 /* Support for AP STA Concurrency */
9531967 #define WIFI_FEATURE_LINKSTAT 0x10000 /* Support for Linkstats */
954
-#define WIFI_FEATURE_HAL_EPNO 0x40000 /* WiFi PNO enhanced */
955
-#define WIFI_FEATURE_RSSI_MONITOR 0x80000 /* RSSI Monitor */
1968
+#define WIFI_FEATURE_LOGGER 0x20000 /* WiFi Logger */
1969
+#define WIFI_FEATURE_HAL_EPNO 0x40000 /* WiFi PNO enhanced */
1970
+#define WIFI_FEATURE_RSSI_MONITOR 0x80000 /* RSSI Monitor */
1971
+#define WIFI_FEATURE_MKEEP_ALIVE 0x100000 /* WiFi mkeep_alive */
1972
+#define WIFI_FEATURE_CONFIG_NDO 0x200000 /* ND offload configure */
1973
+#define WIFI_FEATURE_TX_TRANSMIT_POWER 0x400000 /* Capture Tx transmit power levels */
1974
+#define WIFI_FEATURE_CONTROL_ROAMING 0x800000 /* Enable/Disable firmware roaming */
1975
+#define WIFI_FEATURE_FILTER_IE 0x1000000 /* Probe req ie filter */
1976
+#define WIFI_FEATURE_SCAN_RAND 0x2000000 /* Support MAC & Prb SN randomization */
1977
+#define WIFI_FEATURE_SET_TX_POWER_LIMIT 0x4000000 /* Support Tx Power Limit setting */
1978
+#define WIFI_FEATURE_USE_BODY_HEAD_SAR 0x8000000 /* Body/Head Proximity for SAR */
1979
+#define WIFI_FEATURE_SET_LATENCY_MODE 0x40000000 /* Support Latency mode setting */
1980
+#define WIFI_FEATURE_P2P_RAND_MAC 0x80000000 /* Support P2P MAC randomization */
1981
+#define WIFI_FEATURE_INVALID 0xFFFFFFFF /* Invalid Feature */
9561982
9571983 #define MAX_FEATURE_SET_CONCURRRENT_GROUPS 3
9581984
9591985 extern int dhd_dev_get_feature_set(struct net_device *dev);
960
-extern int *dhd_dev_get_feature_set_matrix(struct net_device *dev, int *num);
1986
+extern int dhd_dev_get_feature_set_matrix(struct net_device *dev, int num);
1987
+extern int dhd_dev_cfg_rand_mac_oui(struct net_device *dev, uint8 *oui);
9611988 #ifdef CUSTOM_FORCE_NODFS_FLAG
9621989 extern int dhd_dev_set_nodfs(struct net_device *dev, uint nodfs);
9631990 #endif /* CUSTOM_FORCE_NODFS_FLAG */
964
-extern int dhd_dev_cfg_rand_mac_oui(struct net_device *dev, uint8 *oui);
965
-extern int dhd_set_rand_mac_oui(dhd_pub_t *dhd);
1991
+#ifdef NDO_CONFIG_SUPPORT
1992
+#ifndef NDO_MAX_HOST_IP_ENTRIES
1993
+#define NDO_MAX_HOST_IP_ENTRIES 10
1994
+#endif /* NDO_MAX_HOST_IP_ENTRIES */
9661995
1996
+extern int dhd_dev_ndo_cfg(struct net_device *dev, u8 enable);
1997
+extern int dhd_dev_ndo_update_inet6addr(struct net_device * dev);
1998
+#endif /* NDO_CONFIG_SUPPORT */
1999
+extern int dhd_set_rand_mac_oui(dhd_pub_t *dhd);
9672000 #ifdef GSCAN_SUPPORT
9682001 extern int dhd_dev_set_lazy_roam_cfg(struct net_device *dev,
9692002 wlc_roam_exp_params_t *roam_param);
9702003 extern int dhd_dev_lazy_roam_enable(struct net_device *dev, uint32 enable);
9712004 extern int dhd_dev_set_lazy_roam_bssid_pref(struct net_device *dev,
9722005 wl_bssid_pref_cfg_t *bssid_pref, uint32 flush);
2006
+#endif /* GSCAN_SUPPORT */
2007
+#if defined(GSCAN_SUPPORT) || defined(ROAMEXP_SUPPORT)
9732008 extern int dhd_dev_set_blacklist_bssid(struct net_device *dev, maclist_t *blacklist,
9742009 uint32 len, uint32 flush);
9752010 extern int dhd_dev_set_whitelist_ssid(struct net_device *dev, wl_ssid_whitelist_t *whitelist,
9762011 uint32 len, uint32 flush);
977
-#endif /* GSCAN_SUPPORT */
978
-
979
-extern int dhd_dev_set_rssi_monitor_cfg(struct net_device *dev, int start,
980
- int8 max_rssi, int8 min_rssi);
981
-
982
-#define DHD_RSSI_MONITOR_EVT_VERSION 1
983
-typedef struct {
984
- uint8 version;
985
- int8 cur_rssi;
986
- struct ether_addr BSSID;
987
-} dhd_rssi_monitor_evt_t;
2012
+#endif /* GSCAN_SUPPORT || ROAMEXP_SUPPORT */
9882013
9892014 /* OS independent layer functions */
2015
+extern void dhd_os_dhdiovar_lock(dhd_pub_t *pub);
2016
+extern void dhd_os_dhdiovar_unlock(dhd_pub_t *pub);
2017
+void dhd_os_logdump_lock(dhd_pub_t *pub);
2018
+void dhd_os_logdump_unlock(dhd_pub_t *pub);
9902019 extern int dhd_os_proto_block(dhd_pub_t * pub);
9912020 extern int dhd_os_proto_unblock(dhd_pub_t * pub);
9922021 extern int dhd_os_ioctl_resp_wait(dhd_pub_t * pub, uint * condition);
....@@ -995,16 +2024,47 @@
9952024 extern void dhd_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
9962025 extern void dhd_os_ioctl_resp_lock(dhd_pub_t * pub);
9972026 extern void dhd_os_ioctl_resp_unlock(dhd_pub_t * pub);
2027
+#ifdef PCIE_FULL_DONGLE
9982028 extern void dhd_wakeup_ioctl_event(dhd_pub_t *pub, dhd_ioctl_recieved_status_t reason);
2029
+#else
2030
+static INLINE void dhd_wakeup_ioctl_event(dhd_pub_t *pub, dhd_ioctl_recieved_status_t reason)
2031
+{ printf("%s is NOT implemented for SDIO", __FUNCTION__); return; }
2032
+#endif // endif
2033
+#ifdef SHOW_LOGTRACE
2034
+/* Bound and delay are fine tuned after several experiments and these
2035
+ * are the best case values to handle bombarding of console logs.
2036
+ */
2037
+#define DHD_EVENT_LOGTRACE_BOUND 10
2038
+/* since FW has event log rate health check (EVENT_LOG_RATE_HC) we can reduce
2039
+ * the reschedule delay to 10ms
2040
+*/
2041
+#define DHD_EVENT_LOGTRACE_RESCHEDULE_DELAY_MS 10u
2042
+extern int dhd_os_read_file(void *file, char *buf, uint32 size);
2043
+extern int dhd_os_seek_file(void *file, int64 offset);
2044
+void dhd_sendup_info_buf(dhd_pub_t *dhdp, uint8 *msg);
2045
+#endif /* SHOW_LOGTRACE */
2046
+int dhd_os_write_file_posn(void *fp, unsigned long *posn,
2047
+ void *buf, unsigned long buflen);
2048
+int dhd_msix_message_set(dhd_pub_t *dhdp, uint table_entry,
2049
+ uint message_number, bool unmask);
9992050
1000
-#define DHD_OS_IOCTL_RESP_LOCK(x)
1001
-#define DHD_OS_IOCTL_RESP_UNLOCK(x)
1002
-
2051
+extern void
2052
+dhd_pcie_dump_core_regs(dhd_pub_t * pub, uint32 index, uint32 first_addr, uint32 last_addr);
2053
+extern void wl_dhdpcie_dump_regs(void * context);
10032054
10042055 extern int dhd_os_get_image_block(char * buf, int len, void * image);
1005
-extern void * dhd_os_open_image(char * filename);
1006
-extern void dhd_os_close_image(void * image);
2056
+extern int dhd_os_get_image_size(void * image);
2057
+#if defined(BT_OVER_SDIO)
2058
+extern int dhd_os_gets_image(dhd_pub_t *pub, char *str, int len, void *image);
2059
+extern void dhdsdio_bus_usr_cnt_inc(dhd_pub_t *pub);
2060
+extern void dhdsdio_bus_usr_cnt_dec(dhd_pub_t *pub);
2061
+#endif /* (BT_OVER_SDIO) */
2062
+extern void *dhd_os_open_image1(dhd_pub_t *pub, char *filename); /* rev1 function signature */
2063
+extern void dhd_os_close_image1(dhd_pub_t *pub, void *image);
10072064 extern void dhd_os_wd_timer(void *bus, uint wdtick);
2065
+#ifdef DHD_PCIE_RUNTIMEPM
2066
+extern void dhd_os_runtimepm_timer(void *bus, uint tick);
2067
+#endif /* DHD_PCIE_RUNTIMEPM */
10082068 extern void dhd_os_sdlock(dhd_pub_t * pub);
10092069 extern void dhd_os_sdunlock(dhd_pub_t * pub);
10102070 extern void dhd_os_sdlock_txq(dhd_pub_t * pub);
....@@ -1012,6 +2072,7 @@
10122072 extern void dhd_os_sdlock_rxq(dhd_pub_t * pub);
10132073 extern void dhd_os_sdunlock_rxq(dhd_pub_t * pub);
10142074 extern void dhd_os_sdlock_sndup_rxq(dhd_pub_t * pub);
2075
+extern void dhd_os_tracelog(const char *format, ...);
10152076 #ifdef DHDTCPACK_SUPPRESS
10162077 extern unsigned long dhd_os_tcpacklock(dhd_pub_t *pub);
10172078 extern void dhd_os_tcpackunlock(dhd_pub_t *pub, unsigned long flags);
....@@ -1020,9 +2081,9 @@
10202081 extern int dhd_customer_oob_irq_map(void *adapter, unsigned long *irq_flags_ptr);
10212082 extern int dhd_customer_gpio_wlan_ctrl(void *adapter, int onoff);
10222083 extern int dhd_custom_get_mac_address(void *adapter, unsigned char *buf);
1023
-#ifdef CUSTOM_COUNTRY_CODE
2084
+#if defined(CUSTOM_COUNTRY_CODE)
10242085 extern void get_customized_country_code(void *adapter, char *country_iso_code,
1025
-wl_country_t *cspec, u32 flags);
2086
+ wl_country_t *cspec, u32 flags);
10262087 #else
10272088 extern void get_customized_country_code(void *adapter, char *country_iso_code, wl_country_t *cspec);
10282089 #endif /* CUSTOM_COUNTRY_CODE */
....@@ -1044,18 +2105,17 @@
10442105 extern int dhd_keep_alive_onoff(dhd_pub_t *dhd);
10452106 #endif /* KEEP_ALIVE */
10462107
1047
-#ifdef SUPPORT_AP_POWERSAVE
1048
-extern int dhd_set_ap_powersave(dhd_pub_t *dhdp, int ifidx, int enable);
1049
-#endif
1050
-
10512108 #if defined(DHD_FW_COREDUMP)
10522109 void dhd_schedule_memdump(dhd_pub_t *dhdp, uint8 *buf, uint32 size);
10532110 #endif /* DHD_FW_COREDUMP */
10542111
1055
-#ifdef SUPPORT_AP_POWERSAVE
1056
-extern int dhd_set_ap_powersave(dhd_pub_t *dhdp, int ifidx, int enable);
1057
-#endif /* SUPPORT_AP_POWERSAVE */
1058
-
2112
+void dhd_write_sssr_dump(dhd_pub_t *dhdp, uint32 dump_mode);
2113
+#ifdef DNGL_AXI_ERROR_LOGGING
2114
+void dhd_schedule_axi_error_dump(dhd_pub_t *dhdp, void *type);
2115
+#endif /* DNGL_AXI_ERROR_LOGGING */
2116
+#ifdef BCMPCIE
2117
+void dhd_schedule_cto_recovery(dhd_pub_t *dhdp);
2118
+#endif /* BCMPCIE */
10592119
10602120 #ifdef PKT_FILTER_SUPPORT
10612121 #define DHD_UNICAST_FILTER_NUM 0
....@@ -1064,16 +2124,53 @@
10642124 #define DHD_MULTICAST6_FILTER_NUM 3
10652125 #define DHD_MDNS_FILTER_NUM 4
10662126 #define DHD_ARP_FILTER_NUM 5
1067
-extern int dhd_os_enable_packet_filter(dhd_pub_t *dhdp, int val);
2127
+#define DHD_BROADCAST_ARP_FILTER_NUM 6
2128
+#define DHD_IP4BCAST_DROP_FILTER_NUM 7
2129
+#define DHD_LLC_STP_DROP_FILTER_NUM 8
2130
+#define DHD_LLC_XID_DROP_FILTER_NUM 9
2131
+#define DISCARD_IPV4_MCAST "102 1 6 IP4_H:16 0xf0 0xe0"
2132
+#define DISCARD_IPV6_MCAST "103 1 6 IP6_H:24 0xff 0xff"
2133
+#define DISCARD_IPV4_BCAST "107 1 6 IP4_H:16 0xffffffff 0xffffffff"
2134
+#define DISCARD_LLC_STP "108 1 6 ETH_H:14 0xFFFFFFFFFFFF 0xAAAA0300000C"
2135
+#define DISCARD_LLC_XID "109 1 6 ETH_H:14 0xFFFFFF 0x0001AF"
2136
+extern int dhd_os_enable_packet_filter(dhd_pub_t *dhdp, int val);
10682137 extern void dhd_enable_packet_filter(int value, dhd_pub_t *dhd);
2138
+extern int dhd_packet_filter_add_remove(dhd_pub_t *dhdp, int add_remove, int num);
10692139 extern int net_os_enable_packet_filter(struct net_device *dev, int val);
10702140 extern int net_os_rxfilter_add_remove(struct net_device *dev, int val, int num);
2141
+
2142
+#define MAX_PKTFLT_BUF_SIZE 2048
2143
+#define MAX_PKTFLT_FIXED_PATTERN_SIZE 32
2144
+#define MAX_PKTFLT_FIXED_BUF_SIZE \
2145
+ (WL_PKT_FILTER_FIXED_LEN + MAX_PKTFLT_FIXED_PATTERN_SIZE * 2)
2146
+#define MAXPKT_ARG 16
10712147 #endif /* PKT_FILTER_SUPPORT */
10722148
2149
+#if defined(OEM_ANDROID) && defined(BCMPCIE)
2150
+extern int dhd_get_suspend_bcn_li_dtim(dhd_pub_t *dhd, int *dtim_period, int *bcn_interval);
2151
+#else
10732152 extern int dhd_get_suspend_bcn_li_dtim(dhd_pub_t *dhd);
1074
-extern bool dhd_support_sta_mode(dhd_pub_t *dhd);
2153
+#endif /* OEM_ANDROID && BCMPCIE */
10752154
2155
+extern bool dhd_support_sta_mode(dhd_pub_t *dhd);
10762156 extern int write_to_file(dhd_pub_t *dhd, uint8 *buf, int size);
2157
+
2158
+#ifdef RSSI_MONITOR_SUPPORT
2159
+extern int dhd_dev_set_rssi_monitor_cfg(struct net_device *dev, int start,
2160
+ int8 max_rssi, int8 min_rssi);
2161
+#endif /* RSSI_MONITOR_SUPPORT */
2162
+
2163
+#ifdef DHDTCPACK_SUPPRESS
2164
+int dhd_dev_set_tcpack_sup_mode_cfg(struct net_device *dev, uint8 enable);
2165
+#endif /* DHDTCPACK_SUPPRESS */
2166
+
2167
+#define DHD_RSSI_MONITOR_EVT_VERSION 1
2168
+typedef struct {
2169
+ uint8 version;
2170
+ int8 cur_rssi;
2171
+ struct ether_addr BSSID;
2172
+} dhd_rssi_monitor_evt_t;
2173
+
10772174 typedef struct {
10782175 uint32 limit; /* Expiration time (usec) */
10792176 uint32 increment; /* Current expiration increment (usec) */
....@@ -1083,25 +2180,50 @@
10832180
10842181 #ifdef SHOW_LOGTRACE
10852182 typedef struct {
1086
- int num_fmts;
2183
+ uint num_fmts;
10872184 char **fmts;
10882185 char *raw_fmts;
10892186 char *raw_sstr;
2187
+ uint32 fmts_size;
2188
+ uint32 raw_fmts_size;
2189
+ uint32 raw_sstr_size;
10902190 uint32 ramstart;
10912191 uint32 rodata_start;
10922192 uint32 rodata_end;
10932193 char *rom_raw_sstr;
2194
+ uint32 rom_raw_sstr_size;
10942195 uint32 rom_ramstart;
10952196 uint32 rom_rodata_start;
10962197 uint32 rom_rodata_end;
10972198 } dhd_event_log_t;
10982199 #endif /* SHOW_LOGTRACE */
10992200
1100
-#if defined(KEEP_ALIVE)
1101
-extern int dhd_dev_start_mkeep_alive(dhd_pub_t *dhd_pub, u8 mkeep_alive_id, u8 *ip_pkt,
1102
- u16 ip_pkt_len, u8* src_mac_addr, u8* dst_mac_addr, u32 period_msec);
1103
-extern int dhd_dev_stop_mkeep_alive(dhd_pub_t *dhd_pub, u8 mkeep_alive_id);
1104
-#endif /* defined(KEEP_ALIVE) */
2201
+#ifdef KEEP_ALIVE
2202
+extern int dhd_dev_start_mkeep_alive(dhd_pub_t *dhd_pub, uint8 mkeep_alive_id, uint8 *ip_pkt,
2203
+ uint16 ip_pkt_len, uint8* src_mac_addr, uint8* dst_mac_addr, uint32 period_msec);
2204
+extern int dhd_dev_stop_mkeep_alive(dhd_pub_t *dhd_pub, uint8 mkeep_alive_id);
2205
+#endif /* KEEP_ALIVE */
2206
+
2207
+#if defined(PKT_FILTER_SUPPORT) && defined(APF)
2208
+/*
2209
+ * As per Google's current implementation, there will be only one APF filter.
2210
+ * Therefore, userspace doesn't bother about filter id and because of that
2211
+ * DHD has to manage the filter id.
2212
+ */
2213
+#define PKT_FILTER_APF_ID 200
2214
+#define DHD_APF_LOCK(ndev) dhd_apf_lock(ndev)
2215
+#define DHD_APF_UNLOCK(ndev) dhd_apf_unlock(ndev)
2216
+
2217
+extern void dhd_apf_lock(struct net_device *dev);
2218
+extern void dhd_apf_unlock(struct net_device *dev);
2219
+extern int dhd_dev_apf_get_version(struct net_device *ndev, uint32 *version);
2220
+extern int dhd_dev_apf_get_max_len(struct net_device *ndev, uint32 *max_len);
2221
+extern int dhd_dev_apf_add_filter(struct net_device *ndev, u8* program,
2222
+ uint32 program_len);
2223
+extern int dhd_dev_apf_enable_filter(struct net_device *ndev);
2224
+extern int dhd_dev_apf_disable_filter(struct net_device *ndev);
2225
+extern int dhd_dev_apf_delete_filter(struct net_device *ndev);
2226
+#endif /* PKT_FILTER_SUPPORT && APF */
11052227
11062228 extern void dhd_timeout_start(dhd_timeout_t *tmo, uint usec);
11072229 extern int dhd_timeout_expired(dhd_timeout_t *tmo);
....@@ -1110,15 +2232,14 @@
11102232 extern int dhd_net2idx(struct dhd_info *dhd, struct net_device *net);
11112233 extern struct net_device * dhd_idx2net(void *pub, int ifidx);
11122234 extern int net_os_send_hang_message(struct net_device *dev);
2235
+extern int net_os_send_hang_message_reason(struct net_device *dev, const char *string_num);
11132236 extern bool dhd_wowl_cap(void *bus);
11142237 extern int wl_host_event(dhd_pub_t *dhd_pub, int *idx, void *pktdata, uint pktlen,
11152238 wl_event_msg_t *, void **data_ptr, void *);
1116
-
1117
-extern void wl_event_to_host_order(wl_event_msg_t * evt);
1118
-extern int wl_host_event_get_data(void *pktdata, uint pktlen, bcm_event_msg_u_t *evu);
11192239 extern int wl_process_host_event(dhd_pub_t *dhd_pub, int *idx, void *pktdata, uint pktlen,
11202240 wl_event_msg_t *, void **data_ptr, void *);
1121
-
2241
+extern void wl_event_to_host_order(wl_event_msg_t * evt);
2242
+extern int wl_host_event_get_data(void *pktdata, uint pktlen, bcm_event_msg_u_t *evu);
11222243 extern int dhd_wl_ioctl(dhd_pub_t *dhd_pub, int ifindex, wl_ioctl_t *ioc, void *buf, int len);
11232244 extern int dhd_wl_ioctl_cmd(dhd_pub_t *dhd_pub, int cmd, void *arg, int len, uint8 set,
11242245 int ifindex);
....@@ -1133,13 +2254,23 @@
11332254 char *name, uint8 *mac);
11342255 extern int dhd_event_ifdel(struct dhd_info *dhd, struct wl_event_data_if *ifevent,
11352256 char *name, uint8 *mac);
1136
-extern struct net_device* dhd_allocate_if(dhd_pub_t *dhdpub, int ifidx, char *name,
1137
- uint8 *mac, uint8 bssidx, bool need_rtnl_lock, char *dngl_name);
2257
+extern int dhd_event_ifchange(struct dhd_info *dhd, struct wl_event_data_if *ifevent,
2258
+ char *name, uint8 *mac);
2259
+extern struct net_device* dhd_allocate_if(dhd_pub_t *dhdpub, int ifidx, const char *name,
2260
+ uint8 *mac, uint8 bssidx, bool need_rtnl_lock, const char *dngl_name);
11382261 extern int dhd_remove_if(dhd_pub_t *dhdpub, int ifidx, bool need_rtnl_lock);
2262
+#ifdef WL_STATIC_IF
2263
+extern s32 dhd_update_iflist_info(dhd_pub_t *dhdp, struct net_device *ndev, int ifidx,
2264
+ uint8 *mac, uint8 bssidx, const char *dngl_name, int if_state);
2265
+#endif /* WL_STATIC_IF */
11392266 extern void dhd_vif_add(struct dhd_info *dhd, int ifidx, char * name);
11402267 extern void dhd_vif_del(struct dhd_info *dhd, int ifidx);
11412268 extern void dhd_event(struct dhd_info *dhd, char *evpkt, int evlen, int ifidx);
11422269 extern void dhd_vif_sendup(struct dhd_info *dhd, int ifidx, uchar *cp, int len);
2270
+
2271
+#ifdef WL_NATOE
2272
+extern int dhd_natoe_ct_event(dhd_pub_t *dhd, char *data);
2273
+#endif /* WL_NATOE */
11432274
11442275 /* Send packet to dongle via data channel */
11452276 extern int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, void *pkt);
....@@ -1151,6 +2282,9 @@
11512282 #ifdef LOG_INTO_TCPDUMP
11522283 extern void dhd_sendup_log(dhd_pub_t *dhdp, void *data, int len);
11532284 #endif /* LOG_INTO_TCPDUMP */
2285
+#ifdef SHOW_LOGTRACE
2286
+void dhd_sendup_info_buf(dhd_pub_t *dhdp, uint8 *msg);
2287
+#endif // endif
11542288 extern int dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag);
11552289 extern uint dhd_bus_status(dhd_pub_t *dhdp);
11562290 extern int dhd_bus_start(dhd_pub_t *dhdp);
....@@ -1158,12 +2292,13 @@
11582292 extern int dhd_bus_resume(dhd_pub_t *dhdpub, int stage);
11592293 extern int dhd_bus_membytes(dhd_pub_t *dhdp, bool set, uint32 address, uint8 *data, uint size);
11602294 extern void dhd_print_buf(void *pbuf, int len, int bytes_per_line);
1161
-extern bool dhd_is_associated(dhd_pub_t *dhd, void *bss_buf, int *retval);
2295
+extern bool dhd_is_associated(dhd_pub_t *dhd, uint8 ifidx, int *retval);
11622296 #if defined(BCMSDIO) || defined(BCMPCIE)
11632297 extern uint dhd_bus_chip_id(dhd_pub_t *dhdp);
11642298 extern uint dhd_bus_chiprev_id(dhd_pub_t *dhdp);
11652299 extern uint dhd_bus_chippkg_id(dhd_pub_t *dhdp);
11662300 #endif /* defined(BCMSDIO) || defined(BCMPCIE) */
2301
+int dhd_bus_get_fw_mode(dhd_pub_t *dhdp);
11672302
11682303 #if defined(KEEP_ALIVE)
11692304 extern int dhd_keep_alive_onoff(dhd_pub_t *dhd);
....@@ -1175,25 +2310,48 @@
11752310 extern unsigned long dhd_os_spin_lock(void *lock);
11762311 void dhd_os_spin_unlock(void *lock, unsigned long flags);
11772312
2313
+/* linux is defined for DHD EFI builds also,
2314
+* since its cross-compiled for EFI from linux.
2315
+* dbgring_lock apis are meant only for linux
2316
+* to use mutexes, other OSes will continue to
2317
+* use dhd_os_spin_lock
2318
+*/
2319
+void *dhd_os_dbgring_lock_init(osl_t *osh);
2320
+void dhd_os_dbgring_lock_deinit(osl_t *osh, void *mtx);
2321
+unsigned long dhd_os_dbgring_lock(void *lock);
2322
+void dhd_os_dbgring_unlock(void *lock, unsigned long flags);
2323
+
2324
+static INLINE int dhd_os_tput_test_wait(dhd_pub_t *pub, uint *condition,
2325
+ uint timeout_ms)
2326
+{ return 0; }
2327
+static INLINE int dhd_os_tput_test_wake(dhd_pub_t * pub)
2328
+{ return 0; }
2329
+
2330
+extern int dhd_os_busbusy_wait_negation(dhd_pub_t * pub, uint * condition);
2331
+extern int dhd_os_busbusy_wake(dhd_pub_t * pub);
2332
+extern void dhd_os_tx_completion_wake(dhd_pub_t *dhd);
2333
+extern int dhd_os_busbusy_wait_condition(dhd_pub_t *pub, uint *var, uint condition);
2334
+int dhd_os_busbusy_wait_bitmask(dhd_pub_t *pub, uint *var,
2335
+ uint bitmask, uint condition);
2336
+extern int dhd_os_d3ack_wait(dhd_pub_t * pub, uint * condition);
2337
+extern int dhd_os_d3ack_wake(dhd_pub_t * pub);
2338
+extern int dhd_os_dmaxfer_wait(dhd_pub_t *pub, uint *condition);
2339
+extern int dhd_os_dmaxfer_wake(dhd_pub_t *pub);
2340
+
11782341 /*
11792342 * Manage sta objects in an interface. Interface is identified by an ifindex and
11802343 * sta(s) within an interfaces are managed using a MacAddress of the sta.
11812344 */
11822345 struct dhd_sta;
2346
+extern bool dhd_sta_associated(dhd_pub_t *dhdp, uint32 bssidx, uint8 *mac);
11832347 extern struct dhd_sta *dhd_find_sta(void *pub, int ifidx, void *ea);
11842348 extern struct dhd_sta *dhd_findadd_sta(void *pub, int ifidx, void *ea);
2349
+extern void dhd_del_all_sta(void *pub, int ifidx);
11852350 extern void dhd_del_sta(void *pub, int ifidx, void *ea);
11862351 extern int dhd_get_ap_isolate(dhd_pub_t *dhdp, uint32 idx);
11872352 extern int dhd_set_ap_isolate(dhd_pub_t *dhdp, uint32 idx, int val);
1188
-#if defined(BCM_GMAC3)
1189
-extern int dhd_set_dev_def(dhd_pub_t *dhdp, uint32 idx, int val);
1190
-#endif
11912353 extern int dhd_bssidx2idx(dhd_pub_t *dhdp, uint32 bssidx);
1192
-extern int dhd_os_d3ack_wait(dhd_pub_t * pub, uint * condition);
1193
-extern int dhd_os_d3ack_wake(dhd_pub_t * pub);
11942354 extern struct net_device *dhd_linux_get_primary_netdev(dhd_pub_t *dhdp);
1195
-extern int dhd_os_busbusy_wait_negation(dhd_pub_t * pub, uint * condition);
1196
-extern int dhd_os_busbusy_wake(dhd_pub_t * pub);
11972355
11982356 extern bool dhd_is_concurrent_mode(dhd_pub_t *dhd);
11992357 int dhd_iovar(dhd_pub_t *pub, int ifidx, char *name, char *param_buf, uint param_len,
....@@ -1204,7 +2362,7 @@
12042362 #ifdef DHD_MCAST_REGEN
12052363 extern int dhd_get_mcast_regen_bss_enable(dhd_pub_t *dhdp, uint32 idx);
12062364 extern int dhd_set_mcast_regen_bss_enable(dhd_pub_t *dhdp, uint32 idx, int val);
1207
-#endif
2365
+#endif // endif
12082366 typedef enum cust_gpio_modes {
12092367 WLAN_RESET_ON,
12102368 WLAN_RESET_OFF,
....@@ -1212,18 +2370,34 @@
12122370 WLAN_POWER_OFF
12132371 } cust_gpio_modes_t;
12142372
2373
+typedef struct dmaxref_mem_map {
2374
+ dhd_dma_buf_t *srcmem;
2375
+ dhd_dma_buf_t *dstmem;
2376
+} dmaxref_mem_map_t;
2377
+
2378
+#if defined(OEM_ANDROID)
12152379 extern int wl_iw_iscan_set_scan_broadcast_prep(struct net_device *dev, uint flag);
12162380 extern int wl_iw_send_priv_event(struct net_device *dev, char *flag);
2381
+#endif /* defined(OEM_ANDROID) */
2382
+
2383
+#ifdef DHD_PCIE_NATIVE_RUNTIMEPM
2384
+extern void dhd_flush_rx_tx_wq(dhd_pub_t *dhdp);
2385
+#endif /* DHD_PCIE_NATIVE_RUNTIMEPM */
2386
+
12172387 /*
12182388 * Insmod parameters for debug/test
12192389 */
12202390
12212391 /* Watchdog timer interval */
12222392 extern uint dhd_watchdog_ms;
2393
+#ifdef DHD_PCIE_RUNTIMEPM
2394
+extern uint dhd_runtimepm_ms;
2395
+#endif /* DHD_PCIE_RUNTIMEPM */
2396
+
2397
+/** Default console output poll interval */
2398
+extern uint dhd_console_ms;
12232399
12242400 #if defined(DHD_DEBUG)
1225
-/* Console output poll interval */
1226
-extern uint dhd_console_ms;
12272401 extern uint wl_msg_level;
12282402 #endif /* defined(DHD_DEBUG) */
12292403
....@@ -1256,6 +2430,14 @@
12562430 /* Roaming mode control */
12572431 extern uint dhd_radio_up;
12582432
2433
+/* TCM verification control */
2434
+extern uint dhd_tcm_test_enable;
2435
+
2436
+/* Disable BUG_ON(1) */
2437
+#ifdef DHD_FW_COREDUMP
2438
+extern uint disable_bug_on;
2439
+#endif /* DHD_FW_COREDUMP */
2440
+
12592441 /* Initial idletime ticks (may be -1 for immediate idle, 0 for no idle) */
12602442 extern int dhd_idletime;
12612443 #ifdef DHD_USE_IDLECOUNT
....@@ -1272,6 +2454,13 @@
12722454
12732455 /* Override to force tx queueing all the time */
12742456 extern uint dhd_force_tx_queueing;
2457
+
2458
+/* Default bcn_timeout value is 4 */
2459
+#define DEFAULT_BCN_TIMEOUT_VALUE 4
2460
+#ifndef CUSTOM_BCN_TIMEOUT_SETTING
2461
+#define CUSTOM_BCN_TIMEOUT_SETTING DEFAULT_BCN_TIMEOUT_VALUE
2462
+#endif // endif
2463
+
12752464 /* Default KEEP_ALIVE Period is 55 sec to prevent AP from sending Keep Alive probe frame */
12762465 #define DEFAULT_KEEP_ALIVE_VALUE 55000 /* msec */
12772466 #ifndef CUSTOM_KEEP_ALIVE_SETTING
....@@ -1284,21 +2473,21 @@
12842473 #define DEFAULT_GLOM_VALUE -1
12852474 #ifndef CUSTOM_GLOM_SETTING
12862475 #define CUSTOM_GLOM_SETTING DEFAULT_GLOM_VALUE
1287
-#endif
2476
+#endif // endif
12882477 #define WL_AUTO_ROAM_TRIGGER -75
12892478 /* hooks for custom Roaming Trigger setting via Makefile */
12902479 #define DEFAULT_ROAM_TRIGGER_VALUE -75 /* dBm default roam trigger all band */
12912480 #define DEFAULT_ROAM_TRIGGER_SETTING -1
12922481 #ifndef CUSTOM_ROAM_TRIGGER_SETTING
12932482 #define CUSTOM_ROAM_TRIGGER_SETTING DEFAULT_ROAM_TRIGGER_VALUE
1294
-#endif
2483
+#endif // endif
12952484
12962485 /* hooks for custom Roaming Romaing setting via Makefile */
12972486 #define DEFAULT_ROAM_DELTA_VALUE 10 /* dBm default roam delta all band */
12982487 #define DEFAULT_ROAM_DELTA_SETTING -1
12992488 #ifndef CUSTOM_ROAM_DELTA_SETTING
13002489 #define CUSTOM_ROAM_DELTA_SETTING DEFAULT_ROAM_DELTA_VALUE
1301
-#endif
2490
+#endif // endif
13022491
13032492 /* hooks for custom PNO Event wake lock to guarantee enough time
13042493 for the Platform to detect Event before system suspended
....@@ -1306,12 +2495,12 @@
13062495 #define DEFAULT_PNO_EVENT_LOCK_xTIME 2 /* multiplay of DHD_PACKET_TIMEOUT_MS */
13072496 #ifndef CUSTOM_PNO_EVENT_LOCK_xTIME
13082497 #define CUSTOM_PNO_EVENT_LOCK_xTIME DEFAULT_PNO_EVENT_LOCK_xTIME
1309
-#endif
2498
+#endif // endif
13102499 /* hooks for custom dhd_dpc_prio setting option via Makefile */
13112500 #define DEFAULT_DHP_DPC_PRIO 1
13122501 #ifndef CUSTOM_DPC_PRIO_SETTING
13132502 #define CUSTOM_DPC_PRIO_SETTING DEFAULT_DHP_DPC_PRIO
1314
-#endif
2503
+#endif // endif
13152504
13162505 #ifndef CUSTOM_LISTEN_INTERVAL
13172506 #define CUSTOM_LISTEN_INTERVAL LISTEN_INTERVAL
....@@ -1320,14 +2509,22 @@
13202509 #define DEFAULT_SUSPEND_BCN_LI_DTIM 3
13212510 #ifndef CUSTOM_SUSPEND_BCN_LI_DTIM
13222511 #define CUSTOM_SUSPEND_BCN_LI_DTIM DEFAULT_SUSPEND_BCN_LI_DTIM
1323
-#endif
2512
+#endif // endif
2513
+
2514
+#ifdef OEM_ANDROID
2515
+#ifndef BCN_TIMEOUT_IN_SUSPEND
2516
+#define BCN_TIMEOUT_IN_SUSPEND 6 /* bcn timeout value in suspend mode */
2517
+#endif // endif
2518
+#endif /* OEM_ANDROID */
13242519
13252520 #ifndef CUSTOM_RXF_PRIO_SETTING
13262521 #define CUSTOM_RXF_PRIO_SETTING MAX((CUSTOM_DPC_PRIO_SETTING - 1), 1)
1327
-#endif
2522
+#endif // endif
13282523
13292524 #define DEFAULT_WIFI_TURNOFF_DELAY 0
2525
+#ifndef WIFI_TURNOFF_DELAY
13302526 #define WIFI_TURNOFF_DELAY DEFAULT_WIFI_TURNOFF_DELAY
2527
+#endif /* WIFI_TURNOFF_DELAY */
13312528
13322529 #define DEFAULT_WIFI_TURNON_DELAY 200
13332530 #ifndef WIFI_TURNON_DELAY
....@@ -1344,28 +2541,55 @@
13442541 #define CUSTOM_ASSOC_RETRY_MAX DEFAULT_ASSOC_RETRY_MAX
13452542 #endif /* DEFAULT_ASSOC_RETRY_MAX */
13462543
2544
+#if defined(BCMSDIO) || defined(DISABLE_FRAMEBURST)
2545
+#define DEFAULT_FRAMEBURST_SET 0
2546
+#else
2547
+#define DEFAULT_FRAMEBURST_SET 1
2548
+#endif /* BCMSDIO */
2549
+
2550
+#ifndef CUSTOM_FRAMEBURST_SET
2551
+#define CUSTOM_FRAMEBURST_SET DEFAULT_FRAMEBURST_SET
2552
+#endif /* CUSTOM_FRAMEBURST_SET */
13472553
13482554 #ifdef WLTDLS
13492555 #ifndef CUSTOM_TDLS_IDLE_MODE_SETTING
13502556 #define CUSTOM_TDLS_IDLE_MODE_SETTING 60000 /* 60sec to tear down TDLS of not active */
1351
-#endif
2557
+#endif // endif
13522558 #ifndef CUSTOM_TDLS_RSSI_THRESHOLD_HIGH
13532559 #define CUSTOM_TDLS_RSSI_THRESHOLD_HIGH -70 /* rssi threshold for establishing TDLS link */
1354
-#endif
2560
+#endif // endif
13552561 #ifndef CUSTOM_TDLS_RSSI_THRESHOLD_LOW
13562562 #define CUSTOM_TDLS_RSSI_THRESHOLD_LOW -80 /* rssi threshold for tearing down TDLS link */
1357
-#endif
2563
+#endif // endif
2564
+#ifndef CUSTOM_TDLS_PCKTCNT_THRESHOLD_HIGH
2565
+#define CUSTOM_TDLS_PCKTCNT_THRESHOLD_HIGH 100 /* pkt/sec threshold for establishing TDLS link */
2566
+#endif // endif
2567
+#ifndef CUSTOM_TDLS_PCKTCNT_THRESHOLD_LOW
2568
+#define CUSTOM_TDLS_PCKTCNT_THRESHOLD_LOW 10 /* pkt/sec threshold for tearing down TDLS link */
2569
+#endif // endif
13582570 #endif /* WLTDLS */
13592571
1360
-#define DEFAULT_BCN_TIMEOUT 8
2572
+#if defined(VSDB) || defined(ROAM_ENABLE)
2573
+#define DEFAULT_BCN_TIMEOUT 8
2574
+#else
2575
+#define DEFAULT_BCN_TIMEOUT 4
2576
+#endif // endif
2577
+
13612578 #ifndef CUSTOM_BCN_TIMEOUT
1362
-#define CUSTOM_BCN_TIMEOUT DEFAULT_BCN_TIMEOUT
1363
-#endif
2579
+#define CUSTOM_BCN_TIMEOUT DEFAULT_BCN_TIMEOUT
2580
+#endif // endif
13642581
13652582 #define MAX_DTIM_SKIP_BEACON_INTERVAL 100 /* max allowed associated AP beacon for DTIM skip */
13662583 #ifndef MAX_DTIM_ALLOWED_INTERVAL
13672584 #define MAX_DTIM_ALLOWED_INTERVAL 600 /* max allowed total beacon interval for DTIM skip */
1368
-#endif
2585
+#endif // endif
2586
+
2587
+#ifdef OEM_ANDROID
2588
+#ifndef MIN_DTIM_FOR_ROAM_THRES_EXTEND
2589
+#define MIN_DTIM_FOR_ROAM_THRES_EXTEND 600 /* minimum dtim interval to extend roam threshold */
2590
+#endif // endif
2591
+#endif /* OEM_ANDROID */
2592
+
13692593 #define NO_DTIM_SKIP 1
13702594 #ifdef SDTEST
13712595 /* Echo packet generator (SDIO), pkts/s */
....@@ -1374,23 +2598,131 @@
13742598 /* Echo packet len (0 => sawtooth, max 1800) */
13752599 extern uint dhd_pktgen_len;
13762600 #define MAX_PKTGEN_LEN 1800
1377
-#endif
1378
-
2601
+#endif // endif
13792602
13802603 /* optionally set by a module_param_string() */
13812604 #define MOD_PARAM_PATHLEN 2048
13822605 #define MOD_PARAM_INFOLEN 512
2606
+#define MOD_PARAM_SRLEN 64
13832607
13842608 #ifdef SOFTAP
13852609 extern char fw_path2[MOD_PARAM_PATHLEN];
1386
-#endif
2610
+#endif // endif
2611
+
2612
+#if defined(ANDROID_PLATFORM_VERSION)
2613
+#if (ANDROID_PLATFORM_VERSION < 7)
2614
+#define DHD_LEGACY_FILE_PATH
2615
+#define VENDOR_PATH "/system"
2616
+#elif (ANDROID_PLATFORM_VERSION == 7)
2617
+#define VENDOR_PATH "/system"
2618
+#elif (ANDROID_PLATFORM_VERSION >= 8)
2619
+#define VENDOR_PATH "/vendor"
2620
+#endif /* ANDROID_PLATFORM_VERSION < 7 */
2621
+#else
2622
+#define VENDOR_PATH ""
2623
+#endif /* ANDROID_PLATFORM_VERSION */
2624
+
2625
+#if defined(ANDROID_PLATFORM_VERSION)
2626
+#if (ANDROID_PLATFORM_VERSION < 9)
2627
+#ifdef WL_STATIC_IF
2628
+#undef WL_STATIC_IF
2629
+#endif /* WL_STATIC_IF */
2630
+#ifdef WL_STATIC_IFNAME_PREFIX
2631
+#undef WL_STATIC_IFNAME_PREFIX
2632
+#endif /* WL_STATIC_IFNAME_PREFIX */
2633
+#endif /* ANDROID_PLATFORM_VERSION < 9 */
2634
+#endif /* ANDROID_PLATFORM_VERSION */
2635
+
2636
+#if defined(DHD_LEGACY_FILE_PATH)
2637
+#define PLATFORM_PATH "/data/"
2638
+#elif defined(PLATFORM_SLP)
2639
+#define PLATFORM_PATH "/opt/etc/"
2640
+#else
2641
+#if defined(ANDROID_PLATFORM_VERSION)
2642
+#if (ANDROID_PLATFORM_VERSION >= 9)
2643
+#define PLATFORM_PATH "/data/vendor/conn/"
2644
+#define DHD_MAC_ADDR_EXPORT
2645
+#define DHD_ADPS_BAM_EXPORT
2646
+#define DHD_EXPORT_CNTL_FILE
2647
+#define DHD_SOFTAP_DUAL_IF_INFO
2648
+#define DHD_SEND_HANG_PRIVCMD_ERRORS
2649
+#else
2650
+#define PLATFORM_PATH "/data/misc/conn/"
2651
+#endif /* ANDROID_PLATFORM_VERSION >= 9 */
2652
+#else
2653
+#define PLATFORM_PATH "/data/misc/conn/"
2654
+#endif /* ANDROID_PLATFORM_VERSION */
2655
+#endif /* DHD_LEGACY_FILE_PATH */
2656
+
2657
+#ifdef DHD_MAC_ADDR_EXPORT
2658
+extern struct ether_addr sysfs_mac_addr;
2659
+#endif /* DHD_MAC_ADDR_EXPORT */
13872660
13882661 /* Flag to indicate if we should download firmware on driver load */
13892662 extern uint dhd_download_fw_on_driverload;
1390
-#ifndef BCMDBUS
13912663 extern int allow_delay_fwdl;
1392
-#endif /* !BCMDBUS */
13932664
2665
+extern int dhd_process_cid_mac(dhd_pub_t *dhdp, bool prepost);
2666
+extern int dhd_write_file(const char *filepath, char *buf, int buf_len);
2667
+extern int dhd_read_file(const char *filepath, char *buf, int buf_len);
2668
+extern int dhd_write_file_and_check(const char *filepath, char *buf, int buf_len);
2669
+extern int dhd_file_delete(char *path);
2670
+
2671
+#ifdef READ_MACADDR
2672
+extern int dhd_set_macaddr_from_file(dhd_pub_t *dhdp);
2673
+#else
2674
+static INLINE int dhd_set_macaddr_from_file(dhd_pub_t *dhdp) { return 0; }
2675
+#endif /* READ_MACADDR */
2676
+#ifdef WRITE_MACADDR
2677
+extern int dhd_write_macaddr(struct ether_addr *mac);
2678
+#else
2679
+static INLINE int dhd_write_macaddr(struct ether_addr *mac) { return 0; }
2680
+#endif /* WRITE_MACADDR */
2681
+#ifdef USE_CID_CHECK
2682
+#define MAX_VNAME_LEN 64
2683
+#ifdef DHD_EXPORT_CNTL_FILE
2684
+extern char cidinfostr[MAX_VNAME_LEN];
2685
+#endif /* DHD_EXPORT_CNTL_FILE */
2686
+extern int dhd_check_module_cid(dhd_pub_t *dhdp);
2687
+extern char *dhd_get_cid_info(unsigned char *vid, int vid_length);
2688
+#else
2689
+static INLINE int dhd_check_module_cid(dhd_pub_t *dhdp) { return 0; }
2690
+#endif /* USE_CID_CHECK */
2691
+#ifdef GET_MAC_FROM_OTP
2692
+extern int dhd_check_module_mac(dhd_pub_t *dhdp);
2693
+#else
2694
+static INLINE int dhd_check_module_mac(dhd_pub_t *dhdp) { return 0; }
2695
+#endif /* GET_MAC_FROM_OTP */
2696
+
2697
+#if defined(READ_MACADDR) || defined(WRITE_MACADDR) || defined(USE_CID_CHECK) || \
2698
+ defined(GET_MAC_FROM_OTP)
2699
+#define DHD_USE_CISINFO
2700
+#endif /* READ_MACADDR || WRITE_MACADDR || USE_CID_CHECK || GET_MAC_FROM_OTP */
2701
+
2702
+#ifdef DHD_USE_CISINFO
2703
+int dhd_read_cis(dhd_pub_t *dhdp);
2704
+void dhd_clear_cis(dhd_pub_t *dhdp);
2705
+#if defined(SUPPORT_MULTIPLE_MODULE_CIS) && defined(USE_CID_CHECK)
2706
+extern int dhd_check_module_b85a(void);
2707
+extern int dhd_check_module_b90(void);
2708
+#define BCM4359_MODULE_TYPE_B90B 1
2709
+#define BCM4359_MODULE_TYPE_B90S 2
2710
+#endif /* defined(SUPPORT_MULTIPLE_MODULE_CIS) && defined(USE_CID_CHECK) */
2711
+#if defined(USE_CID_CHECK)
2712
+extern int dhd_check_module_bcm(char *module_type, int index, bool *is_murata_fem);
2713
+#endif /* defined(USE_CID_CHECK) */
2714
+#else
2715
+static INLINE int dhd_read_cis(dhd_pub_t *dhdp) { return 0; }
2716
+static INLINE void dhd_clear_cis(dhd_pub_t *dhdp) { }
2717
+#endif /* DHD_USE_CISINFO */
2718
+
2719
+#if defined(WL_CFG80211) && defined(SUPPORT_DEEP_SLEEP)
2720
+/* Flags to indicate if we distingish power off policy when
2721
+ * user set the memu "Keep Wi-Fi on during sleep" to "Never"
2722
+ */
2723
+extern int trigger_deep_sleep;
2724
+int dhd_deepsleep(struct net_device *dev, int flag);
2725
+#endif /* WL_CFG80211 && SUPPORT_DEEP_SLEEP */
13942726
13952727 extern void dhd_wait_for_event(dhd_pub_t *dhd, bool *lockvar);
13962728 extern void dhd_wait_event_wakeup(dhd_pub_t*dhd);
....@@ -1416,16 +2748,31 @@
14162748 int dhd_tdls_enable(struct net_device *dev, bool tdls_on, bool auto_on, struct ether_addr *mac);
14172749 int dhd_tdls_set_mode(dhd_pub_t *dhd, bool wfd_mode);
14182750 #ifdef PCIE_FULL_DONGLE
1419
-void dhd_tdls_update_peer_info(struct net_device *dev, bool connect_disconnect, uint8 *addr);
2751
+int dhd_tdls_update_peer_info(dhd_pub_t *dhdp, wl_event_msg_t *event);
2752
+int dhd_tdls_event_handler(dhd_pub_t *dhd_pub, wl_event_msg_t *event);
2753
+int dhd_free_tdls_peer_list(dhd_pub_t *dhd_pub);
14202754 #endif /* PCIE_FULL_DONGLE */
14212755 #endif /* WLTDLS */
2756
+
14222757 /* Neighbor Discovery Offload Support */
1423
-int dhd_ndo_enable(dhd_pub_t * dhd, int ndo_enable);
2758
+extern int dhd_ndo_enable(dhd_pub_t * dhd, int ndo_enable);
14242759 int dhd_ndo_add_ip(dhd_pub_t *dhd, char* ipaddr, int idx);
14252760 int dhd_ndo_remove_ip(dhd_pub_t *dhd, int idx);
2761
+
2762
+/* Enhanced ND offload support */
2763
+uint16 dhd_ndo_get_version(dhd_pub_t *dhdp);
2764
+int dhd_ndo_add_ip_with_type(dhd_pub_t *dhdp, char *ipv6addr, uint8 type, int idx);
2765
+int dhd_ndo_remove_ip_by_addr(dhd_pub_t *dhdp, char *ipv6addr, int idx);
2766
+int dhd_ndo_remove_ip_by_type(dhd_pub_t *dhdp, uint8 type, int idx);
2767
+int dhd_ndo_unsolicited_na_filter_enable(dhd_pub_t *dhdp, int enable);
2768
+
14262769 /* ioctl processing for nl80211 */
14272770 int dhd_ioctl_process(dhd_pub_t *pub, int ifidx, struct dhd_ioctl *ioc, void *data_buf);
14282771
2772
+#if defined(SUPPORT_MULTIPLE_REVISION)
2773
+extern int
2774
+concate_revision(struct dhd_bus *bus, char *fwpath, char *nvpath);
2775
+#endif /* SUPPORT_MULTIPLE_REVISION */
14292776 void dhd_bus_update_fw_nv_path(struct dhd_bus *bus, char *pfw_path, char *pnv_path);
14302777 void dhd_set_bus_state(void *bus, uint32 state);
14312778
....@@ -1439,17 +2786,16 @@
14392786 extern const uint8 prio2fifo[];
14402787 #endif /* PROP_TXSTATUS */
14412788
1442
-void dhd_save_fwdump(dhd_pub_t *dhd_pub, void * buffer, uint32 length);
1443
-void dhd_schedule_memdump(dhd_pub_t *dhdp, uint8 *buf, uint32 size);
14442789 int dhd_os_socram_dump(struct net_device *dev, uint32 *dump_size);
14452790 int dhd_os_get_socram_dump(struct net_device *dev, char **buf, uint32 *size);
14462791 int dhd_common_socram_dump(dhd_pub_t *dhdp);
1447
-int dhd_os_get_version(struct net_device *dev, bool dhd_ver, char **buf, uint32 size);
14482792
2793
+int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen);
2794
+
2795
+int dhd_os_get_version(struct net_device *dev, bool dhd_ver, char **buf, uint32 size);
2796
+void dhd_get_memdump_filename(struct net_device *ndev, char *memdump_path, int len, char *fname);
14492797 uint8* dhd_os_prealloc(dhd_pub_t *dhdpub, int section, uint size, bool kmalloc_if_fail);
14502798 void dhd_os_prefree(dhd_pub_t *dhdpub, void *addr, uint size);
1451
-
1452
-int dhd_process_cid_mac(dhd_pub_t *dhdp, bool prepost);
14532799
14542800 #if defined(CONFIG_DHD_USE_STATIC_BUF)
14552801 #define DHD_OS_PREALLOC(dhdpub, section, size) dhd_os_prealloc(dhdpub, section, size, FALSE)
....@@ -1459,6 +2805,38 @@
14592805 #define DHD_OS_PREFREE(dhdpub, addr, size) MFREE(dhdpub->osh, addr, size)
14602806 #endif /* defined(CONFIG_DHD_USE_STATIC_BUF) */
14612807
2808
+#ifdef USE_WFA_CERT_CONF
2809
+enum {
2810
+ SET_PARAM_BUS_TXGLOM_MODE,
2811
+ SET_PARAM_ROAMOFF,
2812
+#ifdef USE_WL_FRAMEBURST
2813
+ SET_PARAM_FRAMEBURST,
2814
+#endif /* USE_WL_FRAMEBURST */
2815
+#ifdef USE_WL_TXBF
2816
+ SET_PARAM_TXBF,
2817
+#endif /* USE_WL_TXBF */
2818
+#ifdef PROP_TXSTATUS
2819
+ SET_PARAM_PROPTX,
2820
+ SET_PARAM_PROPTXMODE,
2821
+#endif /* PROP_TXSTATUS */
2822
+ PARAM_LAST_VALUE
2823
+};
2824
+extern int sec_get_param_wfa_cert(dhd_pub_t *dhd, int mode, uint* read_val);
2825
+#ifdef DHD_EXPORT_CNTL_FILE
2826
+#define VALUENOTSET 0xFFFFFFFFu
2827
+extern uint32 bus_txglom;
2828
+extern uint32 roam_off;
2829
+#ifdef USE_WL_FRAMEBURST
2830
+extern uint32 frameburst;
2831
+#endif /* USE_WL_FRAMEBURST */
2832
+#ifdef USE_WL_TXBF
2833
+extern uint32 txbf;
2834
+#endif /* USE_WL_TXBF */
2835
+#ifdef PROP_TXSTATUS
2836
+extern uint32 proptx;
2837
+#endif /* PROP_TXSTATUS */
2838
+#endif /* DHD_EXPORT_CNTL_FILE */
2839
+#endif /* USE_WFA_CERT_CONF */
14622840
14632841 #define dhd_add_flowid(pub, ifidx, ac_prio, ea, flowid) do {} while (0)
14642842 #define dhd_del_flowid(pub, ifidx, flowid) do {} while (0)
....@@ -1481,6 +2859,10 @@
14812859 #define DHD_GENERAL_UNLOCK(dhdp, flags) \
14822860 dhd_os_general_spin_unlock((dhdp), (flags))
14832861
2862
+/* Enable DHD timer spin lock/unlock */
2863
+#define DHD_TIMER_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock)
2864
+#define DHD_TIMER_UNLOCK(lock, flags) dhd_os_spin_unlock(lock, (flags))
2865
+
14842866 /* Enable DHD flowring spin lock/unlock */
14852867 #define DHD_FLOWRING_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock)
14862868 #define DHD_FLOWRING_UNLOCK(lock, flags) dhd_os_spin_unlock((lock), (flags))
....@@ -1493,12 +2875,51 @@
14932875 #define DHD_FLOWRING_LIST_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock)
14942876 #define DHD_FLOWRING_LIST_UNLOCK(lock, flags) dhd_os_spin_unlock((lock), (flags))
14952877
2878
+#define DHD_SPIN_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock)
2879
+#define DHD_SPIN_UNLOCK(lock, flags) dhd_os_spin_unlock((lock), (flags))
2880
+
2881
+#define DHD_RING_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock)
2882
+#define DHD_RING_UNLOCK(lock, flags) dhd_os_spin_unlock((lock), (flags))
2883
+
2884
+#define DHD_BUS_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock)
2885
+#define DHD_BUS_UNLOCK(lock, flags) dhd_os_spin_unlock((lock), (flags))
2886
+
2887
+/* Enable DHD backplane spin lock/unlock */
2888
+#define DHD_BACKPLANE_ACCESS_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock)
2889
+#define DHD_BACKPLANE_ACCESS_UNLOCK(lock, flags) dhd_os_spin_unlock((lock), (flags))
2890
+
2891
+#define DHD_BUS_INB_DW_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock)
2892
+#define DHD_BUS_INB_DW_UNLOCK(lock, flags) dhd_os_spin_unlock((lock), (flags))
2893
+
2894
+/* Enable DHD TDLS peer list spin lock/unlock */
2895
+#ifdef WLTDLS
2896
+#define DHD_TDLS_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock)
2897
+#define DHD_TDLS_UNLOCK(lock, flags) dhd_os_spin_unlock((lock), (flags))
2898
+#endif /* WLTDLS */
2899
+
2900
+#define DHD_BUS_INB_DW_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock)
2901
+#define DHD_BUS_INB_DW_UNLOCK(lock, flags) dhd_os_spin_unlock((lock), (flags))
2902
+
2903
+#ifdef DBG_PKT_MON
2904
+/* Enable DHD PKT MON spin lock/unlock */
2905
+#define DHD_PKT_MON_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock)
2906
+#define DHD_PKT_MON_UNLOCK(lock, flags) dhd_os_spin_unlock(lock, (flags))
2907
+#endif /* DBG_PKT_MON */
2908
+
2909
+#define DHD_LINUX_GENERAL_LOCK(dhdp, flags) DHD_GENERAL_LOCK(dhdp, flags)
2910
+#define DHD_LINUX_GENERAL_UNLOCK(dhdp, flags) DHD_GENERAL_UNLOCK(dhdp, flags)
2911
+
2912
+/* linux is defined for DHD EFI builds also,
2913
+* since its cross-compiled for EFI from linux
2914
+*/
2915
+#define DHD_DBG_RING_LOCK_INIT(osh) dhd_os_dbgring_lock_init(osh)
2916
+#define DHD_DBG_RING_LOCK_DEINIT(osh, lock) dhd_os_dbgring_lock_deinit(osh, (lock))
2917
+#define DHD_DBG_RING_LOCK(lock, flags) (flags) = dhd_os_dbgring_lock(lock)
2918
+#define DHD_DBG_RING_UNLOCK(lock, flags) dhd_os_dbgring_unlock((lock), flags)
2919
+
14962920 extern void dhd_dump_to_kernelog(dhd_pub_t *dhdp);
14972921
1498
-#ifdef BCMDBUS
1499
-extern void dhd_bus_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf);
1500
-extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
1501
-#endif /* BCMDBUS */
2922
+extern void dhd_print_tasklet_status(dhd_pub_t *dhd);
15022923
15032924 #ifdef DHD_L2_FILTER
15042925 extern int dhd_get_parp_status(dhd_pub_t *dhdp, uint32 idx);
....@@ -1509,8 +2930,9 @@
15092930 extern int dhd_set_block_ping_status(dhd_pub_t *dhdp, uint32 idx, int val);
15102931 extern int dhd_get_grat_arp_status(dhd_pub_t *dhdp, uint32 idx);
15112932 extern int dhd_set_grat_arp_status(dhd_pub_t *dhdp, uint32 idx, int val);
2933
+extern int dhd_get_block_tdls_status(dhd_pub_t *dhdp, uint32 idx);
2934
+extern int dhd_set_block_tdls_status(dhd_pub_t *dhdp, uint32 idx, int val);
15122935 #endif /* DHD_L2_FILTER */
1513
-
15142936
15152937 typedef struct wl_io_pport {
15162938 dhd_pub_t *dhd_pub;
....@@ -1548,59 +2970,88 @@
15482970 #define RPS_CPUS_MASK_P2P "6"
15492971 #define RPS_CPUS_MASK_IBSS "6"
15502972 #endif /* CONFIG_MACH_UNIVERSAL5433 || CONFIG_MACH_UNIVERSAL7420 || CONFIG_SOC_EXYNOS8890 */
1551
-#endif
2973
+#endif // endif
15522974
15532975 int dhd_get_download_buffer(dhd_pub_t *dhd, char *file_path, download_type_t component,
15542976 char ** buffer, int *length);
15552977
15562978 void dhd_free_download_buffer(dhd_pub_t *dhd, void *buffer, int length);
15572979
1558
-/* blob support */
1559
-int dhd_download_clm_blob(dhd_pub_t *dhd, unsigned char *buf, uint32 len);
2980
+int dhd_download_blob(dhd_pub_t *dhd, unsigned char *buf,
2981
+ uint32 len, char *iovar);
15602982
2983
+int dhd_download_blob_cached(dhd_pub_t *dhd, char *file_path,
2984
+ uint32 len, char *iovar);
2985
+
2986
+int dhd_apply_default_txcap(dhd_pub_t *dhd, char *txcap_path);
15612987 int dhd_apply_default_clm(dhd_pub_t *dhd, char *clm_path);
2988
+
2989
+#ifdef SHOW_LOGTRACE
2990
+int dhd_parse_logstrs_file(osl_t *osh, char *raw_fmts, int logstrs_size,
2991
+ dhd_event_log_t *event_log);
2992
+int dhd_parse_map_file(osl_t *osh, void *file, uint32 *ramstart,
2993
+ uint32 *rodata_start, uint32 *rodata_end);
2994
+#ifdef PCIE_FULL_DONGLE
2995
+int dhd_event_logtrace_infobuf_pkt_process(dhd_pub_t *dhdp, void *pktbuf,
2996
+ dhd_event_log_t *event_data);
2997
+#endif /* PCIE_FULL_DONGLE */
2998
+#endif /* SHOW_LOGTRACE */
15622999
15633000 #define dhd_is_device_removed(x) FALSE
15643001 #define dhd_os_ind_firmware_stall(x)
15653002
15663003 #if defined(DHD_FW_COREDUMP)
15673004 extern void dhd_get_memdump_info(dhd_pub_t *dhd);
1568
-#endif
3005
+#endif /* defined(DHD_FW_COREDUMP) */
3006
+#ifdef BCMASSERT_LOG
3007
+extern void dhd_get_assert_info(dhd_pub_t *dhd);
3008
+#else
3009
+static INLINE void dhd_get_assert_info(dhd_pub_t *dhd) { }
3010
+#endif /* BCMASSERT_LOG */
15693011
3012
+#define DMAXFER_FREE(dhdp, dmap) dhd_schedule_dmaxfer_free(dhdp, dmap);
15703013
3014
+#if defined(PCIE_FULL_DONGLE)
3015
+extern void dmaxfer_free_prev_dmaaddr(dhd_pub_t *dhdp, dmaxref_mem_map_t *dmmap);
3016
+void dhd_schedule_dmaxfer_free(dhd_pub_t *dhdp, dmaxref_mem_map_t *dmmap);
3017
+#endif /* PCIE_FULL_DONGLE */
3018
+
3019
+#define DHD_LB_STATS_NOOP do { /* noop */ } while (0)
15713020 #if defined(DHD_LB_STATS)
15723021 #include <bcmutils.h>
15733022 extern void dhd_lb_stats_init(dhd_pub_t *dhd);
3023
+extern void dhd_lb_stats_deinit(dhd_pub_t *dhd);
15743024 extern void dhd_lb_stats_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf);
15753025 extern void dhd_lb_stats_update_napi_histo(dhd_pub_t *dhdp, uint32 count);
15763026 extern void dhd_lb_stats_update_txc_histo(dhd_pub_t *dhdp, uint32 count);
15773027 extern void dhd_lb_stats_update_rxc_histo(dhd_pub_t *dhdp, uint32 count);
15783028 extern void dhd_lb_stats_txc_percpu_cnt_incr(dhd_pub_t *dhdp);
15793029 extern void dhd_lb_stats_rxc_percpu_cnt_incr(dhd_pub_t *dhdp);
1580
-#define DHD_LB_STATS_INIT(dhdp) dhd_lb_stats_init(dhdp)
3030
+#define DHD_LB_STATS_INIT(dhdp) dhd_lb_stats_init(dhdp)
3031
+#define DHD_LB_STATS_DEINIT(dhdp) dhd_lb_stats_deinit(dhdp)
15813032 /* Reset is called from common layer so it takes dhd_pub_t as argument */
15823033 #define DHD_LB_STATS_RESET(dhdp) dhd_lb_stats_init(dhdp)
1583
-#define DHD_LB_STATS_CLR(x) (x) = 0U
1584
-#define DHD_LB_STATS_INCR(x) (x) = (x) + 1
1585
-#define DHD_LB_STATS_ADD(x, c) (x) = (x) + (c)
3034
+#define DHD_LB_STATS_CLR(x) (x) = 0U
3035
+#define DHD_LB_STATS_INCR(x) (x) = (x) + 1
3036
+#define DHD_LB_STATS_ADD(x, c) (x) = (x) + (c)
15863037 #define DHD_LB_STATS_PERCPU_ARR_INCR(x) \
15873038 { \
15883039 int cpu = get_cpu(); put_cpu(); \
15893040 DHD_LB_STATS_INCR(x[cpu]); \
15903041 }
1591
-#define DHD_LB_STATS_UPDATE_NAPI_HISTO(dhdp, x) dhd_lb_stats_update_napi_histo(dhdp, x)
1592
-#define DHD_LB_STATS_UPDATE_TXC_HISTO(dhdp, x) dhd_lb_stats_update_txc_histo(dhdp, x)
1593
-#define DHD_LB_STATS_UPDATE_RXC_HISTO(dhdp, x) dhd_lb_stats_update_rxc_histo(dhdp, x)
1594
-#define DHD_LB_STATS_TXC_PERCPU_CNT_INCR(dhdp) dhd_lb_stats_txc_percpu_cnt_incr(dhdp)
1595
-#define DHD_LB_STATS_RXC_PERCPU_CNT_INCR(dhdp) dhd_lb_stats_rxc_percpu_cnt_incr(dhdp)
3042
+#define DHD_LB_STATS_UPDATE_NAPI_HISTO(dhdp, x) dhd_lb_stats_update_napi_histo(dhdp, x)
3043
+#define DHD_LB_STATS_UPDATE_TXC_HISTO(dhdp, x) dhd_lb_stats_update_txc_histo(dhdp, x)
3044
+#define DHD_LB_STATS_UPDATE_RXC_HISTO(dhdp, x) dhd_lb_stats_update_rxc_histo(dhdp, x)
3045
+#define DHD_LB_STATS_TXC_PERCPU_CNT_INCR(dhdp) dhd_lb_stats_txc_percpu_cnt_incr(dhdp)
3046
+#define DHD_LB_STATS_RXC_PERCPU_CNT_INCR(dhdp) dhd_lb_stats_rxc_percpu_cnt_incr(dhdp)
15963047 #else /* !DHD_LB_STATS */
1597
-#define DHD_LB_STATS_NOOP do { /* noop */ } while (0)
1598
-#define DHD_LB_STATS_INIT(dhdp) DHD_LB_STATS_NOOP
3048
+#define DHD_LB_STATS_INIT(dhdp) DHD_LB_STATS_NOOP
3049
+#define DHD_LB_STATS_DEINIT(dhdp) DHD_LB_STATS_NOOP
15993050 #define DHD_LB_STATS_RESET(dhdp) DHD_LB_STATS_NOOP
1600
-#define DHD_LB_STATS_CLR(x) DHD_LB_STATS_NOOP
1601
-#define DHD_LB_STATS_INCR(x) DHD_LB_STATS_NOOP
1602
-#define DHD_LB_STATS_ADD(x, c) DHD_LB_STATS_NOOP
1603
-#define DHD_LB_STATS_PERCPU_ARR_INCR(x) DHD_LB_STATS_NOOP
3051
+#define DHD_LB_STATS_CLR(x) DHD_LB_STATS_NOOP
3052
+#define DHD_LB_STATS_INCR(x) DHD_LB_STATS_NOOP
3053
+#define DHD_LB_STATS_ADD(x, c) DHD_LB_STATS_NOOP
3054
+#define DHD_LB_STATS_PERCPU_ARR_INCR(x) DHD_LB_STATS_NOOP
16043055 #define DHD_LB_STATS_UPDATE_NAPI_HISTO(dhd, x) DHD_LB_STATS_NOOP
16053056 #define DHD_LB_STATS_UPDATE_TXC_HISTO(dhd, x) DHD_LB_STATS_NOOP
16063057 #define DHD_LB_STATS_UPDATE_RXC_HISTO(dhd, x) DHD_LB_STATS_NOOP
....@@ -1608,13 +3059,433 @@
16083059 #define DHD_LB_STATS_RXC_PERCPU_CNT_INCR(dhdp) DHD_LB_STATS_NOOP
16093060 #endif /* !DHD_LB_STATS */
16103061
3062
+#ifdef DHD_SSSR_DUMP
3063
+#define DHD_SSSR_MEMPOOL_SIZE (2 * 1024 * 1024) /* 2MB size */
3064
+
3065
+/* used in sssr_dump_mode */
3066
+#define SSSR_DUMP_MODE_SSSR 0 /* dump both *before* and *after* files */
3067
+#define SSSR_DUMP_MODE_FIS 1 /* dump *after* files only */
3068
+
3069
+extern int dhd_sssr_mempool_init(dhd_pub_t *dhd);
3070
+extern void dhd_sssr_mempool_deinit(dhd_pub_t *dhd);
3071
+extern int dhd_sssr_dump_init(dhd_pub_t *dhd);
3072
+extern void dhd_sssr_dump_deinit(dhd_pub_t *dhd);
3073
+extern int dhdpcie_sssr_dump(dhd_pub_t *dhd);
3074
+extern void dhd_sssr_print_filepath(dhd_pub_t *dhd, char *path);
3075
+
3076
+#define DHD_SSSR_MEMPOOL_INIT(dhdp) dhd_sssr_mempool_init(dhdp)
3077
+#define DHD_SSSR_MEMPOOL_DEINIT(dhdp) dhd_sssr_mempool_deinit(dhdp)
3078
+#define DHD_SSSR_DUMP_INIT(dhdp) dhd_sssr_dump_init(dhdp)
3079
+#define DHD_SSSR_DUMP_DEINIT(dhdp) dhd_sssr_dump_deinit(dhdp)
3080
+#define DHD_SSSR_PRINT_FILEPATH(dhdp, path) dhd_sssr_print_filepath(dhdp, path)
3081
+#else
3082
+#define DHD_SSSR_MEMPOOL_INIT(dhdp) do { /* noop */ } while (0)
3083
+#define DHD_SSSR_MEMPOOL_DEINIT(dhdp) do { /* noop */ } while (0)
3084
+#define DHD_SSSR_DUMP_INIT(dhdp) do { /* noop */ } while (0)
3085
+#define DHD_SSSR_DUMP_DEINIT(dhdp) do { /* noop */ } while (0)
3086
+#define DHD_SSSR_PRINT_FILEPATH(dhdp, path) do { /* noop */ } while (0)
3087
+#endif /* DHD_SSSR_DUMP */
3088
+
3089
+#ifdef BCMPCIE
16113090 extern int dhd_prot_debug_info_print(dhd_pub_t *dhd);
3091
+extern bool dhd_bus_skip_clm(dhd_pub_t *dhdp);
3092
+extern void dhd_pcie_dump_rc_conf_space_cap(dhd_pub_t *dhd);
3093
+extern bool dhd_pcie_dump_int_regs(dhd_pub_t *dhd);
3094
+#else
3095
+#define dhd_prot_debug_info_print(x)
3096
+static INLINE bool dhd_bus_skip_clm(dhd_pub_t *dhd_pub)
3097
+{ return 0; }
3098
+#endif /* BCMPCIE */
16123099
1613
-#define htod32(i) (i)
1614
-#define htod16(i) (i)
1615
-#define dtoh32(i) (i)
1616
-#define dtoh16(i) (i)
1617
-#define htodchanspec(i) (i)
1618
-#define dtohchanspec(i) (i)
3100
+fw_download_status_t dhd_fw_download_status(dhd_pub_t * dhd_pub);
3101
+void dhd_show_kirqstats(dhd_pub_t *dhd);
16193102
3103
+/* Bitmask used for Join Timeout */
3104
+#define WLC_SSID_MASK 0x01
3105
+#define WLC_WPA_MASK 0x02
3106
+
3107
+extern int dhd_start_join_timer(dhd_pub_t *pub);
3108
+extern int dhd_stop_join_timer(dhd_pub_t *pub);
3109
+extern int dhd_start_scan_timer(dhd_pub_t *pub, bool is_escan);
3110
+extern int dhd_stop_scan_timer(dhd_pub_t *pub, bool is_escan, uint16 sync_id);
3111
+extern int dhd_start_cmd_timer(dhd_pub_t *pub);
3112
+extern int dhd_stop_cmd_timer(dhd_pub_t *pub);
3113
+extern int dhd_start_bus_timer(dhd_pub_t *pub);
3114
+extern int dhd_stop_bus_timer(dhd_pub_t *pub);
3115
+extern uint16 dhd_get_request_id(dhd_pub_t *pub);
3116
+extern int dhd_set_request_id(dhd_pub_t *pub, uint16 id, uint32 cmd);
3117
+extern void dhd_set_join_error(dhd_pub_t *pub, uint32 mask);
3118
+extern void dhd_clear_join_error(dhd_pub_t *pub, uint32 mask);
3119
+extern void dhd_get_scan_to_val(dhd_pub_t *pub, uint32 *to_val);
3120
+extern void dhd_set_scan_to_val(dhd_pub_t *pub, uint32 to_val);
3121
+extern void dhd_get_join_to_val(dhd_pub_t *pub, uint32 *to_val);
3122
+extern void dhd_set_join_to_val(dhd_pub_t *pub, uint32 to_val);
3123
+extern void dhd_get_cmd_to_val(dhd_pub_t *pub, uint32 *to_val);
3124
+extern void dhd_set_cmd_to_val(dhd_pub_t *pub, uint32 to_val);
3125
+extern void dhd_get_bus_to_val(dhd_pub_t *pub, uint32 *to_val);
3126
+extern void dhd_set_bus_to_val(dhd_pub_t *pub, uint32 to_val);
3127
+extern int dhd_start_timesync_timer(dhd_pub_t *pub);
3128
+extern int dhd_stop_timesync_timer(dhd_pub_t *pub);
3129
+
3130
+#ifdef DHD_PKTID_AUDIT_ENABLED
3131
+void dhd_pktid_error_handler(dhd_pub_t *dhdp);
3132
+#endif /* DHD_PKTID_AUDIT_ENABLED */
3133
+
3134
+#ifdef DHD_MAP_PKTID_LOGGING
3135
+extern void dhd_pktid_logging_dump(dhd_pub_t *dhdp);
3136
+#endif /* DHD_MAP_PKTID_LOGGING */
3137
+
3138
+#ifdef DHD_PCIE_RUNTIMEPM
3139
+extern bool dhd_runtimepm_state(dhd_pub_t *dhd);
3140
+extern bool dhd_runtime_bus_wake(struct dhd_bus *bus, bool wait, void *func_addr);
3141
+extern bool dhdpcie_runtime_bus_wake(dhd_pub_t *dhdp, bool wait, void *func_addr);
3142
+extern void dhdpcie_block_runtime_pm(dhd_pub_t *dhdp);
3143
+extern bool dhdpcie_is_resume_done(dhd_pub_t *dhdp);
3144
+extern void dhd_runtime_pm_disable(dhd_pub_t *dhdp);
3145
+extern void dhd_runtime_pm_enable(dhd_pub_t *dhdp);
3146
+/* Disable the Runtime PM and wake up if the bus is already in suspend */
3147
+#define DHD_DISABLE_RUNTIME_PM(dhdp) \
3148
+do { \
3149
+ dhd_runtime_pm_disable(dhdp); \
3150
+} while (0);
3151
+
3152
+/* Enable the Runtime PM */
3153
+#define DHD_ENABLE_RUNTIME_PM(dhdp) \
3154
+do { \
3155
+ dhd_runtime_pm_enable(dhdp); \
3156
+} while (0);
3157
+#else
3158
+#define DHD_DISABLE_RUNTIME_PM(dhdp)
3159
+#define DHD_ENABLE_RUNTIME_PM(dhdp)
3160
+#endif /* DHD_PCIE_RUNTIMEPM */
3161
+
3162
+#ifdef REVERSE_AIFSN
3163
+extern int check_reverse_aifsn_condition(dhd_pub_t *dhdp, struct net_device *ndev);
3164
+
3165
+#define DHD_REVERSE_AIFSN(dhdp, ndev) \
3166
+do { \
3167
+ check_reverse_aifsn_condition(dhdp, ndev); \
3168
+} while (0);
3169
+#else
3170
+#define DHD_REVERSE_AIFSN(dhdp, ndev)
3171
+#endif /* AIFSN_REVERSE */
3172
+
3173
+extern bool dhd_prot_is_cmpl_ring_empty(dhd_pub_t *dhd, void *prot_info);
3174
+extern void dhd_prot_dump_ring_ptrs(void *prot_info);
3175
+
3176
+#if defined(DHD_TRACE_WAKE_LOCK)
3177
+void dhd_wk_lock_stats_dump(dhd_pub_t *dhdp);
3178
+#endif // endif
3179
+
3180
+extern bool dhd_query_bus_erros(dhd_pub_t *dhdp);
3181
+void dhd_clear_bus_errors(dhd_pub_t *dhdp);
3182
+
3183
+#if defined(CONFIG_64BIT)
3184
+#define DHD_SUPPORT_64BIT
3185
+#endif /* (linux || LINUX) && CONFIG_64BIT */
3186
+
3187
+#if defined(DHD_ERPOM)
3188
+extern void dhd_schedule_reset(dhd_pub_t *dhdp);
3189
+#else
3190
+static INLINE void dhd_schedule_reset(dhd_pub_t *dhdp) {;}
3191
+#endif // endif
3192
+
3193
+extern void init_dhd_timeouts(dhd_pub_t *pub);
3194
+extern void deinit_dhd_timeouts(dhd_pub_t *pub);
3195
+
3196
+typedef enum timeout_resons {
3197
+ DHD_REASON_COMMAND_TO,
3198
+ DHD_REASON_JOIN_TO,
3199
+ DHD_REASON_SCAN_TO,
3200
+ DHD_REASON_OQS_TO
3201
+} timeout_reasons_t;
3202
+
3203
+extern void dhd_prhex(const char *msg, volatile uchar *buf, uint nbytes, uint8 dbg_level);
3204
+int dhd_tput_test(dhd_pub_t *dhd, tput_test_t *tput_data);
3205
+void dhd_tput_test_rx(dhd_pub_t *dhd, void *pkt);
3206
+static INLINE int dhd_get_max_txbufs(dhd_pub_t *dhdp)
3207
+{ return -1; }
3208
+
3209
+#ifdef FILTER_IE
3210
+int dhd_read_from_file(dhd_pub_t *dhd);
3211
+int dhd_parse_filter_ie(dhd_pub_t *dhd, uint8 *buf);
3212
+int dhd_get_filter_ie_count(dhd_pub_t *dhd, uint8 *buf);
3213
+int dhd_parse_oui(dhd_pub_t *dhd, uint8 *inbuf, uint8 *oui, int len);
3214
+int dhd_check_valid_ie(dhd_pub_t *dhdp, uint8 *buf, int len);
3215
+#endif /* FILTER_IE */
3216
+
3217
+uint16 dhd_prot_get_ioctl_trans_id(dhd_pub_t *dhdp);
3218
+
3219
+#ifdef SET_PCIE_IRQ_CPU_CORE
3220
+enum {
3221
+ PCIE_IRQ_AFFINITY_OFF = 0,
3222
+ PCIE_IRQ_AFFINITY_BIG_CORE_ANY,
3223
+ PCIE_IRQ_AFFINITY_BIG_CORE_EXYNOS,
3224
+ PCIE_IRQ_AFFINITY_LAST
3225
+};
3226
+extern void dhd_set_irq_cpucore(dhd_pub_t *dhdp, int affinity_cmd);
3227
+#endif /* SET_PCIE_IRQ_CPU_CORE */
3228
+
3229
+#if defined(DHD_HANG_SEND_UP_TEST)
3230
+extern void dhd_make_hang_with_reason(struct net_device *dev, const char *string_num);
3231
+#endif /* DHD_HANG_SEND_UP_TEST */
3232
+
3233
+#ifdef DHD_RND_DEBUG
3234
+int dhd_dump_rnd_info(dhd_pub_t *dhd, uint8 *rnd_buf, uint32 rnd_len);
3235
+int dhd_get_rnd_info(dhd_pub_t *dhd);
3236
+#endif /* DHD_RND_DEBUG */
3237
+
3238
+#ifdef DHD_WAKE_STATUS
3239
+wake_counts_t* dhd_get_wakecount(dhd_pub_t *dhdp);
3240
+#endif /* DHD_WAKE_STATUS */
3241
+extern int dhd_get_random_bytes(uint8 *buf, uint len);
3242
+#if defined(DHD_BLOB_EXISTENCE_CHECK)
3243
+extern void dhd_set_blob_support(dhd_pub_t *dhdp, char *fw_path);
3244
+#endif /* DHD_BLOB_EXISTENCE_CHECK */
3245
+
3246
+/* configuration of ecounters. API's tp start/stop. currently supported only for linux */
3247
+extern int dhd_ecounter_configure(dhd_pub_t *dhd, bool enable);
3248
+extern int dhd_start_ecounters(dhd_pub_t *dhd);
3249
+extern int dhd_stop_ecounters(dhd_pub_t *dhd);
3250
+extern int dhd_start_event_ecounters(dhd_pub_t *dhd);
3251
+extern int dhd_stop_event_ecounters(dhd_pub_t *dhd);
3252
+
3253
+int dhd_get_preserve_log_numbers(dhd_pub_t *dhd, uint32 *logset_mask);
3254
+
3255
+#ifdef DHD_LOG_DUMP
3256
+void dhd_schedule_log_dump(dhd_pub_t *dhdp, void *type);
3257
+void dhd_log_dump_trigger(dhd_pub_t *dhdp, int subcmd);
3258
+int dhd_log_dump_ring_to_file(dhd_pub_t *dhdp, void *ring_ptr, void *file,
3259
+ unsigned long *file_posn, log_dump_section_hdr_t *sec_hdr, char *text_hdr,
3260
+ uint32 sec_type);
3261
+int dhd_dump_debug_ring(dhd_pub_t *dhdp, void *ring_ptr, const void *user_buf,
3262
+ log_dump_section_hdr_t *sec_hdr, char *text_hdr, int buflen, uint32 sec_type);
3263
+int dhd_log_dump_cookie_to_file(dhd_pub_t *dhdp, void *fp,
3264
+ const void *user_buf, unsigned long *f_pos);
3265
+int dhd_log_dump_cookie(dhd_pub_t *dhdp, const void *user_buf);
3266
+uint32 dhd_log_dump_cookie_len(dhd_pub_t *dhdp);
3267
+int dhd_logdump_cookie_init(dhd_pub_t *dhdp, uint8 *buf, uint32 buf_size);
3268
+void dhd_logdump_cookie_deinit(dhd_pub_t *dhdp);
3269
+void dhd_logdump_cookie_save(dhd_pub_t *dhdp, char *cookie, char *type);
3270
+int dhd_logdump_cookie_get(dhd_pub_t *dhdp, char *ret_cookie, uint32 buf_size);
3271
+int dhd_logdump_cookie_count(dhd_pub_t *dhdp);
3272
+int dhd_get_dld_log_dump(void *dev, dhd_pub_t *dhdp, const void *user_buf, void *fp,
3273
+ uint32 len, int type, void *pos);
3274
+int dhd_print_ext_trap_data(void *dev, dhd_pub_t *dhdp, const void *user_buf,
3275
+ void *fp, uint32 len, void *pos);
3276
+int dhd_print_dump_data(void *dev, dhd_pub_t *dhdp, const void *user_buf,
3277
+ void *fp, uint32 len, void *pos);
3278
+int dhd_print_cookie_data(void *dev, dhd_pub_t *dhdp, const void *user_buf,
3279
+ void *fp, uint32 len, void *pos);
3280
+int dhd_print_health_chk_data(void *dev, dhd_pub_t *dhdp, const void *user_buf,
3281
+ void *fp, uint32 len, void *pos);
3282
+int dhd_print_time_str(const void *user_buf, void *fp, uint32 len, void *pos);
3283
+#ifdef DHD_DUMP_PCIE_RINGS
3284
+int dhd_print_flowring_data(void *dev, dhd_pub_t *dhdp, const void *user_buf,
3285
+ void *fp, uint32 len, void *pos);
3286
+uint32 dhd_get_flowring_len(void *ndev, dhd_pub_t *dhdp);
3287
+#endif /* DHD_DUMP_PCIE_RINGS */
3288
+#ifdef DHD_STATUS_LOGGING
3289
+extern int dhd_print_status_log_data(void *dev, dhd_pub_t *dhdp,
3290
+ const void *user_buf, void *fp, uint32 len, void *pos);
3291
+extern uint32 dhd_get_status_log_len(void *ndev, dhd_pub_t *dhdp);
3292
+#endif /* DHD_STATUS_LOGGING */
3293
+int dhd_print_ecntrs_data(void *dev, dhd_pub_t *dhdp, const void *user_buf,
3294
+ void *fp, uint32 len, void *pos);
3295
+int dhd_print_rtt_data(void *dev, dhd_pub_t *dhdp, const void *user_buf,
3296
+ void *fp, uint32 len, void *pos);
3297
+int dhd_get_debug_dump_file_name(void *dev, dhd_pub_t *dhdp,
3298
+ char *dump_path, int size);
3299
+uint32 dhd_get_ext_trap_len(void *ndev, dhd_pub_t *dhdp);
3300
+uint32 dhd_get_time_str_len(void);
3301
+uint32 dhd_get_health_chk_len(void *ndev, dhd_pub_t *dhdp);
3302
+uint32 dhd_get_dhd_dump_len(void *ndev, dhd_pub_t *dhdp);
3303
+uint32 dhd_get_cookie_log_len(void *ndev, dhd_pub_t *dhdp);
3304
+uint32 dhd_get_ecntrs_len(void *ndev, dhd_pub_t *dhdp);
3305
+uint32 dhd_get_rtt_len(void *ndev, dhd_pub_t *dhdp);
3306
+uint32 dhd_get_dld_len(int log_type);
3307
+void dhd_init_sec_hdr(log_dump_section_hdr_t *sec_hdr);
3308
+extern char *dhd_log_dump_get_timestamp(void);
3309
+bool dhd_log_dump_ecntr_enabled(void);
3310
+bool dhd_log_dump_rtt_enabled(void);
3311
+void dhd_nla_put_sssr_dump_len(void *ndev, uint32 *arr_len);
3312
+int dhd_get_debug_dump(void *dev, const void *user_buf, uint32 len, int type);
3313
+int
3314
+dhd_sssr_dump_d11_buf_before(void *dev, const void *user_buf, uint32 len, int core);
3315
+int
3316
+dhd_sssr_dump_d11_buf_after(void *dev, const void *user_buf, uint32 len, int core);
3317
+int
3318
+dhd_sssr_dump_dig_buf_before(void *dev, const void *user_buf, uint32 len);
3319
+int
3320
+dhd_sssr_dump_dig_buf_after(void *dev, const void *user_buf, uint32 len);
3321
+#ifdef DHD_PKT_LOGGING
3322
+extern int dhd_os_get_pktlog_dump(void *dev, const void *user_buf, uint32 len);
3323
+extern uint32 dhd_os_get_pktlog_dump_size(struct net_device *dev);
3324
+extern void dhd_os_get_pktlogdump_filename(struct net_device *dev, char *dump_path, int len);
3325
+#endif /* DHD_PKT_LOGGING */
3326
+
3327
+#ifdef DNGL_AXI_ERROR_LOGGING
3328
+extern int dhd_os_get_axi_error_dump(void *dev, const void *user_buf, uint32 len);
3329
+extern int dhd_os_get_axi_error_dump_size(struct net_device *dev);
3330
+extern void dhd_os_get_axi_error_filename(struct net_device *dev, char *dump_path, int len);
3331
+#endif /* DNGL_AXI_ERROR_LOGGING */
3332
+
3333
+#endif /* DHD_LOG_DUMP */
3334
+int dhd_export_debug_data(void *mem_buf, void *fp, const void *user_buf, int buf_len, void *pos);
3335
+#define DHD_PCIE_CONFIG_SAVE(bus) pci_save_state(bus->dev)
3336
+#define DHD_PCIE_CONFIG_RESTORE(bus) pci_restore_state(bus->dev)
3337
+
3338
+#ifdef BIGDATA_SOFTAP
3339
+void dhd_schedule_gather_ap_stadata(void *bcm_cfg, void *ndev, const wl_event_msg_t *e);
3340
+#endif /* BIGDATA_SOFTAP */
3341
+
3342
+typedef struct dhd_pkt_parse {
3343
+ uint32 proto; /* Network layer protocol */
3344
+ uint32 t1; /* n-tuple */
3345
+ uint32 t2;
3346
+} dhd_pkt_parse_t;
3347
+
3348
+/* ========= RING API functions : exposed to others ============= */
3349
+#define DHD_RING_TYPE_FIXED 1
3350
+#define DHD_RING_TYPE_SINGLE_IDX 2
3351
+uint32 dhd_ring_get_hdr_size(void);
3352
+void *dhd_ring_init(dhd_pub_t *dhdp, uint8 *buf, uint32 buf_size, uint32 elem_size,
3353
+ uint32 elem_cnt, uint32 type);
3354
+void dhd_ring_deinit(dhd_pub_t *dhdp, void *_ring);
3355
+void *dhd_ring_get_first(void *_ring);
3356
+void dhd_ring_free_first(void *_ring);
3357
+void dhd_ring_set_read_idx(void *_ring, uint32 read_idx);
3358
+void dhd_ring_set_write_idx(void *_ring, uint32 write_idx);
3359
+uint32 dhd_ring_get_read_idx(void *_ring);
3360
+uint32 dhd_ring_get_write_idx(void *_ring);
3361
+void *dhd_ring_get_last(void *_ring);
3362
+void *dhd_ring_get_next(void *_ring, void *cur);
3363
+void *dhd_ring_get_prev(void *_ring, void *cur);
3364
+void *dhd_ring_get_empty(void *_ring);
3365
+int dhd_ring_get_cur_size(void *_ring);
3366
+void dhd_ring_lock(void *ring, void *fist_ptr, void *last_ptr);
3367
+void dhd_ring_lock_free(void *ring);
3368
+void *dhd_ring_lock_get_first(void *_ring);
3369
+void *dhd_ring_lock_get_last(void *_ring);
3370
+int dhd_ring_lock_get_count(void *_ring);
3371
+void dhd_ring_lock_free_first(void *ring);
3372
+void dhd_ring_whole_lock(void *ring);
3373
+void dhd_ring_whole_unlock(void *ring);
3374
+
3375
+#define DHD_DUMP_TYPE_NAME_SIZE 32
3376
+#define DHD_DUMP_FILE_PATH_SIZE 256
3377
+#define DHD_DUMP_FILE_COUNT_MAX 5
3378
+#define DHD_DUMP_TYPE_COUNT_MAX 10
3379
+
3380
+#ifdef DHD_DUMP_MNGR
3381
+typedef struct _DFM_elem {
3382
+ char type_name[DHD_DUMP_TYPE_NAME_SIZE];
3383
+ char file_path[DHD_DUMP_FILE_COUNT_MAX][DHD_DUMP_FILE_PATH_SIZE];
3384
+ int file_idx;
3385
+} DFM_elem_t;
3386
+
3387
+typedef struct _dhd_dump_file_manage {
3388
+ DFM_elem_t elems[DHD_DUMP_TYPE_COUNT_MAX];
3389
+} dhd_dump_file_manage_t;
3390
+
3391
+extern void dhd_dump_file_manage_enqueue(dhd_pub_t *dhd, char *dump_path, char *fname);
3392
+#endif /* DHD_DUMP_MNGR */
3393
+
3394
+#ifdef PKT_FILTER_SUPPORT
3395
+extern void dhd_pktfilter_offload_set(dhd_pub_t * dhd, char *arg);
3396
+extern void dhd_pktfilter_offload_enable(dhd_pub_t * dhd, char *arg, int enable, int master_mode);
3397
+extern void dhd_pktfilter_offload_delete(dhd_pub_t *dhd, int id);
3398
+#endif // endif
3399
+
3400
+#ifdef DHD_DUMP_PCIE_RINGS
3401
+extern int dhd_d2h_h2d_ring_dump(dhd_pub_t *dhd, void *file, const void *user_buf,
3402
+ unsigned long *file_posn, bool file_write);
3403
+#endif /* DHD_DUMP_PCIE_RINGS */
3404
+
3405
+#ifdef EWP_EDL
3406
+#define DHD_EDL_RING_SIZE (D2HRING_EDL_MAX_ITEM * D2HRING_EDL_ITEMSIZE)
3407
+int dhd_event_logtrace_process_edl(dhd_pub_t *dhdp, uint8 *data,
3408
+ void *evt_decode_data);
3409
+int dhd_edl_mem_init(dhd_pub_t *dhd);
3410
+void dhd_edl_mem_deinit(dhd_pub_t *dhd);
3411
+void dhd_prot_edl_ring_tcm_rd_update(dhd_pub_t *dhd);
3412
+#define DHD_EDL_MEM_INIT(dhdp) dhd_edl_mem_init(dhdp)
3413
+#define DHD_EDL_MEM_DEINIT(dhdp) dhd_edl_mem_deinit(dhdp)
3414
+#define DHD_EDL_RING_TCM_RD_UPDATE(dhdp) \
3415
+ dhd_prot_edl_ring_tcm_rd_update(dhdp)
3416
+#else
3417
+#define DHD_EDL_MEM_INIT(dhdp) do { /* noop */ } while (0)
3418
+#define DHD_EDL_MEM_DEINIT(dhdp) do { /* noop */ } while (0)
3419
+#define DHD_EDL_RING_TCM_RD_UPDATE(dhdp) do { /* noop */ } while (0)
3420
+#endif /* EWP_EDL */
3421
+
3422
+void dhd_schedule_logtrace(void *dhd_info);
3423
+int dhd_print_fw_ver_from_file(dhd_pub_t *dhdp, char *fwpath);
3424
+
3425
+#define HD_PREFIX_SIZE 2 /* hexadecimal prefix size */
3426
+#define HD_BYTE_SIZE 2 /* hexadecimal byte size */
3427
+
3428
+#if defined(DHD_H2D_LOG_TIME_SYNC)
3429
+void dhd_h2d_log_time_sync_deferred_wq_schedule(dhd_pub_t *dhdp);
3430
+void dhd_h2d_log_time_sync(dhd_pub_t *dhdp);
3431
+#endif /* DHD_H2D_LOG_TIME_SYNC */
3432
+extern void dhd_cleanup_if(struct net_device *net);
3433
+
3434
+#ifdef DNGL_AXI_ERROR_LOGGING
3435
+extern void dhd_axi_error(dhd_pub_t *dhd);
3436
+#ifdef DHD_USE_WQ_FOR_DNGL_AXI_ERROR
3437
+extern void dhd_axi_error_dispatch(dhd_pub_t *dhdp);
3438
+#endif /* DHD_USE_WQ_FOR_DNGL_AXI_ERROR */
3439
+#endif /* DNGL_AXI_ERROR_LOGGING */
3440
+
3441
+#ifdef DHD_HP2P
3442
+extern unsigned long dhd_os_hp2plock(dhd_pub_t *pub);
3443
+extern void dhd_os_hp2punlock(dhd_pub_t *pub, unsigned long flags);
3444
+#endif /* DHD_HP2P */
3445
+extern struct dhd_if * dhd_get_ifp(dhd_pub_t *dhdp, uint32 ifidx);
3446
+
3447
+#ifdef DHD_STATUS_LOGGING
3448
+#include <dhd_statlog.h>
3449
+#else
3450
+#define ST(x) 0
3451
+#define STDIR(x) 0
3452
+#define DHD_STATLOG_CTRL(dhdp, stat, ifidx, reason) \
3453
+ do { /* noop */ } while (0)
3454
+#define DHD_STATLOG_DATA(dhdp, stat, ifidx, dir, cond) \
3455
+ do { BCM_REFERENCE(cond); } while (0)
3456
+#define DHD_STATLOG_DATA_RSN(dhdp, stat, ifidx, dir, reason) \
3457
+ do { /* noop */ } while (0)
3458
+#endif /* DHD_STATUS_LOGGING */
3459
+
3460
+#ifdef CONFIG_SILENT_ROAM
3461
+extern int dhd_sroam_set_mon(dhd_pub_t *dhd, bool set);
3462
+typedef wlc_sroam_info_v1_t wlc_sroam_info_t;
3463
+#endif /* CONFIG_SILENT_ROAM */
3464
+
3465
+#ifdef SUPPORT_SET_TID
3466
+enum dhd_set_tid_mode {
3467
+ /* Disalbe changing TID */
3468
+ SET_TID_OFF = 0,
3469
+ /* Change TID for all UDP frames */
3470
+ SET_TID_ALL_UDP,
3471
+ /* Change TID for UDP frames based on UID */
3472
+ SET_TID_BASED_ON_UID
3473
+};
3474
+extern void dhd_set_tid_based_on_uid(dhd_pub_t *dhdp, void *pkt);
3475
+#endif /* SUPPORT_SET_TID */
3476
+
3477
+#ifdef DHD_DUMP_FILE_WRITE_FROM_KERNEL
3478
+#define FILE_NAME_HAL_TAG ""
3479
+#else
3480
+#define FILE_NAME_HAL_TAG "_hal" /* The tag name concatenated by HAL */
3481
+#endif /* DHD_DUMP_FILE_WRITE_FROM_KERNEL */
3482
+
3483
+#if defined(DISABLE_HE_ENAB) || defined(CUSTOM_CONTROL_HE_ENAB)
3484
+extern int dhd_control_he_enab(dhd_pub_t * dhd, uint8 he_enab);
3485
+extern uint8 control_he_enab;
3486
+#endif /* DISABLE_HE_ENAB || CUSTOM_CONTROL_HE_ENAB */
3487
+
3488
+#if defined(BCMSDIO)
3489
+void dhd_set_role(dhd_pub_t *dhdp, int role, int bssidx);
3490
+#endif /* BCMSDIO */
16203491 #endif /* _dhd_h_ */