.. | .. |
---|
1 | | -/* SPDX-License-Identifier: GPL-2.0 */ |
---|
2 | 1 | /* |
---|
3 | 2 | * Header file describing the internal (inter-module) DHD interfaces. |
---|
4 | 3 | * |
---|
5 | 4 | * Provides type definitions and function prototypes used to link the |
---|
6 | 5 | * DHD OS, bus, and protocol modules. |
---|
7 | 6 | * |
---|
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 | + * |
---|
10 | 11 | * Unless you and Broadcom execute a separate written software license |
---|
11 | 12 | * agreement governing use of this software, this software is licensed to you |
---|
12 | 13 | * under the terms of the GNU General Public License version 2 (the "GPL"), |
---|
13 | 14 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the |
---|
14 | 15 | * following added to such license: |
---|
15 | | - * |
---|
| 16 | + * |
---|
16 | 17 | * As a special exception, the copyright holders of this software give you |
---|
17 | 18 | * permission to link this software with independent modules, and to copy and |
---|
18 | 19 | * distribute the resulting executable under terms of your choice, provided that |
---|
.. | .. |
---|
20 | 21 | * the license of that module. An independent module is a module which is not |
---|
21 | 22 | * derived from this software. The special exception does not apply to any |
---|
22 | 23 | * modifications of the software. |
---|
23 | | - * |
---|
| 24 | + * |
---|
24 | 25 | * Notwithstanding the above, under no circumstances may you combine this |
---|
25 | 26 | * software in any way with any other Broadcom software provided under a license |
---|
26 | 27 | * other than the GPL, without Broadcom's express prior written consent. |
---|
.. | .. |
---|
28 | 29 | * |
---|
29 | 30 | * <<Broadcom-WL-IPTag/Open:>> |
---|
30 | 31 | * |
---|
31 | | - * $Id: dhd.h 715966 2019-05-30 02:36:59Z $ |
---|
| 32 | + * $Id: dhd.h 701844 2017-05-26 18:56:40Z $ |
---|
32 | 33 | */ |
---|
33 | 34 | |
---|
34 | 35 | /**************** |
---|
.. | .. |
---|
47 | 48 | #include <linux/random.h> |
---|
48 | 49 | #include <linux/spinlock.h> |
---|
49 | 50 | #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> |
---|
51 | 54 | #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) |
---|
53 | 56 | #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) */ |
---|
56 | 61 | /* The kernel threading is sdio-specific */ |
---|
57 | 62 | struct task_struct; |
---|
58 | 63 | struct sched_param; |
---|
| 64 | +#if defined(BT_OVER_SDIO) |
---|
| 65 | +#include <dhd_bt_interface.h> |
---|
| 66 | +#endif /* defined (BT_OVER_SDIO) */ |
---|
59 | 67 | int setScheduler(struct task_struct *p, int policy, struct sched_param *param); |
---|
60 | 68 | int get_scheduler_policy(struct task_struct *p); |
---|
61 | 69 | #define MAX_EVENT 16 |
---|
62 | 70 | |
---|
63 | 71 | #define ALL_INTERFACES 0xff |
---|
64 | 72 | |
---|
| 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 | + |
---|
65 | 78 | #include <wlioctl.h> |
---|
| 79 | +#include <bcmstdlib_s.h> |
---|
| 80 | +#include <dhdioctl.h> |
---|
66 | 81 | #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 */ |
---|
68 | 86 | |
---|
69 | 87 | #if defined(BCMWDF) |
---|
70 | 88 | #include <wdf.h> |
---|
71 | 89 | #include <WdfMiniport.h> |
---|
72 | 90 | #endif /* (BCMWDF) */ |
---|
73 | 91 | |
---|
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 */ |
---|
77 | 95 | |
---|
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 */ |
---|
82 | 105 | |
---|
83 | 106 | #if defined(KEEP_ALIVE) |
---|
84 | 107 | /* Default KEEP_ALIVE Period is 55 sec to prevent AP from sending Keep Alive probe frame */ |
---|
.. | .. |
---|
86 | 109 | #define NULL_PKT_STR "null_pkt" |
---|
87 | 110 | #endif /* KEEP_ALIVE */ |
---|
88 | 111 | |
---|
| 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 |
---|
89 | 121 | /* Forward decls */ |
---|
90 | 122 | struct dhd_bus; |
---|
91 | 123 | struct dhd_prot; |
---|
92 | 124 | struct dhd_info; |
---|
93 | 125 | struct dhd_ioctl; |
---|
94 | 126 | 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 */ |
---|
95 | 131 | |
---|
96 | 132 | /* The level of bus communication with the dongle */ |
---|
97 | 133 | enum dhd_bus_state { |
---|
.. | .. |
---|
102 | 138 | DHD_BUS_DOWN_IN_PROGRESS, /* Bus going Down */ |
---|
103 | 139 | }; |
---|
104 | 140 | |
---|
| 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 | + |
---|
105 | 150 | /* |
---|
106 | 151 | * Bit fields to Indicate clean up process that wait till they are finished. |
---|
107 | 152 | * Future synchronizable processes can add their bit filed below and update |
---|
.. | .. |
---|
110 | 155 | #define DHD_BUS_BUSY_IN_TX 0x01 |
---|
111 | 156 | #define DHD_BUS_BUSY_IN_SEND_PKT 0x02 |
---|
112 | 157 | #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)) |
---|
117 | 322 | |
---|
118 | 323 | /* Download Types */ |
---|
119 | 324 | typedef enum download_type { |
---|
120 | 325 | FW, |
---|
121 | 326 | NVRAM, |
---|
122 | | - CLM_BLOB |
---|
| 327 | + CLM_BLOB, |
---|
| 328 | + TXCAP_BLOB |
---|
123 | 329 | } download_type_t; |
---|
124 | 330 | |
---|
125 | | - |
---|
126 | 331 | /* 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 |
---|
130 | 338 | |
---|
131 | 339 | enum dhd_op_flags { |
---|
132 | 340 | /* Firmware requested operation mode */ |
---|
.. | .. |
---|
135 | 343 | DHD_FLAG_P2P_MODE = (1 << (2)), /* P2P Only */ |
---|
136 | 344 | /* STA + P2P */ |
---|
137 | 345 | 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), |
---|
138 | 348 | DHD_FLAG_CONCURR_MULTI_CHAN_MODE = (1 << (4)), /* STA + P2P */ |
---|
139 | 349 | /* Current P2P mode for P2P connection */ |
---|
140 | 350 | DHD_FLAG_P2P_GC_MODE = (1 << (5)), |
---|
.. | .. |
---|
148 | 358 | |
---|
149 | 359 | #define DHD_OPMODE_SUPPORTED(dhd, opmode_flag) \ |
---|
150 | 360 | (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) |
---|
151 | 364 | |
---|
152 | 365 | /* Max sequential TX/RX Control timeouts to set HANG event */ |
---|
153 | 366 | #ifndef MAX_CNTL_TX_TIMEOUT |
---|
.. | .. |
---|
159 | 372 | |
---|
160 | 373 | #define DHD_SCAN_ASSOC_ACTIVE_TIME 40 /* ms: Embedded default Active setting from DHD */ |
---|
161 | 374 | #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 |
---|
162 | 378 | #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 */ |
---|
163 | 382 | |
---|
164 | 383 | #ifndef POWERUP_MAX_RETRY |
---|
165 | 384 | #define POWERUP_MAX_RETRY 3 /* how many times we retry to power up the chip */ |
---|
166 | | -#endif |
---|
| 385 | +#endif // endif |
---|
167 | 386 | #ifndef POWERUP_WAIT_MS |
---|
168 | 387 | #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 |
---|
233 | 389 | /* |
---|
234 | 390 | * MAX_NVRAMBUF_SIZE determines the size of the Buffer in the DHD that holds |
---|
235 | 391 | * the NVRAM data. That is the size of the buffer pointed by bus->vars |
---|
.. | .. |
---|
237 | 393 | */ |
---|
238 | 394 | #define MAX_NVRAMBUF_SIZE (16 * 1024) /* max nvram buf size */ |
---|
239 | 395 | #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 */ |
---|
240 | 401 | |
---|
241 | 402 | #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 */ |
---|
243 | 408 | #endif /* CONFIG_BCMDHD_CLM_PATH */ |
---|
244 | 409 | #define WL_CCODE_NULL_COUNTRY "#n" |
---|
245 | 410 | |
---|
| 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[]; |
---|
246 | 419 | |
---|
| 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) |
---|
247 | 583 | /** |
---|
248 | 584 | * DMA-able buffer parameters |
---|
249 | 585 | * - dmaaddr_t is 32bits on a 32bit host. |
---|
.. | .. |
---|
270 | 606 | uint8 pend_pkts; |
---|
271 | 607 | } reorder_info_t; |
---|
272 | 608 | |
---|
| 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 | + |
---|
273 | 630 | #ifdef DHDTCPACK_SUPPRESS |
---|
274 | 631 | |
---|
275 | 632 | enum { |
---|
.. | .. |
---|
287 | 644 | TCPACK_SUP_LAST_MODE |
---|
288 | 645 | }; |
---|
289 | 646 | #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 |
---|
312 | 647 | |
---|
313 | 648 | #define DHD_NULL_CHK_AND_RET(cond) \ |
---|
314 | 649 | if (!cond) { \ |
---|
.. | .. |
---|
360 | 695 | #define DHD_CUMM_CTR_DECR(clen) \ |
---|
361 | 696 | ASSERT(DHD_CUMM_CTR_PTR(clen) != DHD_CUMM_CTR_PTR(NULL)); |
---|
362 | 697 | |
---|
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 | | - |
---|
372 | 698 | #if defined(WLTDLS) && defined(PCIE_FULL_DONGLE) |
---|
373 | 699 | struct tdls_peer_node { |
---|
374 | 700 | uint8 addr[ETHER_ADDR_LEN]; |
---|
.. | .. |
---|
381 | 707 | } tdls_peer_tbl_t; |
---|
382 | 708 | #endif /* defined(WLTDLS) && defined(PCIE_FULL_DONGLE) */ |
---|
383 | 709 | |
---|
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 | + */ |
---|
385 | 939 | typedef struct dhd_pub { |
---|
386 | 940 | /* Linkage ponters */ |
---|
387 | 941 | osl_t *osh; /* OSL handle */ |
---|
.. | .. |
---|
389 | 943 | struct dhd_prot *prot; /* Protocol module handle */ |
---|
390 | 944 | struct dhd_info *info; /* Info module handle */ |
---|
391 | 945 | 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 */ |
---|
392 | 949 | |
---|
393 | 950 | /* to NDIS developer, the structure dhd_common is redundant, |
---|
394 | 951 | * please do NOT merge it back from other branches !!! |
---|
395 | 952 | */ |
---|
396 | 953 | |
---|
397 | | -#ifdef BCMDBUS |
---|
398 | | - struct dbus_pub *dbus; |
---|
399 | | -#endif |
---|
400 | | - |
---|
401 | 954 | /* Internal dhd items */ |
---|
402 | 955 | bool up; /* Driver up/down (to OS) */ |
---|
403 | 956 | #ifdef WL_CFG80211 |
---|
404 | 957 | spinlock_t up_lock; /* Synchronization with CFG80211 down */ |
---|
405 | | -#endif |
---|
| 958 | +#endif /* WL_CFG80211 */ |
---|
406 | 959 | bool txoff; /* Transmit flow-controlled */ |
---|
407 | 960 | bool dongle_reset; /* TRUE = DEVRESET put dongle into reset */ |
---|
408 | 961 | enum dhd_bus_state busstate; |
---|
.. | .. |
---|
411 | 964 | uint maxctl; /* Max size rxctl request from proto to bus */ |
---|
412 | 965 | uint rxsz; /* Rx buffer size bus module should use */ |
---|
413 | 966 | 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 */ |
---|
415 | 972 | /* Dongle media info */ |
---|
416 | 973 | bool iswl; /* Dongle-resident driver is wl */ |
---|
417 | 974 | ulong drv_version; /* Version of dongle-resident driver */ |
---|
.. | .. |
---|
438 | 995 | ulong rx_readahead_cnt; /* Number of packets where header read-ahead was used. */ |
---|
439 | 996 | ulong tx_realloc; /* Number of tx packets we had to realloc for headroom */ |
---|
440 | 997 | 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 */ |
---|
441 | 1003 | |
---|
442 | 1004 | /* Last error return */ |
---|
443 | 1005 | int bcmerror; |
---|
.. | .. |
---|
462 | 1024 | #ifdef PKT_FILTER_SUPPORT |
---|
463 | 1025 | int early_suspended; /* Early suspend status */ |
---|
464 | 1026 | int dhcp_in_progress; /* DHCP period */ |
---|
465 | | -#endif |
---|
| 1027 | +#endif // endif |
---|
466 | 1028 | |
---|
467 | 1029 | /* Pkt filter defination */ |
---|
468 | 1030 | char * pktfilter[100]; |
---|
469 | 1031 | int pktfilter_count; |
---|
470 | 1032 | |
---|
471 | 1033 | 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 */ |
---|
475 | 1040 | bool force_country_change; |
---|
476 | 1041 | char eventmask[WL_EVENTING_MASK_LEN]; |
---|
477 | 1042 | int op_mode; /* STA, HostAPD, WFD, SoftAP */ |
---|
.. | .. |
---|
482 | 1047 | */ |
---|
483 | 1048 | /* #define WL_ENABLE_P2P_IF 1 */ |
---|
484 | 1049 | |
---|
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) */ |
---|
489 | 1054 | |
---|
490 | 1055 | #ifdef PROP_TXSTATUS |
---|
491 | 1056 | bool wlfc_enabled; |
---|
.. | .. |
---|
507 | 1072 | |
---|
508 | 1073 | bool wlfc_rxpkt_chk; |
---|
509 | 1074 | #ifdef LIMIT_BORROW |
---|
510 | | - bool wlfc_borrow_allowed; |
---|
| 1075 | + bool wlfc_borrow_allowed; |
---|
511 | 1076 | #endif /* LIMIT_BORROW */ |
---|
512 | 1077 | /* |
---|
513 | 1078 | * implement below functions in each platform if needed. |
---|
514 | 1079 | */ |
---|
515 | 1080 | /* platform specific function whether to skip flow control */ |
---|
516 | | - bool (*skip_fc)(void); |
---|
| 1081 | + bool (*skip_fc)(void * dhdp, uint8 ifx); |
---|
517 | 1082 | /* platform specific function for wlfc_enable and wlfc_deinit */ |
---|
518 | 1083 | void (*plat_init)(void *dhd); |
---|
519 | 1084 | void (*plat_deinit)(void *dhd); |
---|
.. | .. |
---|
525 | 1090 | #endif /* PROP_TXSTATUS */ |
---|
526 | 1091 | #ifdef PNO_SUPPORT |
---|
527 | 1092 | void *pno_state; |
---|
528 | | -#endif |
---|
| 1093 | +#endif // endif |
---|
529 | 1094 | #ifdef RTT_SUPPORT |
---|
530 | 1095 | void *rtt_state; |
---|
531 | | -#endif |
---|
| 1096 | +#endif // endif |
---|
| 1097 | +#ifdef ROAM_AP_ENV_DETECTION |
---|
| 1098 | + bool roam_env_detection; |
---|
| 1099 | +#endif // endif |
---|
532 | 1100 | bool dongle_isolation; |
---|
| 1101 | + bool is_pcie_watchdog_reset; |
---|
| 1102 | + |
---|
| 1103 | +/* Begin - Variables to track Bus Errors */ |
---|
533 | 1104 | 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 | + |
---|
534 | 1126 | int hang_was_sent; |
---|
| 1127 | + int hang_was_pending; |
---|
535 | 1128 | int rxcnt_timeout; /* counter rxcnt timeout to send HANG */ |
---|
536 | 1129 | int txcnt_timeout; /* counter txcnt timeout to send HANG */ |
---|
537 | 1130 | #ifdef BCMPCIE |
---|
538 | 1131 | int d3ackcnt_timeout; /* counter d3ack timeout to send HANG */ |
---|
539 | 1132 | #endif /* BCMPCIE */ |
---|
540 | 1133 | 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 */ |
---|
544 | 1141 | #ifdef WLTDLS |
---|
545 | 1142 | bool tdls_enable; |
---|
546 | | -#endif |
---|
| 1143 | +#endif // endif |
---|
547 | 1144 | struct reorder_info *reorder_bufs[WLHOST_REORDERDATA_MAXFLOWS]; |
---|
548 | | - #define WLC_IOCTL_MAXBUF_FWCAP 512 |
---|
| 1145 | + #define WLC_IOCTL_MAXBUF_FWCAP 1024 |
---|
549 | 1146 | char fw_capabilities[WLC_IOCTL_MAXBUF_FWCAP]; |
---|
550 | 1147 | #define MAXSKBPEND 1024 |
---|
551 | 1148 | void *skbbuf[MAXSKBPEND]; |
---|
.. | .. |
---|
559 | 1156 | #endif /* DHDTCPACK_SUPPRESS */ |
---|
560 | 1157 | #if defined(ARP_OFFLOAD_SUPPORT) |
---|
561 | 1158 | 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 */ |
---|
563 | 1166 | #ifdef CUSTOM_SET_CPUCORE |
---|
564 | 1167 | struct task_struct * current_dpc; |
---|
565 | 1168 | struct task_struct * current_rxf; |
---|
566 | 1169 | int chan_isvht80; |
---|
567 | 1170 | #endif /* CUSTOM_SET_CPUCORE */ |
---|
568 | | - |
---|
569 | 1171 | |
---|
570 | 1172 | void *sta_pool; /* pre-allocated pool of sta objects */ |
---|
571 | 1173 | void *staid_allocator; /* allocator of sta indexes */ |
---|
.. | .. |
---|
577 | 1179 | void *if_flow_lkup; /* per interface flowid lkup hash table */ |
---|
578 | 1180 | void *flowid_lock; /* per os lock for flowid info protection */ |
---|
579 | 1181 | void *flowring_list_lock; /* per os lock for flowring list protection */ |
---|
| 1182 | + uint8 max_multi_client_flow_rings; |
---|
| 1183 | + uint8 multi_client_flow_rings; |
---|
580 | 1184 | uint32 num_flow_rings; |
---|
581 | 1185 | cumm_ctr_t cumm_ctr; /* cumm queue length placeholder */ |
---|
582 | 1186 | cumm_ctr_t l2cumm_ctr; /* level 2 cumm queue length placeholder */ |
---|
.. | .. |
---|
586 | 1190 | char enable_log[MAX_EVENT]; |
---|
587 | 1191 | bool dma_d2h_ring_upd_support; |
---|
588 | 1192 | bool dma_h2d_ring_upd_support; |
---|
| 1193 | + bool dma_ring_upd_overwrite; /* host overwrites support setting */ |
---|
589 | 1194 | |
---|
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 | + |
---|
602 | 1209 | #ifdef DHD_L2_FILTER |
---|
603 | 1210 | unsigned long l2_filter_cnt; /* for L2_FILTER ARP table timeout */ |
---|
604 | 1211 | #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 */ |
---|
605 | 1225 | uint8 *soc_ram; |
---|
606 | 1226 | uint32 soc_ram_length; |
---|
607 | 1227 | uint32 memdump_type; |
---|
| 1228 | +#ifdef DHD_RND_DEBUG |
---|
| 1229 | + uint8 *rnd_buf; |
---|
| 1230 | + uint32 rnd_len; |
---|
| 1231 | +#endif /* DHD_RND_DEBUG */ |
---|
608 | 1232 | #ifdef DHD_FW_COREDUMP |
---|
609 | 1233 | uint32 memdump_enabled; |
---|
| 1234 | +#ifdef DHD_DEBUG_UART |
---|
| 1235 | + bool memdump_success; |
---|
| 1236 | +#endif /* DHD_DEBUG_UART */ |
---|
610 | 1237 | #endif /* DHD_FW_COREDUMP */ |
---|
611 | 1238 | #ifdef PCIE_FULL_DONGLE |
---|
612 | 1239 | #ifdef WLTDLS |
---|
.. | .. |
---|
616 | 1243 | #endif /* PCIE_FULL_DONGLE */ |
---|
617 | 1244 | #ifdef DHD_ULP |
---|
618 | 1245 | 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 |
---|
626 | 1247 | #ifdef WLTDLS |
---|
627 | 1248 | uint32 tdls_mode; |
---|
628 | | -#endif |
---|
629 | | -#ifdef DHD_LOSSLESS_ROAMING |
---|
630 | | - uint8 dequeue_prec_map; |
---|
631 | | -#endif |
---|
| 1249 | +#endif // endif |
---|
632 | 1250 | #ifdef GSCAN_SUPPORT |
---|
633 | 1251 | 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 */ |
---|
636 | 1256 | void *macdbg_info; |
---|
637 | 1257 | #ifdef DHD_WET |
---|
638 | 1258 | 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 */ |
---|
640 | 1427 | } 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; |
---|
641 | 1449 | |
---|
642 | 1450 | #if defined(PCIE_FULL_DONGLE) |
---|
643 | 1451 | |
---|
644 | 1452 | /* Packet Tag for PCIE Full Dongle DHD */ |
---|
645 | 1453 | typedef struct dhd_pkttag_fd { |
---|
646 | 1454 | uint16 flowid; /* Flowring Id */ |
---|
647 | | - uint16 dataoff; /* start of packet */ |
---|
| 1455 | + uint16 ifid; |
---|
| 1456 | +#ifndef DHD_PCIE_PKTID |
---|
648 | 1457 | uint16 dma_len; /* pkt len for DMA_MAP/UNMAP */ |
---|
649 | 1458 | dmaaddr_t pa; /* physical address */ |
---|
650 | 1459 | void *dmah; /* dma mapper handle */ |
---|
651 | 1460 | 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; |
---|
652 | 1466 | } dhd_pkttag_fd_t; |
---|
653 | 1467 | |
---|
654 | 1468 | /* Packet Tag for DHD PCIE Full Dongle */ |
---|
.. | .. |
---|
677 | 1491 | #define DHD_PKT_GET_SECDMA(pkt) ((DHD_PKTTAG_FD(pkt))->secdma) |
---|
678 | 1492 | #define DHD_PKT_SET_SECDMA(pkt, pkt_secdma) \ |
---|
679 | 1493 | 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 | + |
---|
680 | 1514 | #endif /* PCIE_FULL_DONGLE */ |
---|
681 | 1515 | |
---|
682 | 1516 | #if defined(BCMWDF) |
---|
.. | .. |
---|
687 | 1521 | WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(dhd_workitem_context_t, dhd_get_dhd_workitem_context) |
---|
688 | 1522 | #endif /* (BCMWDF) */ |
---|
689 | 1523 | |
---|
690 | | - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP) |
---|
| 1524 | + #if defined(CONFIG_PM_SLEEP) |
---|
691 | 1525 | |
---|
692 | 1526 | #define DHD_PM_RESUME_WAIT_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a); |
---|
693 | 1527 | #define _DHD_PM_RESUME_WAIT(a, b) do {\ |
---|
.. | .. |
---|
700 | 1534 | } while (0) |
---|
701 | 1535 | #define DHD_PM_RESUME_WAIT(a) _DHD_PM_RESUME_WAIT(a, 200) |
---|
702 | 1536 | #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) |
---|
715 | 1544 | #define DHD_PM_RESUME_RETURN do { if (dhd_mmc_suspend) return; } while (0) |
---|
716 | 1545 | |
---|
717 | 1546 | #define DHD_SPINWAIT_SLEEP_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a); |
---|
.. | .. |
---|
740 | 1569 | } \ |
---|
741 | 1570 | } while (0) |
---|
742 | 1571 | |
---|
743 | | - #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP) */ |
---|
| 1572 | + #endif /* CONFIG_PM_SLEEP */ |
---|
744 | 1573 | |
---|
745 | 1574 | #ifndef OSL_SLEEP |
---|
746 | 1575 | #define OSL_SLEEP(ms) OSL_DELAY(ms*1000) |
---|
.. | .. |
---|
751 | 1580 | #ifdef PNO_SUPPORT |
---|
752 | 1581 | int dhd_pno_clean(dhd_pub_t *dhd); |
---|
753 | 1582 | #endif /* PNO_SUPPORT */ |
---|
| 1583 | + |
---|
754 | 1584 | /* |
---|
755 | 1585 | * Wake locks are an Android power management concept. They are used by applications and services |
---|
756 | 1586 | * to request CPU resources. |
---|
757 | 1587 | */ |
---|
| 1588 | +#if defined(OEM_ANDROID) |
---|
758 | 1589 | extern int dhd_os_wake_lock(dhd_pub_t *pub); |
---|
759 | 1590 | 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); |
---|
760 | 1599 | extern int dhd_os_wake_lock_timeout(dhd_pub_t *pub); |
---|
761 | 1600 | extern int dhd_os_wake_lock_rx_timeout_enable(dhd_pub_t *pub, int val); |
---|
762 | 1601 | extern int dhd_os_wake_lock_ctrl_timeout_enable(dhd_pub_t *pub, int val); |
---|
763 | 1602 | extern int dhd_os_wake_lock_ctrl_timeout_cancel(dhd_pub_t *pub); |
---|
764 | 1603 | extern int dhd_os_wd_wake_lock(dhd_pub_t *pub); |
---|
765 | 1604 | 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); |
---|
772 | 1605 | extern void dhd_os_wake_lock_init(struct dhd_info *dhd); |
---|
773 | 1606 | 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 */ |
---|
778 | 1607 | #ifdef DHD_USE_SCAN_WAKELOCK |
---|
779 | 1608 | extern void dhd_os_scan_wake_lock_timeout(dhd_pub_t *pub, int val); |
---|
780 | 1609 | extern void dhd_os_scan_wake_unlock(dhd_pub_t *pub); |
---|
.. | .. |
---|
782 | 1611 | |
---|
783 | 1612 | inline static void MUTEX_LOCK_SOFTAP_SET_INIT(dhd_pub_t * dhdp) |
---|
784 | 1613 | { |
---|
785 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) |
---|
| 1614 | +#if defined(OEM_ANDROID) |
---|
786 | 1615 | mutex_init(&dhdp->wl_softap_lock); |
---|
787 | | -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */ |
---|
| 1616 | +#endif /* OEM_ANDROID */ |
---|
788 | 1617 | } |
---|
789 | 1618 | |
---|
790 | 1619 | inline static void MUTEX_LOCK_SOFTAP_SET(dhd_pub_t * dhdp) |
---|
791 | 1620 | { |
---|
792 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) |
---|
| 1621 | +#if defined(OEM_ANDROID) |
---|
793 | 1622 | mutex_lock(&dhdp->wl_softap_lock); |
---|
794 | | -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */ |
---|
| 1623 | +#endif /* OEM_ANDROID */ |
---|
795 | 1624 | } |
---|
796 | 1625 | |
---|
797 | 1626 | inline static void MUTEX_UNLOCK_SOFTAP_SET(dhd_pub_t * dhdp) |
---|
798 | 1627 | { |
---|
799 | | -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) |
---|
| 1628 | +#if defined(OEM_ANDROID) |
---|
800 | 1629 | mutex_unlock(&dhdp->wl_softap_lock); |
---|
801 | | -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */ |
---|
| 1630 | +#endif /* OEM_ANDROID */ |
---|
802 | 1631 | } |
---|
803 | 1632 | |
---|
| 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 |
---|
804 | 1727 | #define DHD_OS_WAKE_LOCK(pub) dhd_os_wake_lock(pub) |
---|
805 | 1728 | #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) |
---|
806 | 1735 | #define DHD_OS_WAKE_LOCK_TIMEOUT(pub) dhd_os_wake_lock_timeout(pub) |
---|
807 | 1736 | #define DHD_OS_WAKE_LOCK_RX_TIMEOUT_ENABLE(pub, val) \ |
---|
808 | 1737 | dhd_os_wake_lock_rx_timeout_enable(pub, val) |
---|
.. | .. |
---|
812 | 1741 | dhd_os_wake_lock_ctrl_timeout_cancel(pub) |
---|
813 | 1742 | #define DHD_OS_WAKE_LOCK_WAIVE(pub) dhd_os_wake_lock_waive(pub) |
---|
814 | 1743 | #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 */ |
---|
815 | 1747 | |
---|
816 | 1748 | #define DHD_OS_WD_WAKE_LOCK(pub) dhd_os_wd_wake_lock(pub) |
---|
817 | 1749 | #define DHD_OS_WD_WAKE_UNLOCK(pub) dhd_os_wd_wake_unlock(pub) |
---|
818 | 1750 | |
---|
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 */ |
---|
831 | 1751 | #ifdef DHD_USE_SCAN_WAKELOCK |
---|
832 | 1752 | #ifdef DHD_DEBUG_SCAN_WAKELOCK |
---|
833 | 1753 | #define DHD_OS_SCAN_WAKE_LOCK_TIMEOUT(pub, val) \ |
---|
.. | .. |
---|
850 | 1770 | #define DHD_OS_SCAN_WAKE_LOCK_TIMEOUT(pub, val) |
---|
851 | 1771 | #define DHD_OS_SCAN_WAKE_UNLOCK(pub) |
---|
852 | 1772 | #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 | + |
---|
853 | 1809 | #define DHD_PACKET_TIMEOUT_MS 500 |
---|
854 | 1810 | #define DHD_EVENT_TIMEOUT_MS 1500 |
---|
855 | 1811 | #define SCAN_WAKE_LOCK_TIMEOUT 10000 |
---|
856 | | -#define MAX_TX_TIMEOUT 500 |
---|
| 1812 | +#define MAX_TX_TIMEOUT 500 |
---|
857 | 1813 | |
---|
858 | 1814 | /* Enum for IOCTL recieved status */ |
---|
859 | 1815 | typedef enum dhd_ioctl_recieved_status |
---|
.. | .. |
---|
861 | 1817 | IOCTL_WAIT = 0, |
---|
862 | 1818 | IOCTL_RETURN_ON_SUCCESS, |
---|
863 | 1819 | IOCTL_RETURN_ON_TRAP, |
---|
864 | | - IOCTL_RETURN_ON_BUS_STOP |
---|
| 1820 | + IOCTL_RETURN_ON_BUS_STOP, |
---|
| 1821 | + IOCTL_RETURN_ON_ERROR |
---|
865 | 1822 | } dhd_ioctl_recieved_status_t; |
---|
866 | 1823 | |
---|
867 | 1824 | /* interface operations (register, remove) should be atomic, use this lock to prevent race |
---|
.. | .. |
---|
870 | 1827 | void dhd_net_if_lock(struct net_device *dev); |
---|
871 | 1828 | void dhd_net_if_unlock(struct net_device *dev); |
---|
872 | 1829 | |
---|
| 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 */ |
---|
873 | 1835 | |
---|
874 | 1836 | typedef enum dhd_attach_states |
---|
875 | 1837 | { |
---|
.. | .. |
---|
883 | 1845 | DHD_ATTACH_STATE_WAKELOCKS_INIT = 0x40, |
---|
884 | 1846 | DHD_ATTACH_STATE_CFG80211 = 0x80, |
---|
885 | 1847 | 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 |
---|
887 | 1852 | } dhd_attach_states_t; |
---|
888 | 1853 | |
---|
889 | 1854 | /* Value -1 means we are unsuccessful in creating the kthread. */ |
---|
890 | 1855 | #define DHD_PID_KT_INVALID -1 |
---|
891 | 1856 | /* Value -2 means we are unsuccessful in both creating the kthread and tasklet */ |
---|
892 | 1857 | #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; |
---|
893 | 1892 | |
---|
894 | 1893 | /* |
---|
895 | 1894 | * Exported from dhd OS modules (dhd_linux/dhd_ndis) |
---|
.. | .. |
---|
901 | 1900 | * bus_hdrlen specifies required headroom for bus module header. |
---|
902 | 1901 | */ |
---|
903 | 1902 | 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); |
---|
904 | 1904 | #if defined(WLP2P) && defined(WL_CFG80211) |
---|
905 | 1905 | /* To allow attach/detach calls corresponding to p2p0 interface */ |
---|
906 | 1906 | extern int dhd_attach_p2p(dhd_pub_t *); |
---|
907 | 1907 | extern int dhd_detach_p2p(dhd_pub_t *); |
---|
908 | 1908 | #endif /* WLP2P && WL_CFG80211 */ |
---|
909 | 1909 | 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 */ |
---|
910 | 1913 | |
---|
911 | 1914 | /* Indication from bus module regarding removal/absence of dongle */ |
---|
912 | 1915 | extern void dhd_detach(dhd_pub_t *dhdp); |
---|
.. | .. |
---|
921 | 1924 | |
---|
922 | 1925 | extern bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, void *pkt, int prec); |
---|
923 | 1926 | |
---|
924 | | -/* Receive frame for delivery to OS. Callee disposes of rxp. */ |
---|
925 | 1927 | extern void dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *rxp, int numpkt, uint8 chan); |
---|
926 | 1928 | |
---|
927 | 1929 | /* Return pointer to interface name */ |
---|
928 | 1930 | 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 */ |
---|
929 | 1936 | |
---|
930 | 1937 | /* Request scheduling of the bus dpc */ |
---|
931 | 1938 | extern void dhd_sched_dpc(dhd_pub_t *dhdp); |
---|
932 | 1939 | |
---|
933 | 1940 | /* Notify tx completion */ |
---|
934 | 1941 | 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 */ |
---|
936 | 1950 | |
---|
937 | 1951 | #define WIFI_FEATURE_INFRA 0x0001 /* Basic infrastructure mode */ |
---|
938 | 1952 | #define WIFI_FEATURE_INFRA_5G 0x0002 /* Support for 5 GHz Band */ |
---|
.. | .. |
---|
951 | 1965 | #define WIFI_FEATURE_EPR 0x4000 /* Enhanced power reporting */ |
---|
952 | 1966 | #define WIFI_FEATURE_AP_STA 0x8000 /* Support for AP STA Concurrency */ |
---|
953 | 1967 | #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 */ |
---|
956 | 1982 | |
---|
957 | 1983 | #define MAX_FEATURE_SET_CONCURRRENT_GROUPS 3 |
---|
958 | 1984 | |
---|
959 | 1985 | 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); |
---|
961 | 1988 | #ifdef CUSTOM_FORCE_NODFS_FLAG |
---|
962 | 1989 | extern int dhd_dev_set_nodfs(struct net_device *dev, uint nodfs); |
---|
963 | 1990 | #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 */ |
---|
966 | 1995 | |
---|
| 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); |
---|
967 | 2000 | #ifdef GSCAN_SUPPORT |
---|
968 | 2001 | extern int dhd_dev_set_lazy_roam_cfg(struct net_device *dev, |
---|
969 | 2002 | wlc_roam_exp_params_t *roam_param); |
---|
970 | 2003 | extern int dhd_dev_lazy_roam_enable(struct net_device *dev, uint32 enable); |
---|
971 | 2004 | extern int dhd_dev_set_lazy_roam_bssid_pref(struct net_device *dev, |
---|
972 | 2005 | wl_bssid_pref_cfg_t *bssid_pref, uint32 flush); |
---|
| 2006 | +#endif /* GSCAN_SUPPORT */ |
---|
| 2007 | +#if defined(GSCAN_SUPPORT) || defined(ROAMEXP_SUPPORT) |
---|
973 | 2008 | extern int dhd_dev_set_blacklist_bssid(struct net_device *dev, maclist_t *blacklist, |
---|
974 | 2009 | uint32 len, uint32 flush); |
---|
975 | 2010 | extern int dhd_dev_set_whitelist_ssid(struct net_device *dev, wl_ssid_whitelist_t *whitelist, |
---|
976 | 2011 | 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 */ |
---|
988 | 2013 | |
---|
989 | 2014 | /* 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); |
---|
990 | 2019 | extern int dhd_os_proto_block(dhd_pub_t * pub); |
---|
991 | 2020 | extern int dhd_os_proto_unblock(dhd_pub_t * pub); |
---|
992 | 2021 | extern int dhd_os_ioctl_resp_wait(dhd_pub_t * pub, uint * condition); |
---|
.. | .. |
---|
995 | 2024 | extern void dhd_os_set_ioctl_resp_timeout(unsigned int timeout_msec); |
---|
996 | 2025 | extern void dhd_os_ioctl_resp_lock(dhd_pub_t * pub); |
---|
997 | 2026 | extern void dhd_os_ioctl_resp_unlock(dhd_pub_t * pub); |
---|
| 2027 | +#ifdef PCIE_FULL_DONGLE |
---|
998 | 2028 | 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); |
---|
999 | 2050 | |
---|
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); |
---|
1003 | 2054 | |
---|
1004 | 2055 | 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); |
---|
1007 | 2064 | 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 */ |
---|
1008 | 2068 | extern void dhd_os_sdlock(dhd_pub_t * pub); |
---|
1009 | 2069 | extern void dhd_os_sdunlock(dhd_pub_t * pub); |
---|
1010 | 2070 | extern void dhd_os_sdlock_txq(dhd_pub_t * pub); |
---|
.. | .. |
---|
1012 | 2072 | extern void dhd_os_sdlock_rxq(dhd_pub_t * pub); |
---|
1013 | 2073 | extern void dhd_os_sdunlock_rxq(dhd_pub_t * pub); |
---|
1014 | 2074 | extern void dhd_os_sdlock_sndup_rxq(dhd_pub_t * pub); |
---|
| 2075 | +extern void dhd_os_tracelog(const char *format, ...); |
---|
1015 | 2076 | #ifdef DHDTCPACK_SUPPRESS |
---|
1016 | 2077 | extern unsigned long dhd_os_tcpacklock(dhd_pub_t *pub); |
---|
1017 | 2078 | extern void dhd_os_tcpackunlock(dhd_pub_t *pub, unsigned long flags); |
---|
.. | .. |
---|
1020 | 2081 | extern int dhd_customer_oob_irq_map(void *adapter, unsigned long *irq_flags_ptr); |
---|
1021 | 2082 | extern int dhd_customer_gpio_wlan_ctrl(void *adapter, int onoff); |
---|
1022 | 2083 | extern int dhd_custom_get_mac_address(void *adapter, unsigned char *buf); |
---|
1023 | | -#ifdef CUSTOM_COUNTRY_CODE |
---|
| 2084 | +#if defined(CUSTOM_COUNTRY_CODE) |
---|
1024 | 2085 | 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); |
---|
1026 | 2087 | #else |
---|
1027 | 2088 | extern void get_customized_country_code(void *adapter, char *country_iso_code, wl_country_t *cspec); |
---|
1028 | 2089 | #endif /* CUSTOM_COUNTRY_CODE */ |
---|
.. | .. |
---|
1044 | 2105 | extern int dhd_keep_alive_onoff(dhd_pub_t *dhd); |
---|
1045 | 2106 | #endif /* KEEP_ALIVE */ |
---|
1046 | 2107 | |
---|
1047 | | -#ifdef SUPPORT_AP_POWERSAVE |
---|
1048 | | -extern int dhd_set_ap_powersave(dhd_pub_t *dhdp, int ifidx, int enable); |
---|
1049 | | -#endif |
---|
1050 | | - |
---|
1051 | 2108 | #if defined(DHD_FW_COREDUMP) |
---|
1052 | 2109 | void dhd_schedule_memdump(dhd_pub_t *dhdp, uint8 *buf, uint32 size); |
---|
1053 | 2110 | #endif /* DHD_FW_COREDUMP */ |
---|
1054 | 2111 | |
---|
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 */ |
---|
1059 | 2119 | |
---|
1060 | 2120 | #ifdef PKT_FILTER_SUPPORT |
---|
1061 | 2121 | #define DHD_UNICAST_FILTER_NUM 0 |
---|
.. | .. |
---|
1064 | 2124 | #define DHD_MULTICAST6_FILTER_NUM 3 |
---|
1065 | 2125 | #define DHD_MDNS_FILTER_NUM 4 |
---|
1066 | 2126 | #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); |
---|
1068 | 2137 | 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); |
---|
1069 | 2139 | extern int net_os_enable_packet_filter(struct net_device *dev, int val); |
---|
1070 | 2140 | 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 |
---|
1071 | 2147 | #endif /* PKT_FILTER_SUPPORT */ |
---|
1072 | 2148 | |
---|
| 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 |
---|
1073 | 2152 | 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 */ |
---|
1075 | 2154 | |
---|
| 2155 | +extern bool dhd_support_sta_mode(dhd_pub_t *dhd); |
---|
1076 | 2156 | 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 | + |
---|
1077 | 2174 | typedef struct { |
---|
1078 | 2175 | uint32 limit; /* Expiration time (usec) */ |
---|
1079 | 2176 | uint32 increment; /* Current expiration increment (usec) */ |
---|
.. | .. |
---|
1083 | 2180 | |
---|
1084 | 2181 | #ifdef SHOW_LOGTRACE |
---|
1085 | 2182 | typedef struct { |
---|
1086 | | - int num_fmts; |
---|
| 2183 | + uint num_fmts; |
---|
1087 | 2184 | char **fmts; |
---|
1088 | 2185 | char *raw_fmts; |
---|
1089 | 2186 | char *raw_sstr; |
---|
| 2187 | + uint32 fmts_size; |
---|
| 2188 | + uint32 raw_fmts_size; |
---|
| 2189 | + uint32 raw_sstr_size; |
---|
1090 | 2190 | uint32 ramstart; |
---|
1091 | 2191 | uint32 rodata_start; |
---|
1092 | 2192 | uint32 rodata_end; |
---|
1093 | 2193 | char *rom_raw_sstr; |
---|
| 2194 | + uint32 rom_raw_sstr_size; |
---|
1094 | 2195 | uint32 rom_ramstart; |
---|
1095 | 2196 | uint32 rom_rodata_start; |
---|
1096 | 2197 | uint32 rom_rodata_end; |
---|
1097 | 2198 | } dhd_event_log_t; |
---|
1098 | 2199 | #endif /* SHOW_LOGTRACE */ |
---|
1099 | 2200 | |
---|
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 */ |
---|
1105 | 2227 | |
---|
1106 | 2228 | extern void dhd_timeout_start(dhd_timeout_t *tmo, uint usec); |
---|
1107 | 2229 | extern int dhd_timeout_expired(dhd_timeout_t *tmo); |
---|
.. | .. |
---|
1110 | 2232 | extern int dhd_net2idx(struct dhd_info *dhd, struct net_device *net); |
---|
1111 | 2233 | extern struct net_device * dhd_idx2net(void *pub, int ifidx); |
---|
1112 | 2234 | 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); |
---|
1113 | 2236 | extern bool dhd_wowl_cap(void *bus); |
---|
1114 | 2237 | extern int wl_host_event(dhd_pub_t *dhd_pub, int *idx, void *pktdata, uint pktlen, |
---|
1115 | 2238 | 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); |
---|
1119 | 2239 | extern int wl_process_host_event(dhd_pub_t *dhd_pub, int *idx, void *pktdata, uint pktlen, |
---|
1120 | 2240 | 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); |
---|
1122 | 2243 | extern int dhd_wl_ioctl(dhd_pub_t *dhd_pub, int ifindex, wl_ioctl_t *ioc, void *buf, int len); |
---|
1123 | 2244 | extern int dhd_wl_ioctl_cmd(dhd_pub_t *dhd_pub, int cmd, void *arg, int len, uint8 set, |
---|
1124 | 2245 | int ifindex); |
---|
.. | .. |
---|
1133 | 2254 | char *name, uint8 *mac); |
---|
1134 | 2255 | extern int dhd_event_ifdel(struct dhd_info *dhd, struct wl_event_data_if *ifevent, |
---|
1135 | 2256 | 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); |
---|
1138 | 2261 | 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 */ |
---|
1139 | 2266 | extern void dhd_vif_add(struct dhd_info *dhd, int ifidx, char * name); |
---|
1140 | 2267 | extern void dhd_vif_del(struct dhd_info *dhd, int ifidx); |
---|
1141 | 2268 | extern void dhd_event(struct dhd_info *dhd, char *evpkt, int evlen, int ifidx); |
---|
1142 | 2269 | 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 */ |
---|
1143 | 2274 | |
---|
1144 | 2275 | /* Send packet to dongle via data channel */ |
---|
1145 | 2276 | extern int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, void *pkt); |
---|
.. | .. |
---|
1151 | 2282 | #ifdef LOG_INTO_TCPDUMP |
---|
1152 | 2283 | extern void dhd_sendup_log(dhd_pub_t *dhdp, void *data, int len); |
---|
1153 | 2284 | #endif /* LOG_INTO_TCPDUMP */ |
---|
| 2285 | +#ifdef SHOW_LOGTRACE |
---|
| 2286 | +void dhd_sendup_info_buf(dhd_pub_t *dhdp, uint8 *msg); |
---|
| 2287 | +#endif // endif |
---|
1154 | 2288 | extern int dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag); |
---|
1155 | 2289 | extern uint dhd_bus_status(dhd_pub_t *dhdp); |
---|
1156 | 2290 | extern int dhd_bus_start(dhd_pub_t *dhdp); |
---|
.. | .. |
---|
1158 | 2292 | extern int dhd_bus_resume(dhd_pub_t *dhdpub, int stage); |
---|
1159 | 2293 | extern int dhd_bus_membytes(dhd_pub_t *dhdp, bool set, uint32 address, uint8 *data, uint size); |
---|
1160 | 2294 | 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); |
---|
1162 | 2296 | #if defined(BCMSDIO) || defined(BCMPCIE) |
---|
1163 | 2297 | extern uint dhd_bus_chip_id(dhd_pub_t *dhdp); |
---|
1164 | 2298 | extern uint dhd_bus_chiprev_id(dhd_pub_t *dhdp); |
---|
1165 | 2299 | extern uint dhd_bus_chippkg_id(dhd_pub_t *dhdp); |
---|
1166 | 2300 | #endif /* defined(BCMSDIO) || defined(BCMPCIE) */ |
---|
| 2301 | +int dhd_bus_get_fw_mode(dhd_pub_t *dhdp); |
---|
1167 | 2302 | |
---|
1168 | 2303 | #if defined(KEEP_ALIVE) |
---|
1169 | 2304 | extern int dhd_keep_alive_onoff(dhd_pub_t *dhd); |
---|
.. | .. |
---|
1175 | 2310 | extern unsigned long dhd_os_spin_lock(void *lock); |
---|
1176 | 2311 | void dhd_os_spin_unlock(void *lock, unsigned long flags); |
---|
1177 | 2312 | |
---|
| 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 | + |
---|
1178 | 2341 | /* |
---|
1179 | 2342 | * Manage sta objects in an interface. Interface is identified by an ifindex and |
---|
1180 | 2343 | * sta(s) within an interfaces are managed using a MacAddress of the sta. |
---|
1181 | 2344 | */ |
---|
1182 | 2345 | struct dhd_sta; |
---|
| 2346 | +extern bool dhd_sta_associated(dhd_pub_t *dhdp, uint32 bssidx, uint8 *mac); |
---|
1183 | 2347 | extern struct dhd_sta *dhd_find_sta(void *pub, int ifidx, void *ea); |
---|
1184 | 2348 | extern struct dhd_sta *dhd_findadd_sta(void *pub, int ifidx, void *ea); |
---|
| 2349 | +extern void dhd_del_all_sta(void *pub, int ifidx); |
---|
1185 | 2350 | extern void dhd_del_sta(void *pub, int ifidx, void *ea); |
---|
1186 | 2351 | extern int dhd_get_ap_isolate(dhd_pub_t *dhdp, uint32 idx); |
---|
1187 | 2352 | 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 |
---|
1191 | 2353 | 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); |
---|
1194 | 2354 | 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); |
---|
1197 | 2355 | |
---|
1198 | 2356 | extern bool dhd_is_concurrent_mode(dhd_pub_t *dhd); |
---|
1199 | 2357 | int dhd_iovar(dhd_pub_t *pub, int ifidx, char *name, char *param_buf, uint param_len, |
---|
.. | .. |
---|
1204 | 2362 | #ifdef DHD_MCAST_REGEN |
---|
1205 | 2363 | extern int dhd_get_mcast_regen_bss_enable(dhd_pub_t *dhdp, uint32 idx); |
---|
1206 | 2364 | extern int dhd_set_mcast_regen_bss_enable(dhd_pub_t *dhdp, uint32 idx, int val); |
---|
1207 | | -#endif |
---|
| 2365 | +#endif // endif |
---|
1208 | 2366 | typedef enum cust_gpio_modes { |
---|
1209 | 2367 | WLAN_RESET_ON, |
---|
1210 | 2368 | WLAN_RESET_OFF, |
---|
.. | .. |
---|
1212 | 2370 | WLAN_POWER_OFF |
---|
1213 | 2371 | } cust_gpio_modes_t; |
---|
1214 | 2372 | |
---|
| 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) |
---|
1215 | 2379 | extern int wl_iw_iscan_set_scan_broadcast_prep(struct net_device *dev, uint flag); |
---|
1216 | 2380 | 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 | + |
---|
1217 | 2387 | /* |
---|
1218 | 2388 | * Insmod parameters for debug/test |
---|
1219 | 2389 | */ |
---|
1220 | 2390 | |
---|
1221 | 2391 | /* Watchdog timer interval */ |
---|
1222 | 2392 | 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; |
---|
1223 | 2399 | |
---|
1224 | 2400 | #if defined(DHD_DEBUG) |
---|
1225 | | -/* Console output poll interval */ |
---|
1226 | | -extern uint dhd_console_ms; |
---|
1227 | 2401 | extern uint wl_msg_level; |
---|
1228 | 2402 | #endif /* defined(DHD_DEBUG) */ |
---|
1229 | 2403 | |
---|
.. | .. |
---|
1256 | 2430 | /* Roaming mode control */ |
---|
1257 | 2431 | extern uint dhd_radio_up; |
---|
1258 | 2432 | |
---|
| 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 | + |
---|
1259 | 2441 | /* Initial idletime ticks (may be -1 for immediate idle, 0 for no idle) */ |
---|
1260 | 2442 | extern int dhd_idletime; |
---|
1261 | 2443 | #ifdef DHD_USE_IDLECOUNT |
---|
.. | .. |
---|
1272 | 2454 | |
---|
1273 | 2455 | /* Override to force tx queueing all the time */ |
---|
1274 | 2456 | 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 | + |
---|
1275 | 2464 | /* Default KEEP_ALIVE Period is 55 sec to prevent AP from sending Keep Alive probe frame */ |
---|
1276 | 2465 | #define DEFAULT_KEEP_ALIVE_VALUE 55000 /* msec */ |
---|
1277 | 2466 | #ifndef CUSTOM_KEEP_ALIVE_SETTING |
---|
.. | .. |
---|
1284 | 2473 | #define DEFAULT_GLOM_VALUE -1 |
---|
1285 | 2474 | #ifndef CUSTOM_GLOM_SETTING |
---|
1286 | 2475 | #define CUSTOM_GLOM_SETTING DEFAULT_GLOM_VALUE |
---|
1287 | | -#endif |
---|
| 2476 | +#endif // endif |
---|
1288 | 2477 | #define WL_AUTO_ROAM_TRIGGER -75 |
---|
1289 | 2478 | /* hooks for custom Roaming Trigger setting via Makefile */ |
---|
1290 | 2479 | #define DEFAULT_ROAM_TRIGGER_VALUE -75 /* dBm default roam trigger all band */ |
---|
1291 | 2480 | #define DEFAULT_ROAM_TRIGGER_SETTING -1 |
---|
1292 | 2481 | #ifndef CUSTOM_ROAM_TRIGGER_SETTING |
---|
1293 | 2482 | #define CUSTOM_ROAM_TRIGGER_SETTING DEFAULT_ROAM_TRIGGER_VALUE |
---|
1294 | | -#endif |
---|
| 2483 | +#endif // endif |
---|
1295 | 2484 | |
---|
1296 | 2485 | /* hooks for custom Roaming Romaing setting via Makefile */ |
---|
1297 | 2486 | #define DEFAULT_ROAM_DELTA_VALUE 10 /* dBm default roam delta all band */ |
---|
1298 | 2487 | #define DEFAULT_ROAM_DELTA_SETTING -1 |
---|
1299 | 2488 | #ifndef CUSTOM_ROAM_DELTA_SETTING |
---|
1300 | 2489 | #define CUSTOM_ROAM_DELTA_SETTING DEFAULT_ROAM_DELTA_VALUE |
---|
1301 | | -#endif |
---|
| 2490 | +#endif // endif |
---|
1302 | 2491 | |
---|
1303 | 2492 | /* hooks for custom PNO Event wake lock to guarantee enough time |
---|
1304 | 2493 | for the Platform to detect Event before system suspended |
---|
.. | .. |
---|
1306 | 2495 | #define DEFAULT_PNO_EVENT_LOCK_xTIME 2 /* multiplay of DHD_PACKET_TIMEOUT_MS */ |
---|
1307 | 2496 | #ifndef CUSTOM_PNO_EVENT_LOCK_xTIME |
---|
1308 | 2497 | #define CUSTOM_PNO_EVENT_LOCK_xTIME DEFAULT_PNO_EVENT_LOCK_xTIME |
---|
1309 | | -#endif |
---|
| 2498 | +#endif // endif |
---|
1310 | 2499 | /* hooks for custom dhd_dpc_prio setting option via Makefile */ |
---|
1311 | 2500 | #define DEFAULT_DHP_DPC_PRIO 1 |
---|
1312 | 2501 | #ifndef CUSTOM_DPC_PRIO_SETTING |
---|
1313 | 2502 | #define CUSTOM_DPC_PRIO_SETTING DEFAULT_DHP_DPC_PRIO |
---|
1314 | | -#endif |
---|
| 2503 | +#endif // endif |
---|
1315 | 2504 | |
---|
1316 | 2505 | #ifndef CUSTOM_LISTEN_INTERVAL |
---|
1317 | 2506 | #define CUSTOM_LISTEN_INTERVAL LISTEN_INTERVAL |
---|
.. | .. |
---|
1320 | 2509 | #define DEFAULT_SUSPEND_BCN_LI_DTIM 3 |
---|
1321 | 2510 | #ifndef CUSTOM_SUSPEND_BCN_LI_DTIM |
---|
1322 | 2511 | #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 */ |
---|
1324 | 2519 | |
---|
1325 | 2520 | #ifndef CUSTOM_RXF_PRIO_SETTING |
---|
1326 | 2521 | #define CUSTOM_RXF_PRIO_SETTING MAX((CUSTOM_DPC_PRIO_SETTING - 1), 1) |
---|
1327 | | -#endif |
---|
| 2522 | +#endif // endif |
---|
1328 | 2523 | |
---|
1329 | 2524 | #define DEFAULT_WIFI_TURNOFF_DELAY 0 |
---|
| 2525 | +#ifndef WIFI_TURNOFF_DELAY |
---|
1330 | 2526 | #define WIFI_TURNOFF_DELAY DEFAULT_WIFI_TURNOFF_DELAY |
---|
| 2527 | +#endif /* WIFI_TURNOFF_DELAY */ |
---|
1331 | 2528 | |
---|
1332 | 2529 | #define DEFAULT_WIFI_TURNON_DELAY 200 |
---|
1333 | 2530 | #ifndef WIFI_TURNON_DELAY |
---|
.. | .. |
---|
1344 | 2541 | #define CUSTOM_ASSOC_RETRY_MAX DEFAULT_ASSOC_RETRY_MAX |
---|
1345 | 2542 | #endif /* DEFAULT_ASSOC_RETRY_MAX */ |
---|
1346 | 2543 | |
---|
| 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 */ |
---|
1347 | 2553 | |
---|
1348 | 2554 | #ifdef WLTDLS |
---|
1349 | 2555 | #ifndef CUSTOM_TDLS_IDLE_MODE_SETTING |
---|
1350 | 2556 | #define CUSTOM_TDLS_IDLE_MODE_SETTING 60000 /* 60sec to tear down TDLS of not active */ |
---|
1351 | | -#endif |
---|
| 2557 | +#endif // endif |
---|
1352 | 2558 | #ifndef CUSTOM_TDLS_RSSI_THRESHOLD_HIGH |
---|
1353 | 2559 | #define CUSTOM_TDLS_RSSI_THRESHOLD_HIGH -70 /* rssi threshold for establishing TDLS link */ |
---|
1354 | | -#endif |
---|
| 2560 | +#endif // endif |
---|
1355 | 2561 | #ifndef CUSTOM_TDLS_RSSI_THRESHOLD_LOW |
---|
1356 | 2562 | #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 |
---|
1358 | 2570 | #endif /* WLTDLS */ |
---|
1359 | 2571 | |
---|
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 | + |
---|
1361 | 2578 | #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 |
---|
1364 | 2581 | |
---|
1365 | 2582 | #define MAX_DTIM_SKIP_BEACON_INTERVAL 100 /* max allowed associated AP beacon for DTIM skip */ |
---|
1366 | 2583 | #ifndef MAX_DTIM_ALLOWED_INTERVAL |
---|
1367 | 2584 | #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 | + |
---|
1369 | 2593 | #define NO_DTIM_SKIP 1 |
---|
1370 | 2594 | #ifdef SDTEST |
---|
1371 | 2595 | /* Echo packet generator (SDIO), pkts/s */ |
---|
.. | .. |
---|
1374 | 2598 | /* Echo packet len (0 => sawtooth, max 1800) */ |
---|
1375 | 2599 | extern uint dhd_pktgen_len; |
---|
1376 | 2600 | #define MAX_PKTGEN_LEN 1800 |
---|
1377 | | -#endif |
---|
1378 | | - |
---|
| 2601 | +#endif // endif |
---|
1379 | 2602 | |
---|
1380 | 2603 | /* optionally set by a module_param_string() */ |
---|
1381 | 2604 | #define MOD_PARAM_PATHLEN 2048 |
---|
1382 | 2605 | #define MOD_PARAM_INFOLEN 512 |
---|
| 2606 | +#define MOD_PARAM_SRLEN 64 |
---|
1383 | 2607 | |
---|
1384 | 2608 | #ifdef SOFTAP |
---|
1385 | 2609 | 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 */ |
---|
1387 | 2660 | |
---|
1388 | 2661 | /* Flag to indicate if we should download firmware on driver load */ |
---|
1389 | 2662 | extern uint dhd_download_fw_on_driverload; |
---|
1390 | | -#ifndef BCMDBUS |
---|
1391 | 2663 | extern int allow_delay_fwdl; |
---|
1392 | | -#endif /* !BCMDBUS */ |
---|
1393 | 2664 | |
---|
| 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 */ |
---|
1394 | 2726 | |
---|
1395 | 2727 | extern void dhd_wait_for_event(dhd_pub_t *dhd, bool *lockvar); |
---|
1396 | 2728 | extern void dhd_wait_event_wakeup(dhd_pub_t*dhd); |
---|
.. | .. |
---|
1416 | 2748 | int dhd_tdls_enable(struct net_device *dev, bool tdls_on, bool auto_on, struct ether_addr *mac); |
---|
1417 | 2749 | int dhd_tdls_set_mode(dhd_pub_t *dhd, bool wfd_mode); |
---|
1418 | 2750 | #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); |
---|
1420 | 2754 | #endif /* PCIE_FULL_DONGLE */ |
---|
1421 | 2755 | #endif /* WLTDLS */ |
---|
| 2756 | + |
---|
1422 | 2757 | /* 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); |
---|
1424 | 2759 | int dhd_ndo_add_ip(dhd_pub_t *dhd, char* ipaddr, int idx); |
---|
1425 | 2760 | 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 | + |
---|
1426 | 2769 | /* ioctl processing for nl80211 */ |
---|
1427 | 2770 | int dhd_ioctl_process(dhd_pub_t *pub, int ifidx, struct dhd_ioctl *ioc, void *data_buf); |
---|
1428 | 2771 | |
---|
| 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 */ |
---|
1429 | 2776 | void dhd_bus_update_fw_nv_path(struct dhd_bus *bus, char *pfw_path, char *pnv_path); |
---|
1430 | 2777 | void dhd_set_bus_state(void *bus, uint32 state); |
---|
1431 | 2778 | |
---|
.. | .. |
---|
1439 | 2786 | extern const uint8 prio2fifo[]; |
---|
1440 | 2787 | #endif /* PROP_TXSTATUS */ |
---|
1441 | 2788 | |
---|
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); |
---|
1444 | 2789 | int dhd_os_socram_dump(struct net_device *dev, uint32 *dump_size); |
---|
1445 | 2790 | int dhd_os_get_socram_dump(struct net_device *dev, char **buf, uint32 *size); |
---|
1446 | 2791 | 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); |
---|
1448 | 2792 | |
---|
| 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); |
---|
1449 | 2797 | uint8* dhd_os_prealloc(dhd_pub_t *dhdpub, int section, uint size, bool kmalloc_if_fail); |
---|
1450 | 2798 | 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); |
---|
1453 | 2799 | |
---|
1454 | 2800 | #if defined(CONFIG_DHD_USE_STATIC_BUF) |
---|
1455 | 2801 | #define DHD_OS_PREALLOC(dhdpub, section, size) dhd_os_prealloc(dhdpub, section, size, FALSE) |
---|
.. | .. |
---|
1459 | 2805 | #define DHD_OS_PREFREE(dhdpub, addr, size) MFREE(dhdpub->osh, addr, size) |
---|
1460 | 2806 | #endif /* defined(CONFIG_DHD_USE_STATIC_BUF) */ |
---|
1461 | 2807 | |
---|
| 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 */ |
---|
1462 | 2840 | |
---|
1463 | 2841 | #define dhd_add_flowid(pub, ifidx, ac_prio, ea, flowid) do {} while (0) |
---|
1464 | 2842 | #define dhd_del_flowid(pub, ifidx, flowid) do {} while (0) |
---|
.. | .. |
---|
1481 | 2859 | #define DHD_GENERAL_UNLOCK(dhdp, flags) \ |
---|
1482 | 2860 | dhd_os_general_spin_unlock((dhdp), (flags)) |
---|
1483 | 2861 | |
---|
| 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 | + |
---|
1484 | 2866 | /* Enable DHD flowring spin lock/unlock */ |
---|
1485 | 2867 | #define DHD_FLOWRING_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock) |
---|
1486 | 2868 | #define DHD_FLOWRING_UNLOCK(lock, flags) dhd_os_spin_unlock((lock), (flags)) |
---|
.. | .. |
---|
1493 | 2875 | #define DHD_FLOWRING_LIST_LOCK(lock, flags) (flags) = dhd_os_spin_lock(lock) |
---|
1494 | 2876 | #define DHD_FLOWRING_LIST_UNLOCK(lock, flags) dhd_os_spin_unlock((lock), (flags)) |
---|
1495 | 2877 | |
---|
| 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 | + |
---|
1496 | 2920 | extern void dhd_dump_to_kernelog(dhd_pub_t *dhdp); |
---|
1497 | 2921 | |
---|
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); |
---|
1502 | 2923 | |
---|
1503 | 2924 | #ifdef DHD_L2_FILTER |
---|
1504 | 2925 | extern int dhd_get_parp_status(dhd_pub_t *dhdp, uint32 idx); |
---|
.. | .. |
---|
1509 | 2930 | extern int dhd_set_block_ping_status(dhd_pub_t *dhdp, uint32 idx, int val); |
---|
1510 | 2931 | extern int dhd_get_grat_arp_status(dhd_pub_t *dhdp, uint32 idx); |
---|
1511 | 2932 | 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); |
---|
1512 | 2935 | #endif /* DHD_L2_FILTER */ |
---|
1513 | | - |
---|
1514 | 2936 | |
---|
1515 | 2937 | typedef struct wl_io_pport { |
---|
1516 | 2938 | dhd_pub_t *dhd_pub; |
---|
.. | .. |
---|
1548 | 2970 | #define RPS_CPUS_MASK_P2P "6" |
---|
1549 | 2971 | #define RPS_CPUS_MASK_IBSS "6" |
---|
1550 | 2972 | #endif /* CONFIG_MACH_UNIVERSAL5433 || CONFIG_MACH_UNIVERSAL7420 || CONFIG_SOC_EXYNOS8890 */ |
---|
1551 | | -#endif |
---|
| 2973 | +#endif // endif |
---|
1552 | 2974 | |
---|
1553 | 2975 | int dhd_get_download_buffer(dhd_pub_t *dhd, char *file_path, download_type_t component, |
---|
1554 | 2976 | char ** buffer, int *length); |
---|
1555 | 2977 | |
---|
1556 | 2978 | void dhd_free_download_buffer(dhd_pub_t *dhd, void *buffer, int length); |
---|
1557 | 2979 | |
---|
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); |
---|
1560 | 2982 | |
---|
| 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); |
---|
1561 | 2987 | 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 */ |
---|
1562 | 2999 | |
---|
1563 | 3000 | #define dhd_is_device_removed(x) FALSE |
---|
1564 | 3001 | #define dhd_os_ind_firmware_stall(x) |
---|
1565 | 3002 | |
---|
1566 | 3003 | #if defined(DHD_FW_COREDUMP) |
---|
1567 | 3004 | 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 */ |
---|
1569 | 3011 | |
---|
| 3012 | +#define DMAXFER_FREE(dhdp, dmap) dhd_schedule_dmaxfer_free(dhdp, dmap); |
---|
1570 | 3013 | |
---|
| 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) |
---|
1571 | 3020 | #if defined(DHD_LB_STATS) |
---|
1572 | 3021 | #include <bcmutils.h> |
---|
1573 | 3022 | extern void dhd_lb_stats_init(dhd_pub_t *dhd); |
---|
| 3023 | +extern void dhd_lb_stats_deinit(dhd_pub_t *dhd); |
---|
1574 | 3024 | extern void dhd_lb_stats_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf); |
---|
1575 | 3025 | extern void dhd_lb_stats_update_napi_histo(dhd_pub_t *dhdp, uint32 count); |
---|
1576 | 3026 | extern void dhd_lb_stats_update_txc_histo(dhd_pub_t *dhdp, uint32 count); |
---|
1577 | 3027 | extern void dhd_lb_stats_update_rxc_histo(dhd_pub_t *dhdp, uint32 count); |
---|
1578 | 3028 | extern void dhd_lb_stats_txc_percpu_cnt_incr(dhd_pub_t *dhdp); |
---|
1579 | 3029 | 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) |
---|
1581 | 3032 | /* Reset is called from common layer so it takes dhd_pub_t as argument */ |
---|
1582 | 3033 | #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) |
---|
1586 | 3037 | #define DHD_LB_STATS_PERCPU_ARR_INCR(x) \ |
---|
1587 | 3038 | { \ |
---|
1588 | 3039 | int cpu = get_cpu(); put_cpu(); \ |
---|
1589 | 3040 | DHD_LB_STATS_INCR(x[cpu]); \ |
---|
1590 | 3041 | } |
---|
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) |
---|
1596 | 3047 | #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 |
---|
1599 | 3050 | #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 |
---|
1604 | 3055 | #define DHD_LB_STATS_UPDATE_NAPI_HISTO(dhd, x) DHD_LB_STATS_NOOP |
---|
1605 | 3056 | #define DHD_LB_STATS_UPDATE_TXC_HISTO(dhd, x) DHD_LB_STATS_NOOP |
---|
1606 | 3057 | #define DHD_LB_STATS_UPDATE_RXC_HISTO(dhd, x) DHD_LB_STATS_NOOP |
---|
.. | .. |
---|
1608 | 3059 | #define DHD_LB_STATS_RXC_PERCPU_CNT_INCR(dhdp) DHD_LB_STATS_NOOP |
---|
1609 | 3060 | #endif /* !DHD_LB_STATS */ |
---|
1610 | 3061 | |
---|
| 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 |
---|
1611 | 3090 | 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 */ |
---|
1612 | 3099 | |
---|
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); |
---|
1619 | 3102 | |
---|
| 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 */ |
---|
1620 | 3491 | #endif /* _dhd_h_ */ |
---|