.. | .. |
---|
1 | | -/* SPDX-License-Identifier: GPL-2.0 */ |
---|
2 | 1 | /* |
---|
3 | 2 | * Linux cfg80211 driver |
---|
4 | 3 | * |
---|
5 | | - * Copyright (C) 1999-2019, Broadcom Corporation |
---|
6 | | - * |
---|
| 4 | + * Portions of this code are copyright (c) 2022 Cypress Semiconductor Corporation |
---|
| 5 | + * |
---|
| 6 | + * Copyright (C) 1999-2017, Broadcom Corporation |
---|
| 7 | + * |
---|
7 | 8 | * Unless you and Broadcom execute a separate written software license |
---|
8 | 9 | * agreement governing use of this software, this software is licensed to you |
---|
9 | 10 | * under the terms of the GNU General Public License version 2 (the "GPL"), |
---|
10 | 11 | * available at http://www.broadcom.com/licenses/GPLv2.php, with the |
---|
11 | 12 | * following added to such license: |
---|
12 | | - * |
---|
| 13 | + * |
---|
13 | 14 | * As a special exception, the copyright holders of this software give you |
---|
14 | 15 | * permission to link this software with independent modules, and to copy and |
---|
15 | 16 | * distribute the resulting executable under terms of your choice, provided that |
---|
.. | .. |
---|
17 | 18 | * the license of that module. An independent module is a module which is not |
---|
18 | 19 | * derived from this software. The special exception does not apply to any |
---|
19 | 20 | * modifications of the software. |
---|
20 | | - * |
---|
| 21 | + * |
---|
21 | 22 | * Notwithstanding the above, under no circumstances may you combine this |
---|
22 | 23 | * software in any way with any other Broadcom software provided under a license |
---|
23 | 24 | * other than the GPL, without Broadcom's express prior written consent. |
---|
.. | .. |
---|
25 | 26 | * |
---|
26 | 27 | * <<Broadcom-WL-IPTag/Open:>> |
---|
27 | 28 | * |
---|
28 | | - * $Id: wl_cfg80211.h 598406 2015-11-09 13:44:22Z $ |
---|
| 29 | + * $Id: wl_cfg80211.h 815697 2019-04-19 03:53:33Z $ |
---|
29 | 30 | */ |
---|
30 | 31 | |
---|
31 | 32 | /** |
---|
.. | .. |
---|
37 | 38 | |
---|
38 | 39 | #include <linux/wireless.h> |
---|
39 | 40 | #include <typedefs.h> |
---|
40 | | -#include <proto/ethernet.h> |
---|
| 41 | +#include <ethernet.h> |
---|
41 | 42 | #include <wlioctl.h> |
---|
42 | 43 | #include <linux/wireless.h> |
---|
43 | 44 | #include <net/cfg80211.h> |
---|
44 | 45 | #include <linux/rfkill.h> |
---|
| 46 | +#include <osl.h> |
---|
| 47 | +#include <dngl_stats.h> |
---|
| 48 | +#include <dhd.h> |
---|
| 49 | + |
---|
| 50 | +#define WL_CFG_DRV_LOCK(lock, flags) (flags) = osl_spin_lock(lock) |
---|
| 51 | +#define WL_CFG_DRV_UNLOCK(lock, flags) osl_spin_unlock((lock), (flags)) |
---|
| 52 | + |
---|
| 53 | +#define WL_CFG_WPS_SYNC_LOCK(lock, flags) (flags) = osl_spin_lock(lock) |
---|
| 54 | +#define WL_CFG_WPS_SYNC_UNLOCK(lock, flags) osl_spin_unlock((lock), (flags)) |
---|
| 55 | + |
---|
| 56 | +#define WL_CFG_NET_LIST_SYNC_LOCK(lock, flags) (flags) = osl_spin_lock(lock) |
---|
| 57 | +#define WL_CFG_NET_LIST_SYNC_UNLOCK(lock, flags) osl_spin_unlock((lock), (flags)) |
---|
| 58 | + |
---|
| 59 | +#define WL_CFG_EQ_LOCK(lock, flags) (flags) = osl_spin_lock(lock) |
---|
| 60 | +#define WL_CFG_EQ_UNLOCK(lock, flags) osl_spin_unlock((lock), (flags)) |
---|
| 61 | + |
---|
| 62 | +#define WL_CFG_BAM_LOCK(lock, flags) (flags) = osl_spin_lock(lock) |
---|
| 63 | +#define WL_CFG_BAM_UNLOCK(lock, flags) osl_spin_unlock((lock), (flags)) |
---|
| 64 | + |
---|
| 65 | +#define WL_CFG_VNDR_OUI_SYNC_LOCK(lock, flags) (flags) = osl_spin_lock(lock) |
---|
| 66 | +#define WL_CFG_VNDR_OUI_SYNC_UNLOCK(lock, flags) osl_spin_unlock((lock), (flags)) |
---|
45 | 67 | |
---|
46 | 68 | #include <wl_cfgp2p.h> |
---|
47 | | - |
---|
| 69 | +#ifdef WL_NAN |
---|
| 70 | +#include <wl_cfgnan.h> |
---|
| 71 | +#endif /* WL_NAN */ |
---|
| 72 | +#ifdef WL_BAM |
---|
| 73 | +#include <wl_bam.h> |
---|
| 74 | +#endif /* WL_BAM */ |
---|
| 75 | +#ifdef BIGDATA_SOFTAP |
---|
| 76 | +#include <wl_bigdata.h> |
---|
| 77 | +#endif /* BIGDATA_SOFTAP */ |
---|
48 | 78 | struct wl_conf; |
---|
49 | 79 | struct wl_iface; |
---|
50 | 80 | struct bcm_cfg80211; |
---|
51 | 81 | struct wl_security; |
---|
52 | 82 | struct wl_ibss; |
---|
53 | 83 | |
---|
| 84 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) && !defined(WL_SAE)) |
---|
| 85 | +#define WL_SAE |
---|
| 86 | +#endif // endif |
---|
| 87 | + |
---|
| 88 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0) && !defined(WL_FILS_ROAM_OFFLD)) |
---|
| 89 | +#define WL_FILS_ROAM_OFFLD |
---|
| 90 | +#endif // endif |
---|
| 91 | + |
---|
| 92 | +#ifdef WL_SAE |
---|
| 93 | +#define IS_AKM_SAE(akm) (akm == WLAN_AKM_SUITE_SAE) |
---|
| 94 | +#else |
---|
| 95 | +#define IS_AKM_SAE(akm) FALSE |
---|
| 96 | +#endif // endif |
---|
| 97 | +#ifdef WL_OWE |
---|
| 98 | +#define IS_AKM_OWE(akm) (akm == WLAN_AKM_SUITE_OWE) |
---|
| 99 | +#else |
---|
| 100 | +#define IS_AKM_OWE(akm) FALSE |
---|
| 101 | +#endif // endif |
---|
54 | 102 | |
---|
55 | 103 | #define htod32(i) (i) |
---|
56 | 104 | #define htod16(i) (i) |
---|
.. | .. |
---|
61 | 109 | #define dtohchanspec(i) (i) |
---|
62 | 110 | |
---|
63 | 111 | #define WL_DBG_NONE 0 |
---|
64 | | -#define WL_DBG_P2P_ACTION (1 << 5) |
---|
| 112 | +#define WL_DBG_P2P_ACTION (1 << 5) |
---|
65 | 113 | #define WL_DBG_TRACE (1 << 4) |
---|
66 | | -#define WL_DBG_SCAN (1 << 3) |
---|
67 | | -#define WL_DBG_DBG (1 << 2) |
---|
| 114 | +#define WL_DBG_SCAN (1 << 3) |
---|
| 115 | +#define WL_DBG_DBG (1 << 2) |
---|
68 | 116 | #define WL_DBG_INFO (1 << 1) |
---|
69 | 117 | #define WL_DBG_ERR (1 << 0) |
---|
| 118 | + |
---|
| 119 | +#ifndef WAIT_FOR_DISCONNECT_MAX |
---|
| 120 | +#define WAIT_FOR_DISCONNECT_MAX 10 |
---|
| 121 | +#endif /* WAIT_FOR_DISCONNECT_MAX */ |
---|
| 122 | +#define WAIT_FOR_DISCONNECT_STATE_SYNC 10 |
---|
| 123 | + |
---|
| 124 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) |
---|
| 125 | +/* Newer kernels use defines from nl80211.h */ |
---|
| 126 | +#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ |
---|
| 127 | +#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ |
---|
| 128 | +#define IEEE80211_BAND_6GHZ NL80211_BAND_6GHZ |
---|
| 129 | +#define IEEE80211_BAND_60GHZ NL80211_BAND_60GHZ |
---|
| 130 | +#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS |
---|
| 131 | +#endif /* LINUX_VER >= 4.7 */ |
---|
| 132 | + |
---|
| 133 | +#ifdef DHD_LOG_DUMP |
---|
| 134 | +extern void dhd_log_dump_write(int type, char *binary_data, |
---|
| 135 | + int binary_len, const char *fmt, ...); |
---|
| 136 | +extern char *dhd_log_dump_get_timestamp(void); |
---|
| 137 | +#ifndef _DHD_LOG_DUMP_DEFINITIONS_ |
---|
| 138 | +#define DHD_LOG_DUMP_WRITE(fmt, ...) \ |
---|
| 139 | + dhd_log_dump_write(DLD_BUF_TYPE_GENERAL, NULL, 0, fmt, ##__VA_ARGS__) |
---|
| 140 | +#define DHD_LOG_DUMP_WRITE_EX(fmt, ...) \ |
---|
| 141 | + dhd_log_dump_write(DLD_BUF_TYPE_SPECIAL, NULL, 0, fmt, ##__VA_ARGS__) |
---|
| 142 | +#endif /* !_DHD_LOG_DUMP_DEFINITIONS_ */ |
---|
| 143 | +#endif /* DHD_LOG_DUMP */ |
---|
| 144 | + |
---|
| 145 | +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)) || (defined(CONFIG_ARCH_MSM) && \ |
---|
| 146 | + defined(CFG80211_DISCONNECTED_V2)) |
---|
| 147 | +#define CFG80211_DISCONNECTED(dev, reason, ie, len, loc_gen, gfp) \ |
---|
| 148 | + cfg80211_disconnected(dev, reason, ie, len, loc_gen, gfp); |
---|
| 149 | +#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)) |
---|
| 150 | +#define CFG80211_DISCONNECTED(dev, reason, ie, len, loc_gen, gfp) \ |
---|
| 151 | + BCM_REFERENCE(loc_gen); \ |
---|
| 152 | + cfg80211_disconnected(dev, reason, ie, len, gfp); |
---|
| 153 | +#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)) */ |
---|
70 | 154 | |
---|
71 | 155 | /* 0 invalidates all debug messages. default is 1 */ |
---|
72 | 156 | #define WL_DBG_LEVEL 0xFF |
---|
73 | 157 | |
---|
| 158 | +#define CFG80211_INFO_TEXT "CFG80211-INFO) " |
---|
| 159 | +#ifdef CUSTOMER_HW4_DEBUG |
---|
| 160 | +#define CFG80211_ERROR_TEXT "CFG80211-INFO2) " |
---|
| 161 | +#else |
---|
74 | 162 | #define CFG80211_ERROR_TEXT "CFG80211-ERROR) " |
---|
| 163 | +#endif /* CUSTOMER_HW4_DEBUG */ |
---|
75 | 164 | |
---|
76 | 165 | #if defined(DHD_DEBUG) |
---|
| 166 | +#ifdef DHD_LOG_DUMP |
---|
| 167 | +#define WL_ERR(args) \ |
---|
| 168 | +do { \ |
---|
| 169 | + if (wl_dbg_level & WL_DBG_ERR) { \ |
---|
| 170 | + printk(KERN_INFO CFG80211_ERROR_TEXT "%s : ", __func__); \ |
---|
| 171 | + pr_cont args; \ |
---|
| 172 | + DHD_LOG_DUMP_WRITE("[%s] %s: ", dhd_log_dump_get_timestamp(), __func__); \ |
---|
| 173 | + DHD_LOG_DUMP_WRITE args; \ |
---|
| 174 | + } \ |
---|
| 175 | +} while (0) |
---|
| 176 | +#define WL_ERR_KERN(args) \ |
---|
| 177 | +do { \ |
---|
| 178 | + if (wl_dbg_level & WL_DBG_ERR) { \ |
---|
| 179 | + printk(KERN_INFO CFG80211_ERROR_TEXT "%s : ", __func__); \ |
---|
| 180 | + pr_cont args; \ |
---|
| 181 | + } \ |
---|
| 182 | +} while (0) |
---|
| 183 | +#define WL_ERR_MEM(args) \ |
---|
| 184 | +do { \ |
---|
| 185 | + if (wl_dbg_level & WL_DBG_ERR) { \ |
---|
| 186 | + DHD_LOG_DUMP_WRITE("[%s] %s: ", dhd_log_dump_get_timestamp(), __func__); \ |
---|
| 187 | + DHD_LOG_DUMP_WRITE args; \ |
---|
| 188 | + } \ |
---|
| 189 | +} while (0) |
---|
| 190 | +#define WL_INFORM_MEM(args) \ |
---|
| 191 | +do { \ |
---|
| 192 | + if (wl_dbg_level & WL_DBG_INFO) { \ |
---|
| 193 | + printk(KERN_INFO CFG80211_INFO_TEXT "%s : ", __func__); \ |
---|
| 194 | + pr_cont args; \ |
---|
| 195 | + DHD_LOG_DUMP_WRITE("[%s] %s: ", dhd_log_dump_get_timestamp(), __func__); \ |
---|
| 196 | + DHD_LOG_DUMP_WRITE args; \ |
---|
| 197 | + } \ |
---|
| 198 | +} while (0) |
---|
| 199 | +#define WL_ERR_EX(args) \ |
---|
| 200 | +do { \ |
---|
| 201 | + if (wl_dbg_level & WL_DBG_ERR) { \ |
---|
| 202 | + printk(KERN_INFO CFG80211_ERROR_TEXT "%s : ", __func__); \ |
---|
| 203 | + pr_cont args; \ |
---|
| 204 | + DHD_LOG_DUMP_WRITE_EX("[%s] %s: ", dhd_log_dump_get_timestamp(), __func__); \ |
---|
| 205 | + DHD_LOG_DUMP_WRITE_EX args; \ |
---|
| 206 | + } \ |
---|
| 207 | +} while (0) |
---|
| 208 | +#define WL_MEM(args) \ |
---|
| 209 | +do { \ |
---|
| 210 | + DHD_LOG_DUMP_WRITE("[%s] %s: ", dhd_log_dump_get_timestamp(), __func__); \ |
---|
| 211 | + DHD_LOG_DUMP_WRITE args; \ |
---|
| 212 | +} while (0) |
---|
| 213 | +#else |
---|
77 | 214 | #define WL_ERR(args) \ |
---|
78 | 215 | do { \ |
---|
79 | 216 | if (wl_dbg_level & WL_DBG_ERR) { \ |
---|
80 | 217 | printk(KERN_INFO CFG80211_ERROR_TEXT "%s : ", __func__); \ |
---|
81 | | - printk args; \ |
---|
| 218 | + pr_cont args; \ |
---|
82 | 219 | } \ |
---|
83 | 220 | } while (0) |
---|
| 221 | +#define WL_ERR_KERN(args) WL_ERR(args) |
---|
| 222 | +#define WL_ERR_MEM(args) WL_ERR(args) |
---|
| 223 | +#define WL_INFORM_MEM(args) WL_INFORM(args) |
---|
| 224 | +#define WL_ERR_EX(args) WL_ERR(args) |
---|
| 225 | +#define WL_MEM(args) WL_DBG(args) |
---|
| 226 | +#endif /* DHD_LOG_DUMP */ |
---|
84 | 227 | #else /* defined(DHD_DEBUG) */ |
---|
85 | 228 | #define WL_ERR(args) \ |
---|
86 | 229 | do { \ |
---|
87 | 230 | if ((wl_dbg_level & WL_DBG_ERR) && net_ratelimit()) { \ |
---|
88 | 231 | printk(KERN_INFO CFG80211_ERROR_TEXT "%s : ", __func__); \ |
---|
89 | | - printk args; \ |
---|
| 232 | + pr_cont args; \ |
---|
90 | 233 | } \ |
---|
91 | 234 | } while (0) |
---|
| 235 | +#define WL_ERR_KERN(args) WL_ERR(args) |
---|
| 236 | +#define WL_ERR_MEM(args) WL_ERR(args) |
---|
| 237 | +#define WL_INFORM_MEM(args) WL_INFORM(args) |
---|
| 238 | +#define WL_ERR_EX(args) WL_ERR(args) |
---|
| 239 | +#define WL_MEM(args) WL_DBG(args) |
---|
92 | 240 | #endif /* defined(DHD_DEBUG) */ |
---|
| 241 | + |
---|
| 242 | +#define WL_PRINT_RATE_LIMIT_PERIOD 4000000000u /* 4s in units of ns */ |
---|
| 243 | +#define WL_ERR_RLMT(args) \ |
---|
| 244 | +do { \ |
---|
| 245 | + if (wl_dbg_level & WL_DBG_ERR) { \ |
---|
| 246 | + static uint64 __err_ts = 0; \ |
---|
| 247 | + static uint32 __err_cnt = 0; \ |
---|
| 248 | + uint64 __cur_ts = 0; \ |
---|
| 249 | + __cur_ts = local_clock(); \ |
---|
| 250 | + if (__err_ts == 0 || (__cur_ts > __err_ts && \ |
---|
| 251 | + (__cur_ts - __err_ts > WL_PRINT_RATE_LIMIT_PERIOD))) { \ |
---|
| 252 | + __err_ts = __cur_ts; \ |
---|
| 253 | + WL_ERR(args); \ |
---|
| 254 | + WL_ERR(("[Repeats %u times]\n", __err_cnt)); \ |
---|
| 255 | + __err_cnt = 0; \ |
---|
| 256 | + } else { \ |
---|
| 257 | + ++__err_cnt; \ |
---|
| 258 | + } \ |
---|
| 259 | + } \ |
---|
| 260 | +} while (0) |
---|
93 | 261 | |
---|
94 | 262 | #ifdef WL_INFORM |
---|
95 | 263 | #undef WL_INFORM |
---|
96 | | -#endif |
---|
| 264 | +#endif // endif |
---|
97 | 265 | |
---|
98 | 266 | #define WL_INFORM(args) \ |
---|
99 | 267 | do { \ |
---|
100 | 268 | if (wl_dbg_level & WL_DBG_INFO) { \ |
---|
101 | 269 | printk(KERN_INFO "CFG80211-INFO) %s : ", __func__); \ |
---|
102 | | - printk args; \ |
---|
| 270 | + pr_cont args; \ |
---|
103 | 271 | } \ |
---|
104 | 272 | } while (0) |
---|
105 | 273 | |
---|
106 | | - |
---|
107 | 274 | #ifdef WL_SCAN |
---|
108 | 275 | #undef WL_SCAN |
---|
109 | | -#endif |
---|
| 276 | +#endif // endif |
---|
110 | 277 | #define WL_SCAN(args) \ |
---|
111 | 278 | do { \ |
---|
112 | 279 | if (wl_dbg_level & WL_DBG_SCAN) { \ |
---|
113 | 280 | printk(KERN_INFO "CFG80211-SCAN) %s :", __func__); \ |
---|
114 | | - printk args; \ |
---|
| 281 | + pr_cont args; \ |
---|
115 | 282 | } \ |
---|
116 | 283 | } while (0) |
---|
117 | 284 | #ifdef WL_TRACE |
---|
118 | 285 | #undef WL_TRACE |
---|
119 | | -#endif |
---|
| 286 | +#endif // endif |
---|
120 | 287 | #define WL_TRACE(args) \ |
---|
121 | 288 | do { \ |
---|
122 | 289 | if (wl_dbg_level & WL_DBG_TRACE) { \ |
---|
123 | 290 | printk(KERN_INFO "CFG80211-TRACE) %s :", __func__); \ |
---|
124 | | - printk args; \ |
---|
| 291 | + pr_cont args; \ |
---|
125 | 292 | } \ |
---|
126 | 293 | } while (0) |
---|
127 | 294 | #ifdef WL_TRACE_HW4 |
---|
128 | 295 | #undef WL_TRACE_HW4 |
---|
129 | | -#endif |
---|
| 296 | +#endif // endif |
---|
| 297 | +#ifdef CUSTOMER_HW4_DEBUG |
---|
| 298 | +#define WL_TRACE_HW4(args) \ |
---|
| 299 | +do { \ |
---|
| 300 | + if (wl_dbg_level & WL_DBG_ERR) { \ |
---|
| 301 | + printk(KERN_INFO "CFG80211-TRACE) %s : ", __func__); \ |
---|
| 302 | + pr_cont args; \ |
---|
| 303 | + } \ |
---|
| 304 | +} while (0) |
---|
| 305 | +#else |
---|
130 | 306 | #define WL_TRACE_HW4 WL_TRACE |
---|
| 307 | +#endif /* CUSTOMER_HW4_DEBUG */ |
---|
131 | 308 | #if (WL_DBG_LEVEL > 0) |
---|
132 | 309 | #define WL_DBG(args) \ |
---|
133 | 310 | do { \ |
---|
134 | 311 | if (wl_dbg_level & WL_DBG_DBG) { \ |
---|
135 | | - printk(KERN_DEBUG "CFG80211-DEBUG) %s :", __func__); \ |
---|
136 | | - printk args; \ |
---|
| 312 | + printk(KERN_INFO "CFG80211-DEBUG) %s :", __func__); \ |
---|
| 313 | + pr_cont args; \ |
---|
137 | 314 | } \ |
---|
138 | 315 | } while (0) |
---|
139 | 316 | #else /* !(WL_DBG_LEVEL > 0) */ |
---|
.. | .. |
---|
141 | 318 | #endif /* (WL_DBG_LEVEL > 0) */ |
---|
142 | 319 | #define WL_PNO(x) |
---|
143 | 320 | #define WL_SD(x) |
---|
144 | | - |
---|
145 | 321 | |
---|
146 | 322 | #define WL_SCAN_RETRY_MAX 3 |
---|
147 | 323 | #define WL_NUM_PMKIDS_MAX MAXPMKID |
---|
.. | .. |
---|
159 | 335 | #define WL_MED_DWELL_TIME 400 |
---|
160 | 336 | #define WL_MIN_DWELL_TIME 100 |
---|
161 | 337 | #define WL_LONG_DWELL_TIME 1000 |
---|
162 | | -#define IFACE_MAX_CNT 4 |
---|
| 338 | +#define IFACE_MAX_CNT 6 |
---|
163 | 339 | #define WL_SCAN_CONNECT_DWELL_TIME_MS 200 |
---|
164 | 340 | #define WL_SCAN_JOIN_PROBE_INTERVAL_MS 20 |
---|
165 | 341 | #define WL_SCAN_JOIN_ACTIVE_DWELL_TIME_MS 320 |
---|
166 | 342 | #define WL_SCAN_JOIN_PASSIVE_DWELL_TIME_MS 400 |
---|
167 | 343 | #define WL_AF_TX_MAX_RETRY 5 |
---|
| 344 | +#ifdef WL_6E |
---|
| 345 | +#define WL_SCAN_JOIN_ACTIVE_DWELL_TIME_MS_6E 80 |
---|
| 346 | +#define WL_SCAN_JOIN_PASSIVE_DWELL_TIME_MS_6E 130 |
---|
| 347 | +#endif /* WL_6E */ |
---|
168 | 348 | |
---|
169 | 349 | #define WL_AF_SEARCH_TIME_MAX 450 |
---|
170 | 350 | #define WL_AF_TX_EXTRA_TIME_MAX 200 |
---|
171 | 351 | |
---|
172 | | -#define WL_SCAN_TIMER_INTERVAL_MS 10000 /* Scan timeout */ |
---|
173 | | -#define WL_CHANNEL_SYNC_RETRY 5 |
---|
174 | | -#define WL_INVALID -1 |
---|
| 352 | +/* Increase SCAN_TIMER_INTERVAL to 15secs from 10secs to accomodate 6Ghz Channels */ |
---|
| 353 | +#define WL_SCAN_TIMER_INTERVAL_MS 15000 /* Scan timeout */ |
---|
| 354 | +#ifdef WL_NAN |
---|
| 355 | +#define WL_SCAN_TIMER_INTERVAL_MS_NAN 15000 /* Scan timeout */ |
---|
| 356 | +#endif /* WL_NAN */ |
---|
| 357 | +#define WL_CHANNEL_SYNC_RETRY 5 |
---|
| 358 | +#define WL_INVALID -1 |
---|
175 | 359 | |
---|
176 | 360 | #ifdef DHD_LOSSLESS_ROAMING |
---|
177 | 361 | #define WL_ROAM_TIMEOUT_MS 1000 /* Roam timeout */ |
---|
178 | | -#endif |
---|
| 362 | +#endif // endif |
---|
| 363 | + |
---|
| 364 | +#ifdef ENABLE_HOGSQS |
---|
| 365 | +#define WL_HOGSQS_TIMEOUT_MS 5000 /* Hogger detection timeout */ |
---|
| 366 | +#endif // endif |
---|
| 367 | + |
---|
179 | 368 | /* Bring down SCB Timeout to 20secs from 60secs default */ |
---|
180 | 369 | #ifndef WL_SCB_TIMEOUT |
---|
181 | | -#define WL_SCB_TIMEOUT 20 |
---|
182 | | -#endif |
---|
| 370 | +#define WL_SCB_TIMEOUT 20 |
---|
| 371 | +#endif // endif |
---|
| 372 | + |
---|
| 373 | +#if defined(ROAM_ENABLE) || defined(ROAM_CHANNEL_CACHE) |
---|
| 374 | +#define ESCAN_CHANNEL_CACHE |
---|
| 375 | +#endif // endif |
---|
| 376 | + |
---|
| 377 | +#ifndef WL_SCB_ACTIVITY_TIME |
---|
| 378 | +#define WL_SCB_ACTIVITY_TIME 5 |
---|
| 379 | +#endif // endif |
---|
| 380 | + |
---|
| 381 | +#ifndef WL_SCB_MAX_PROBE |
---|
| 382 | +#define WL_SCB_MAX_PROBE 3 |
---|
| 383 | +#endif // endif |
---|
| 384 | + |
---|
| 385 | +#ifndef WL_PSPRETEND_RETRY_LIMIT |
---|
| 386 | +#define WL_PSPRETEND_RETRY_LIMIT 1 |
---|
| 387 | +#endif // endif |
---|
| 388 | + |
---|
| 389 | +#ifndef WL_MIN_PSPRETEND_THRESHOLD |
---|
| 390 | +#define WL_MIN_PSPRETEND_THRESHOLD 2 |
---|
| 391 | +#endif // endif |
---|
| 392 | + |
---|
| 393 | +/* Cipher suites */ |
---|
| 394 | +#ifndef WLAN_CIPHER_SUITE_PMK |
---|
| 395 | +#define WLAN_CIPHER_SUITE_PMK 0x00904C00 |
---|
| 396 | +#endif /* WLAN_CIPHER_SUITE_PMK */ |
---|
| 397 | + |
---|
| 398 | +#ifndef WLAN_AKM_SUITE_FT_8021X |
---|
| 399 | +#define WLAN_AKM_SUITE_FT_8021X 0x000FAC03 |
---|
| 400 | +#endif /* WLAN_AKM_SUITE_FT_8021X */ |
---|
| 401 | + |
---|
| 402 | +#ifndef WLAN_AKM_SUITE_FT_PSK |
---|
| 403 | +#define WLAN_AKM_SUITE_FT_PSK 0x000FAC04 |
---|
| 404 | +#endif /* WLAN_AKM_SUITE_FT_PSK */ |
---|
| 405 | + |
---|
| 406 | +#ifndef WLAN_AKM_SUITE_8021X_SUITE_B |
---|
| 407 | +#define WLAN_AKM_SUITE_8021X_SUITE_B 0x000FAC0B |
---|
| 408 | +#define WLAN_AKM_SUITE_8021X_SUITE_B_192 0x000FAC0C |
---|
| 409 | +#endif /* WLAN_AKM_SUITE_8021X_SUITE_B */ |
---|
| 410 | + |
---|
| 411 | +/* TODO: even in upstream linux(v5.0), FT-1X-SHA384 isn't defined and supported yet. |
---|
| 412 | + * need to revisit here to sync correct name later. |
---|
| 413 | + */ |
---|
| 414 | +#ifndef WLAN_AKM_SUITE_FT_8021X_SHA384 |
---|
| 415 | +#define WLAN_AKM_SUITE_FT_8021X_SHA384 0x000FAC0D |
---|
| 416 | +#endif /* WLAN_AKM_SUITE_FT_8021X_SHA384 */ |
---|
| 417 | + |
---|
| 418 | +#define WL_AKM_SUITE_SHA256_1X 0x000FAC05 |
---|
| 419 | +#define WL_AKM_SUITE_SHA256_PSK 0x000FAC06 |
---|
| 420 | +#define WLAN_AKM_SUITE_DPP 0x506F9A02 |
---|
| 421 | +#ifndef WPA2_WFA_AUTH_DPP |
---|
| 422 | +#define WPA2_WFA_AUTH_DPP 0x200000 /* WFA DPP AUTH */ |
---|
| 423 | +#endif /* WPA2_WFA_AUTH_DPP */ |
---|
| 424 | + |
---|
| 425 | +#ifndef WLAN_AKM_SUITE_FILS_SHA256 |
---|
| 426 | +#define WLAN_AKM_SUITE_FILS_SHA256 0x000FAC0E |
---|
| 427 | +#define WLAN_AKM_SUITE_FILS_SHA384 0x000FAC0F |
---|
| 428 | +#define WLAN_AKM_SUITE_FT_FILS_SHA256 0x000FAC10 |
---|
| 429 | +#define WLAN_AKM_SUITE_FT_FILS_SHA384 0x000FAC11 |
---|
| 430 | +#endif /* WLAN_AKM_SUITE_FILS_SHA256 */ |
---|
| 431 | + |
---|
| 432 | +#define MIN_VENDOR_EXTN_IE_LEN 2 |
---|
| 433 | +#ifdef WL_OWE |
---|
| 434 | +#ifndef WLAN_AKM_SUITE_OWE |
---|
| 435 | +#define WLAN_AKM_SUITE_OWE 0X000FAC12 |
---|
| 436 | +#endif /* WPA_KEY_MGMT_OWE */ |
---|
| 437 | +#endif /* WL_OWE */ |
---|
| 438 | + |
---|
| 439 | +/* |
---|
| 440 | + * BRCM local. |
---|
| 441 | + * Use a high number that's unlikely to clash with linux upstream for a while until we can |
---|
| 442 | + * submit these changes to the community. |
---|
| 443 | +*/ |
---|
| 444 | +#define NL80211_FEATURE_FW_4WAY_HANDSHAKE (1<<31) |
---|
183 | 445 | |
---|
184 | 446 | /* SCAN_SUPPRESS timer values in ms */ |
---|
185 | 447 | #define WL_SCAN_SUPPRESS_TIMEOUT 31000 /* default Framwork DHCP timeout is 30 sec */ |
---|
.. | .. |
---|
194 | 456 | #define WL_WOWLAN_PKT_FILTER_ID_FIRST 201 |
---|
195 | 457 | #define WL_WOWLAN_PKT_FILTER_ID_LAST (WL_WOWLAN_PKT_FILTER_ID_FIRST + \ |
---|
196 | 458 | WL_WOWLAN_MAX_PATTERNS - 1) |
---|
| 459 | +#ifdef WLAIBSS |
---|
| 460 | +#define IBSS_COALESCE_DEFAULT 0 |
---|
| 461 | +#define IBSS_INITIAL_SCAN_ALLOWED_DEFAULT 0 |
---|
| 462 | +#else /* WLAIBSS */ |
---|
| 463 | +#define IBSS_COALESCE_DEFAULT 1 |
---|
| 464 | +#define IBSS_INITIAL_SCAN_ALLOWED_DEFAULT 1 |
---|
| 465 | +#endif /* WLAIBSS */ |
---|
197 | 466 | |
---|
| 467 | +#ifdef WLTDLS |
---|
| 468 | +#define TDLS_TUNNELED_PRB_REQ "\x7f\x50\x6f\x9a\04" |
---|
| 469 | +#define TDLS_TUNNELED_PRB_RESP "\x7f\x50\x6f\x9a\05" |
---|
| 470 | +#define TDLS_MAX_IFACE_FOR_ENABLE 1 |
---|
| 471 | +#endif /* WLTDLS */ |
---|
| 472 | + |
---|
| 473 | +#ifdef WLAIBSS |
---|
| 474 | +/* Custom AIBSS beacon parameters */ |
---|
| 475 | +#define AIBSS_INITIAL_MIN_BCN_DUR 500 |
---|
| 476 | +#define AIBSS_MIN_BCN_DUR 5000 |
---|
| 477 | +#define AIBSS_BCN_FLOOD_DUR 5000 |
---|
| 478 | +#define AIBSS_PEER_FREE 3 |
---|
| 479 | +#endif /* WLAIBSS */ |
---|
| 480 | + |
---|
| 481 | +#ifndef FILS_INDICATION_IE_TAG_FIXED_LEN |
---|
| 482 | +#define FILS_INDICATION_IE_TAG_FIXED_LEN 2 |
---|
| 483 | +#endif // endif |
---|
198 | 484 | |
---|
199 | 485 | /* driver status */ |
---|
200 | 486 | enum wl_status { |
---|
.. | .. |
---|
231 | 517 | * a expire timer without actual listen state. |
---|
232 | 518 | * if set, other scan request does not need to abort scan. |
---|
233 | 519 | */ |
---|
234 | | - WL_STATUS_FAKE_REMAINING_ON_CHANNEL |
---|
| 520 | + WL_STATUS_FAKE_REMAINING_ON_CHANNEL, |
---|
235 | 521 | #endif /* WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST */ |
---|
| 522 | + WL_STATUS_NESTED_CONNECT, |
---|
| 523 | + WL_STATUS_CFG80211_CONNECT |
---|
236 | 524 | }; |
---|
| 525 | + |
---|
| 526 | +typedef enum wl_iftype { |
---|
| 527 | + WL_IF_TYPE_STA = 0, |
---|
| 528 | + WL_IF_TYPE_AP = 1, |
---|
| 529 | + WL_IF_TYPE_AWDL = 2, |
---|
| 530 | + WL_IF_TYPE_NAN_NMI = 3, |
---|
| 531 | + WL_IF_TYPE_NAN = 4, |
---|
| 532 | + WL_IF_TYPE_P2P_GO = 5, |
---|
| 533 | + WL_IF_TYPE_P2P_GC = 6, |
---|
| 534 | + WL_IF_TYPE_P2P_DISC = 7, |
---|
| 535 | + WL_IF_TYPE_IBSS = 8, |
---|
| 536 | + WL_IF_TYPE_MONITOR = 9, |
---|
| 537 | + WL_IF_TYPE_AIBSS = 10, |
---|
| 538 | + WL_IF_TYPE_MAX |
---|
| 539 | +} wl_iftype_t; |
---|
| 540 | + |
---|
| 541 | +typedef enum wl_interface_state { |
---|
| 542 | + WL_IF_CREATE_REQ, |
---|
| 543 | + WL_IF_CREATE_DONE, |
---|
| 544 | + WL_IF_DELETE_REQ, |
---|
| 545 | + WL_IF_DELETE_DONE, |
---|
| 546 | + WL_IF_CHANGE_REQ, |
---|
| 547 | + WL_IF_CHANGE_DONE, |
---|
| 548 | + WL_IF_STATE_MAX, /* Retain as last one */ |
---|
| 549 | +} wl_interface_state_t; |
---|
237 | 550 | |
---|
238 | 551 | /* wi-fi mode */ |
---|
239 | 552 | enum wl_mode { |
---|
240 | 553 | WL_MODE_BSS, |
---|
241 | 554 | WL_MODE_IBSS, |
---|
242 | | - WL_MODE_AP |
---|
| 555 | + WL_MODE_AP, |
---|
| 556 | + WL_MODE_AWDL, |
---|
| 557 | + WL_MODE_NAN |
---|
243 | 558 | }; |
---|
244 | 559 | |
---|
245 | 560 | /* driver profile list */ |
---|
.. | .. |
---|
253 | 568 | WL_PROF_BSSID, |
---|
254 | 569 | WL_PROF_ACT, |
---|
255 | 570 | WL_PROF_BEACONINT, |
---|
256 | | - WL_PROF_DTIMPERIOD |
---|
| 571 | + WL_PROF_DTIMPERIOD, |
---|
| 572 | + WL_PROF_LATEST_BSSID |
---|
257 | 573 | }; |
---|
258 | 574 | |
---|
259 | 575 | /* donlge escan state */ |
---|
260 | 576 | enum wl_escan_state { |
---|
261 | | - WL_ESCAN_STATE_IDLE, |
---|
262 | | - WL_ESCAN_STATE_SCANING |
---|
| 577 | + WL_ESCAN_STATE_IDLE, |
---|
| 578 | + WL_ESCAN_STATE_SCANING |
---|
263 | 579 | }; |
---|
264 | 580 | /* fw downloading status */ |
---|
265 | 581 | enum wl_fw_status { |
---|
.. | .. |
---|
273 | 589 | WL_ASSOC_RESP = 0x4 |
---|
274 | 590 | }; |
---|
275 | 591 | |
---|
276 | | -enum wl_handler_del_type { |
---|
277 | | - WL_HANDLER_NOTUSE, |
---|
278 | | - WL_HANDLER_DEL, |
---|
279 | | - WL_HANDLER_MAINTAIN, |
---|
280 | | - WL_HANDLER_PEND |
---|
| 592 | +enum wl_pm_workq_act_type { |
---|
| 593 | + WL_PM_WORKQ_SHORT, |
---|
| 594 | + WL_PM_WORKQ_LONG, |
---|
| 595 | + WL_PM_WORKQ_DEL |
---|
| 596 | +}; |
---|
| 597 | + |
---|
| 598 | +enum wl_tdls_config { |
---|
| 599 | + TDLS_STATE_AP_CREATE, |
---|
| 600 | + TDLS_STATE_AP_DELETE, |
---|
| 601 | + TDLS_STATE_CONNECT, |
---|
| 602 | + TDLS_STATE_DISCONNECT, |
---|
| 603 | + TDLS_STATE_SETUP, |
---|
| 604 | + TDLS_STATE_TEARDOWN, |
---|
| 605 | + TDLS_STATE_IF_CREATE, |
---|
| 606 | + TDLS_STATE_IF_DELETE, |
---|
| 607 | + TDLS_STATE_NMI_CREATE |
---|
281 | 608 | }; |
---|
282 | 609 | |
---|
283 | 610 | /* beacon / probe_response */ |
---|
.. | .. |
---|
326 | 653 | struct list_head eq_list; |
---|
327 | 654 | u32 etype; |
---|
328 | 655 | wl_event_msg_t emsg; |
---|
| 656 | + u32 datalen; |
---|
329 | 657 | s8 edata[1]; |
---|
330 | 658 | }; |
---|
331 | 659 | |
---|
.. | .. |
---|
354 | 682 | u8 assoc_req_ie[VNDR_IES_BUF_LEN]; |
---|
355 | 683 | u8 assoc_res_ie[VNDR_IES_BUF_LEN]; |
---|
356 | 684 | u8 beacon_ie[VNDR_IES_MAX_BUF_LEN]; |
---|
| 685 | + u8 disassoc_ie[VNDR_IES_BUF_LEN]; |
---|
357 | 686 | u32 probe_req_ie_len; |
---|
358 | 687 | u32 probe_res_ie_len; |
---|
359 | 688 | u32 assoc_req_ie_len; |
---|
360 | 689 | u32 assoc_res_ie_len; |
---|
361 | 690 | u32 beacon_ie_len; |
---|
| 691 | + u32 disassoc_ie_len; |
---|
362 | 692 | } wl_bss_vndr_ies_t; |
---|
363 | 693 | |
---|
364 | 694 | typedef struct wl_cfgbss { |
---|
365 | 695 | u8 *wpa_ie; |
---|
366 | 696 | u8 *rsn_ie; |
---|
367 | 697 | u8 *wps_ie; |
---|
| 698 | + u8 *fils_ind_ie; |
---|
368 | 699 | bool security_mode; |
---|
369 | | - struct wl_bss_vndr_ies ies; /* Common for STA, P2P GC, GO, AP, P2P Disc Interface */ |
---|
| 700 | + struct wl_bss_vndr_ies ies; /* Common for STA, P2P GC, GO, AP, P2P Disc Interface */ |
---|
370 | 701 | } wl_cfgbss_t; |
---|
| 702 | + |
---|
| 703 | +#ifdef WL11U |
---|
| 704 | +/* Max length of Interworking element */ |
---|
| 705 | +#define IW_IES_MAX_BUF_LEN 8 |
---|
| 706 | +#endif // endif |
---|
371 | 707 | |
---|
372 | 708 | /* cfg driver profile */ |
---|
373 | 709 | struct wl_profile { |
---|
.. | .. |
---|
381 | 717 | u16 beacon_interval; |
---|
382 | 718 | u8 dtim_period; |
---|
383 | 719 | bool active; |
---|
| 720 | + u8 latest_bssid[ETHER_ADDR_LEN]; |
---|
| 721 | + u32 channel_width; |
---|
| 722 | +#ifdef WL11U |
---|
| 723 | + u8 iw_ie[IW_IES_MAX_BUF_LEN]; |
---|
| 724 | + u32 iw_ie_len; |
---|
| 725 | +#endif /* WL11U */ |
---|
| 726 | + bool dpp_listen; |
---|
384 | 727 | }; |
---|
| 728 | + |
---|
| 729 | +struct wl_wps_ie { |
---|
| 730 | + uint8 id; /* IE ID: 0xDD */ |
---|
| 731 | + uint8 len; /* IE length */ |
---|
| 732 | + uint8 OUI[3]; /* WiFi WPS specific OUI */ |
---|
| 733 | + uint8 oui_type; /* Vendor specific OUI Type */ |
---|
| 734 | + uint8 attrib[1]; /* variable length attributes */ |
---|
| 735 | +} __attribute__ ((packed)); |
---|
| 736 | +typedef struct wl_wps_ie wl_wps_ie_t; |
---|
| 737 | + |
---|
| 738 | +struct wl_eap_msg { |
---|
| 739 | + uint16 attrib; |
---|
| 740 | + uint16 len; |
---|
| 741 | + uint8 type; |
---|
| 742 | +} __attribute__ ((packed)); |
---|
| 743 | +typedef struct wl_eap_msg wl_eap_msg_t; |
---|
| 744 | + |
---|
| 745 | +struct wl_eap_exp { |
---|
| 746 | + uint8 OUI[3]; |
---|
| 747 | + uint32 oui_type; |
---|
| 748 | + uint8 opcode; |
---|
| 749 | + u8 flags; |
---|
| 750 | + u8 data[1]; |
---|
| 751 | +} __attribute__ ((packed)); |
---|
| 752 | +typedef struct wl_eap_exp wl_eap_exp_t; |
---|
385 | 753 | |
---|
386 | 754 | struct net_info { |
---|
387 | 755 | struct net_device *ndev; |
---|
388 | 756 | struct wireless_dev *wdev; |
---|
389 | 757 | struct wl_profile profile; |
---|
390 | | - s32 mode; |
---|
| 758 | + wl_iftype_t iftype; |
---|
391 | 759 | s32 roam_off; |
---|
392 | 760 | unsigned long sme_state; |
---|
393 | 761 | bool pm_restore; |
---|
.. | .. |
---|
395 | 763 | s32 pm; |
---|
396 | 764 | s32 bssidx; |
---|
397 | 765 | wl_cfgbss_t bss; |
---|
398 | | - u32 ulb_bw; |
---|
| 766 | + u8 ifidx; |
---|
| 767 | +#ifdef WL_SAE |
---|
| 768 | + unsigned long mgmt_txstatus; |
---|
| 769 | + size_t mgmt_txid; |
---|
| 770 | + struct completion mgmt_tx_cpl; |
---|
| 771 | +#endif /* WL_SAE */ |
---|
399 | 772 | struct list_head list; /* list of all net_info structure */ |
---|
400 | 773 | }; |
---|
| 774 | +#ifdef WL_SAE |
---|
| 775 | +#define WL_WSEC_MAX_SAE_PASSWORD_LEN 128 |
---|
| 776 | +#define WL_WSEC_MIN_SAE_PASSWORD_LEN 8 |
---|
| 777 | +/** |
---|
| 778 | + * struct brcmf_wsec_sae_pwd_le - firmware SAE password material. |
---|
| 779 | + * |
---|
| 780 | + * @key_len: number of octets in key materials. |
---|
| 781 | + * @key: SAE password material. |
---|
| 782 | + */ |
---|
| 783 | +struct wl_wsec_sae_pwd_le { |
---|
| 784 | + u16 key_len; |
---|
| 785 | + u8 key[WL_WSEC_MAX_SAE_PASSWORD_LEN]; |
---|
| 786 | +}; |
---|
| 787 | + |
---|
| 788 | +#endif // endif |
---|
| 789 | +#ifdef WL_BCNRECV |
---|
| 790 | +/* PERIODIC Beacon receive for detecting FakeAPs */ |
---|
| 791 | +typedef struct wl_bcnrecv_result { |
---|
| 792 | + uint8 SSID[DOT11_MAX_SSID_LEN]; /**< SSID String */ |
---|
| 793 | + struct ether_addr BSSID; /**< Network BSSID */ |
---|
| 794 | + uint8 channel; /**< Channel */ |
---|
| 795 | + uint16 beacon_interval; |
---|
| 796 | + uint32 timestamp[2]; /**< Beacon Timestamp */ |
---|
| 797 | + uint64 system_time; |
---|
| 798 | +} wl_bcnrecv_result_t; |
---|
| 799 | + |
---|
| 800 | +typedef struct wl_bcnrecv_info { |
---|
| 801 | + uint bcnrecv_state; /* TO know the fakeap state */ |
---|
| 802 | +} wl_bcnrecv_info_t; |
---|
| 803 | + |
---|
| 804 | +typedef enum wl_bcnrecv_state { |
---|
| 805 | + BEACON_RECV_IDLE = 0, |
---|
| 806 | + BEACON_RECV_STARTED, |
---|
| 807 | + BEACON_RECV_STOPPED, |
---|
| 808 | + BEACON_RECV_SUSPENDED |
---|
| 809 | +} wl_bcnrecv_state_t; |
---|
| 810 | + |
---|
| 811 | +typedef enum wl_bcnrecv_reason { |
---|
| 812 | + WL_BCNRECV_INVALID = 0, |
---|
| 813 | + WL_BCNRECV_USER_TRIGGER, |
---|
| 814 | + WL_BCNRECV_SUSPEND, |
---|
| 815 | + WL_BCNRECV_SCANBUSY, |
---|
| 816 | + WL_BCNRECV_CONCURRENCY, |
---|
| 817 | + WL_BCNRECV_LISTENBUSY, |
---|
| 818 | + WL_BCNRECV_ROAMABORT, |
---|
| 819 | + WL_BCNRECV_HANG |
---|
| 820 | +} wl_bcnrecv_reason_t; |
---|
| 821 | + |
---|
| 822 | +typedef enum wl_bcnrecv_status { |
---|
| 823 | + WL_BCNRECV_STARTED = 0, |
---|
| 824 | + WL_BCNRECV_STOPPED, |
---|
| 825 | + WL_BCNRECV_ABORTED, |
---|
| 826 | + WL_BCNRECV_SUSPENDED, |
---|
| 827 | + WL_BCNRECV_MAX |
---|
| 828 | +} wl_bcnrecv_status_t; |
---|
| 829 | + |
---|
| 830 | +typedef enum wl_bcnrecv_attr_type { |
---|
| 831 | + BCNRECV_ATTR_STATUS = 1, |
---|
| 832 | + BCNRECV_ATTR_REASON, |
---|
| 833 | + BCNRECV_ATTR_BCNINFO |
---|
| 834 | +} wl_bcnrecv_attr_type_t; |
---|
| 835 | +#endif /* WL_BCNRECV */ |
---|
| 836 | +#ifdef WL_CHAN_UTIL |
---|
| 837 | +#define CU_ATTR_PERCENTAGE 1 |
---|
| 838 | +#define CU_ATTR_HDR_LEN 30 |
---|
| 839 | +#endif /* WL_CHAN_UTIL */ |
---|
401 | 840 | |
---|
402 | 841 | /* association inform */ |
---|
403 | | -#define MAX_REQ_LINE 1024 |
---|
| 842 | +#define MAX_REQ_LINE 1024u |
---|
404 | 843 | struct wl_connect_info { |
---|
405 | 844 | u8 req_ie[MAX_REQ_LINE]; |
---|
406 | | - s32 req_ie_len; |
---|
| 845 | + u32 req_ie_len; |
---|
407 | 846 | u8 resp_ie[MAX_REQ_LINE]; |
---|
408 | | - s32 resp_ie_len; |
---|
| 847 | + u32 resp_ie_len; |
---|
| 848 | +}; |
---|
| 849 | +#define WL_MAX_FILS_KEY_LEN 64 |
---|
| 850 | + |
---|
| 851 | +struct wl_fils_info { |
---|
| 852 | + u8 fils_kek[WL_MAX_FILS_KEY_LEN]; |
---|
| 853 | + u32 fils_kek_len; |
---|
| 854 | + u8 fils_pmk[WL_MAX_FILS_KEY_LEN]; |
---|
| 855 | + u32 fils_pmk_len; |
---|
| 856 | + u8 fils_pmkid[WL_MAX_FILS_KEY_LEN]; |
---|
| 857 | + u16 fils_erp_next_seq_num; |
---|
| 858 | + bool fils_roam_disabled; |
---|
| 859 | + u32 fils_bcn_timeout_cache; |
---|
409 | 860 | }; |
---|
410 | 861 | |
---|
411 | 862 | /* firmware /nvram downloading controller */ |
---|
.. | .. |
---|
423 | 874 | u32 resp_len; |
---|
424 | 875 | }; |
---|
425 | 876 | |
---|
| 877 | +#define MIN_PMKID_LIST_V3_FW_MAJOR 13 |
---|
| 878 | +#define MIN_PMKID_LIST_V3_FW_MINOR 0 |
---|
| 879 | + |
---|
| 880 | +#define MIN_PMKID_LIST_V2_FW_MAJOR 12 |
---|
| 881 | +#define MIN_PMKID_LIST_V2_FW_MINOR 0 |
---|
| 882 | + |
---|
| 883 | +#define MIN_ESCAN_PARAM_V2_FW_MAJOR 14 |
---|
| 884 | +#define MIN_ESCAN_PARAM_V2_FW_MINOR 0 |
---|
| 885 | + |
---|
426 | 886 | /* wpa2 pmk list */ |
---|
427 | 887 | struct wl_pmk_list { |
---|
428 | | - pmkid_list_t pmkids; |
---|
429 | | - pmkid_t foo[MAXPMKID - 1]; |
---|
| 888 | + pmkid_list_v3_t pmkids; |
---|
| 889 | + pmkid_v3_t foo[MAXPMKID - 1]; |
---|
430 | 890 | }; |
---|
| 891 | + |
---|
| 892 | +#define KEY_PERM_PMK 0xFFFFFFFF |
---|
431 | 893 | |
---|
432 | 894 | #ifdef DHD_MAX_IFS |
---|
433 | 895 | #define WL_MAX_IFS DHD_MAX_IFS |
---|
434 | 896 | #else |
---|
435 | 897 | #define WL_MAX_IFS 16 |
---|
436 | | -#endif |
---|
| 898 | +#endif // endif |
---|
437 | 899 | |
---|
| 900 | +#define MAC_RAND_BYTES 3 |
---|
438 | 901 | #define ESCAN_BUF_SIZE (64 * 1024) |
---|
439 | 902 | |
---|
440 | 903 | struct escan_info { |
---|
441 | 904 | u32 escan_state; |
---|
442 | | -#if defined(STATIC_WL_PRIV_STRUCT) |
---|
| 905 | +#ifdef STATIC_WL_PRIV_STRUCT |
---|
443 | 906 | #ifndef CONFIG_DHD_USE_STATIC_BUF |
---|
444 | 907 | #error STATIC_WL_PRIV_STRUCT should be used with CONFIG_DHD_USE_STATIC_BUF |
---|
445 | 908 | #endif /* CONFIG_DHD_USE_STATIC_BUF */ |
---|
| 909 | +#ifdef DUAL_ESCAN_RESULT_BUFFER |
---|
| 910 | + u8 *escan_buf[2]; |
---|
| 911 | +#else |
---|
446 | 912 | u8 *escan_buf; |
---|
| 913 | +#endif /* DUAL_ESCAN_RESULT_BUFFER */ |
---|
| 914 | +#else |
---|
| 915 | +#ifdef DUAL_ESCAN_RESULT_BUFFER |
---|
| 916 | + u8 escan_buf[2][ESCAN_BUF_SIZE]; |
---|
447 | 917 | #else |
---|
448 | 918 | u8 escan_buf[ESCAN_BUF_SIZE]; |
---|
| 919 | +#endif /* DUAL_ESCAN_RESULT_BUFFER */ |
---|
449 | 920 | #endif /* STATIC_WL_PRIV_STRUCT */ |
---|
| 921 | +#ifdef DUAL_ESCAN_RESULT_BUFFER |
---|
| 922 | + u8 cur_sync_id; |
---|
| 923 | + u8 escan_type[2]; |
---|
| 924 | +#endif /* DUAL_ESCAN_RESULT_BUFFER */ |
---|
450 | 925 | struct wiphy *wiphy; |
---|
451 | 926 | struct net_device *ndev; |
---|
452 | 927 | }; |
---|
.. | .. |
---|
476 | 951 | }; |
---|
477 | 952 | |
---|
478 | 953 | struct parsed_ies { |
---|
479 | | - wpa_ie_fixed_t *wps_ie; |
---|
| 954 | + const wpa_ie_fixed_t *wps_ie; |
---|
480 | 955 | u32 wps_ie_len; |
---|
481 | | - wpa_ie_fixed_t *wpa_ie; |
---|
| 956 | + const wpa_ie_fixed_t *wpa_ie; |
---|
482 | 957 | u32 wpa_ie_len; |
---|
483 | | - bcm_tlv_t *wpa2_ie; |
---|
| 958 | + const bcm_tlv_t *wpa2_ie; |
---|
484 | 959 | u32 wpa2_ie_len; |
---|
| 960 | + const bcm_tlv_t *fils_ind_ie; |
---|
| 961 | + u32 fils_ind_ie_len; |
---|
485 | 962 | }; |
---|
486 | 963 | |
---|
| 964 | +#ifdef P2P_LISTEN_OFFLOADING |
---|
| 965 | +typedef struct { |
---|
| 966 | + uint16 period; /* listen offload period */ |
---|
| 967 | + uint16 interval; /* listen offload interval */ |
---|
| 968 | + uint16 count; /* listen offload count */ |
---|
| 969 | + uint16 pad; /* pad for 32bit align */ |
---|
| 970 | +} wl_p2plo_listen_t; |
---|
| 971 | +#endif /* P2P_LISTEN_OFFLOADING */ |
---|
487 | 972 | |
---|
488 | | -#ifdef WL11U |
---|
489 | | -/* Max length of Interworking element */ |
---|
490 | | -#define IW_IES_MAX_BUF_LEN 9 |
---|
491 | | -#endif |
---|
492 | 973 | #ifdef WLFBT |
---|
493 | 974 | #define FBT_KEYLEN 32 |
---|
494 | | -#endif |
---|
| 975 | +#endif // endif |
---|
495 | 976 | #define MAX_EVENT_BUF_NUM 16 |
---|
496 | 977 | typedef struct wl_eventmsg_buf { |
---|
497 | | - u16 num; |
---|
498 | | - struct { |
---|
| 978 | + u16 num; |
---|
| 979 | + struct { |
---|
499 | 980 | u16 type; |
---|
500 | 981 | bool set; |
---|
501 | 982 | } event [MAX_EVENT_BUF_NUM]; |
---|
.. | .. |
---|
507 | 988 | int bssidx; |
---|
508 | 989 | uint8 mac[ETHER_ADDR_LEN]; |
---|
509 | 990 | char name[IFNAMSIZ+1]; |
---|
| 991 | + uint8 role; |
---|
510 | 992 | } wl_if_event_info; |
---|
| 993 | + |
---|
| 994 | +#ifdef SUPPORT_AP_RADIO_PWRSAVE |
---|
| 995 | +typedef struct ap_rps_info { |
---|
| 996 | + bool enable; |
---|
| 997 | + int sta_assoc_check; |
---|
| 998 | + int pps; |
---|
| 999 | + int quiet_time; |
---|
| 1000 | + int level; |
---|
| 1001 | +} ap_rps_info_t; |
---|
| 1002 | +#endif /* SUPPORT_AP_RADIO_PWRSAVE */ |
---|
| 1003 | + |
---|
| 1004 | +#ifdef SUPPORT_RSSI_SUM_REPORT |
---|
| 1005 | +#define RSSILOG_FLAG_FEATURE_SW 0x1 |
---|
| 1006 | +#define RSSILOG_FLAG_REPORT_READY 0x2 |
---|
| 1007 | +typedef struct rssilog_set_param { |
---|
| 1008 | + uint8 enable; |
---|
| 1009 | + uint8 rssi_threshold; |
---|
| 1010 | + uint8 time_threshold; |
---|
| 1011 | + uint8 pad; |
---|
| 1012 | +} rssilog_set_param_t; |
---|
| 1013 | + |
---|
| 1014 | +typedef struct rssilog_get_param { |
---|
| 1015 | + uint8 report_count; |
---|
| 1016 | + uint8 enable; |
---|
| 1017 | + uint8 rssi_threshold; |
---|
| 1018 | + uint8 time_threshold; |
---|
| 1019 | +} rssilog_get_param_t; |
---|
| 1020 | + |
---|
| 1021 | +typedef struct rssi_ant_param { |
---|
| 1022 | + struct ether_addr ea; |
---|
| 1023 | + chanspec_t chanspec; |
---|
| 1024 | +} rssi_ant_param_t; |
---|
| 1025 | + |
---|
| 1026 | +typedef struct wl_rssi_ant_mimo { |
---|
| 1027 | + uint32 version; |
---|
| 1028 | + uint32 count; |
---|
| 1029 | + int8 rssi_ant[WL_RSSI_ANT_MAX]; |
---|
| 1030 | + int8 rssi_sum; |
---|
| 1031 | + int8 PAD[3]; |
---|
| 1032 | +} wl_rssi_ant_mimo_t; |
---|
| 1033 | +#endif /* SUPPORT_RSSI_SUM_REPORT */ |
---|
| 1034 | + |
---|
| 1035 | +/* MBO-OCE prune event reason codes */ |
---|
| 1036 | +#if defined(WL_MBO) || defined(WL_OCE) |
---|
| 1037 | +typedef enum wl_prune_evt_reason { |
---|
| 1038 | + WIFI_PRUNE_UNSPECIFIED = 0, /* Unspecified event reason code */ |
---|
| 1039 | + WIFI_PRUNE_ASSOC_RETRY_DELAY = 1, /* MBO assoc retry delay */ |
---|
| 1040 | + WIFI_PRUNE_RSSI_ASSOC_REJ = 2 /* OCE RSSI-based assoc rejection */ |
---|
| 1041 | +} wl_prune_evt_reason_t; |
---|
| 1042 | +#endif /* WL_MBO || WL_OCE */ |
---|
| 1043 | + |
---|
| 1044 | +#if defined(DHD_ENABLE_BIGDATA_LOGGING) |
---|
| 1045 | +#define GET_BSS_INFO_LEN 90 |
---|
| 1046 | +#endif /* DHD_ENABLE_BIGDATA_LOGGING */ |
---|
| 1047 | + |
---|
| 1048 | +#ifdef WL_MBO |
---|
| 1049 | +typedef struct wl_event_mbo wl_event_mbo_t; |
---|
| 1050 | +typedef struct wl_event_mbo_cell_nw_switch wl_event_mbo_cell_nw_switch_t; |
---|
| 1051 | +typedef struct wl_btm_event_type_data wl_btm_event_type_data_t; |
---|
| 1052 | +#endif /* WL_MBO */ |
---|
| 1053 | + |
---|
| 1054 | +#if defined(WL_MBO) || defined(WL_OCE) |
---|
| 1055 | +typedef struct wl_bssid_prune_evt_info wl_bssid_pruned_evt_info_t; |
---|
| 1056 | +#endif /* WL_MBO || WL_OCE */ |
---|
| 1057 | + |
---|
| 1058 | +#ifdef WL_NAN |
---|
| 1059 | +#define NAN_MAX_NDI 1u |
---|
| 1060 | +typedef struct wl_ndi_data |
---|
| 1061 | +{ |
---|
| 1062 | + u8 ifname[IFNAMSIZ]; |
---|
| 1063 | + u8 in_use; |
---|
| 1064 | + u8 created; |
---|
| 1065 | + struct net_device *nan_ndev; |
---|
| 1066 | +} wl_ndi_data_t; |
---|
| 1067 | +typedef struct wl_nancfg |
---|
| 1068 | +{ |
---|
| 1069 | + wl_nan_ver_t version; |
---|
| 1070 | + wl_ndi_data_t ndi[NAN_MAX_NDI]; |
---|
| 1071 | + struct mutex nan_sync; |
---|
| 1072 | + uint8 svc_inst_id_mask[NAN_SVC_INST_SIZE]; |
---|
| 1073 | + uint8 inst_id_start; |
---|
| 1074 | + /* wait queue and condition variable for nan event */ |
---|
| 1075 | + bool nan_event_recvd; |
---|
| 1076 | + wait_queue_head_t nan_event_wait; |
---|
| 1077 | + nan_stop_reason_code_t disable_reason; |
---|
| 1078 | + bool mac_rand; |
---|
| 1079 | + int range_type; |
---|
| 1080 | + uint8 max_ndp_count; /* Max no. of NDPs */ |
---|
| 1081 | + nan_ndp_peer_t *nan_ndp_peer_info; |
---|
| 1082 | +} wl_nancfg_t; |
---|
| 1083 | + |
---|
| 1084 | +#ifdef WL_NANP2P |
---|
| 1085 | +#define WL_CFG_P2P_DISC_BIT 0x1u |
---|
| 1086 | +#define WL_CFG_NAN_DISC_BIT 0x2u |
---|
| 1087 | +#define WL_NANP2P_CONC_SUPPORT (WL_CFG_P2P_DISC_BIT | WL_CFG_NAN_DISC_BIT) |
---|
| 1088 | +#endif /* WL_NAN2P */ |
---|
| 1089 | +#endif /* WL_NAN */ |
---|
| 1090 | + |
---|
| 1091 | +#ifdef WL_IFACE_MGMT |
---|
| 1092 | +#define WL_IFACE_NOT_PRESENT -1 |
---|
| 1093 | + |
---|
| 1094 | +typedef enum iface_conc_policy { |
---|
| 1095 | + WL_IF_POLICY_DEFAULT = 0, |
---|
| 1096 | + WL_IF_POLICY_FCFS = 1, |
---|
| 1097 | + WL_IF_POLICY_LP = 2, |
---|
| 1098 | + WL_IF_POLICY_ROLE_PRIORITY = 3, |
---|
| 1099 | + WL_IF_POLICY_CUSTOM = 4, |
---|
| 1100 | + WL_IF_POLICY_INVALID |
---|
| 1101 | +} iface_conc_policy_t; |
---|
| 1102 | + |
---|
| 1103 | +typedef struct iface_mgmt_data { |
---|
| 1104 | + uint8 policy; |
---|
| 1105 | + uint8 priority[WL_IF_TYPE_MAX]; |
---|
| 1106 | +} iface_mgmt_data_t; |
---|
| 1107 | +#endif /* WL_IFACE_MGMT */ |
---|
| 1108 | + |
---|
| 1109 | +#ifdef WL_WPS_SYNC |
---|
| 1110 | +#define EAP_PACKET 0 |
---|
| 1111 | +#define EAP_EXPANDED_TYPE 254 |
---|
| 1112 | +#define EAP_EXP_OPCODE_OFFSET 7 |
---|
| 1113 | +#define EAP_EXP_FRAGMENT_LEN_OFFSET 2 |
---|
| 1114 | +#define EAP_EXP_FLAGS_FRAGMENTED_DATA 2 |
---|
| 1115 | +#define EAP_EXP_FLAGS_MORE_DATA 1 |
---|
| 1116 | +#define EAPOL_EAP_HDR_LEN 5 |
---|
| 1117 | +#define EAP_EXP_HDR_MIN_LENGTH (EAPOL_EAP_HDR_LEN + EAP_EXP_OPCODE_OFFSET) |
---|
| 1118 | +#define EAP_ATTRIB_MSGTYPE 0x1022 |
---|
| 1119 | +#define EAP_WSC_UPNP 0 |
---|
| 1120 | +#define EAP_WSC_START 1 |
---|
| 1121 | +#define EAP_WSC_ACK 2 |
---|
| 1122 | +#define EAP_WSC_NACK 3 |
---|
| 1123 | +#define EAP_WSC_MSG 4 |
---|
| 1124 | +#define EAP_WSC_DONE 5 |
---|
| 1125 | +#define EAP_WSC_MSG_M8 12 |
---|
| 1126 | +#define EAP_CODE_FAILURE 4 |
---|
| 1127 | +#define WL_WPS_REAUTH_TIMEOUT 10000 |
---|
| 1128 | + |
---|
| 1129 | +struct wl_eap_header { |
---|
| 1130 | + unsigned char code; /* EAP code */ |
---|
| 1131 | + unsigned char id; /* Current request ID */ |
---|
| 1132 | + unsigned short length; /* Length including header */ |
---|
| 1133 | + unsigned char type; /* EAP type (optional) */ |
---|
| 1134 | + unsigned char data[1]; /* Type data (optional) */ |
---|
| 1135 | +} __attribute__ ((packed)); |
---|
| 1136 | +typedef struct wl_eap_header wl_eap_header_t; |
---|
| 1137 | + |
---|
| 1138 | +typedef enum wl_wps_state { |
---|
| 1139 | + WPS_STATE_IDLE = 0, |
---|
| 1140 | + WPS_STATE_STARTED, |
---|
| 1141 | + WPS_STATE_M8_SENT, |
---|
| 1142 | + WPS_STATE_M8_RECVD, |
---|
| 1143 | + WPS_STATE_EAP_FAIL, |
---|
| 1144 | + WPS_STATE_REAUTH_WAIT, |
---|
| 1145 | + WPS_STATE_LINKUP, |
---|
| 1146 | + WPS_STATE_LINKDOWN, |
---|
| 1147 | + WPS_STATE_DISCONNECT, |
---|
| 1148 | + WPS_STATE_DISCONNECT_CLIENT, |
---|
| 1149 | + WPS_STATE_CONNECT_FAIL, |
---|
| 1150 | + WPS_STATE_AUTHORIZE, |
---|
| 1151 | + WPS_STATE_DONE, |
---|
| 1152 | + WPS_STATE_INVALID |
---|
| 1153 | +} wl_wps_state_t; |
---|
| 1154 | + |
---|
| 1155 | +#define WPS_MAX_SESSIONS 2 |
---|
| 1156 | +typedef struct wl_wps_session { |
---|
| 1157 | + bool in_use; |
---|
| 1158 | + timer_list_compat_t timer; |
---|
| 1159 | + struct net_device *ndev; |
---|
| 1160 | + wl_wps_state_t state; |
---|
| 1161 | + u16 mode; |
---|
| 1162 | + u8 peer_mac[ETHER_ADDR_LEN]; |
---|
| 1163 | +} wl_wps_session_t; |
---|
| 1164 | +#endif /* WL_WPS_SYNC */ |
---|
| 1165 | + |
---|
| 1166 | +#ifndef WL_STATIC_IFNAME_PREFIX |
---|
| 1167 | +#define WL_STATIC_IFNAME_PREFIX "wlan%d" |
---|
| 1168 | +#endif /* WL_STATIC_IFNAME */ |
---|
| 1169 | +#define STATIC_INAME_STRING_LEN 6 |
---|
| 1170 | +#ifndef DHD_NUM_STATIC_IFACES |
---|
| 1171 | +#define DHD_NUM_STATIC_IFACES 2 |
---|
| 1172 | +#endif // endif |
---|
| 1173 | + |
---|
| 1174 | +#ifdef WL_SUPPORT_ACS_OFFLOAD |
---|
| 1175 | +enum wl_vendor_attr_acs_offload { |
---|
| 1176 | + BRCM_VENDOR_ATTR_ACS_CHANNEL_INVALID = 0, |
---|
| 1177 | + BRCM_VENDOR_ATTR_ACS_PRIMARY_FREQ, |
---|
| 1178 | + BRCM_VENDOR_ATTR_ACS_SECONDARY_FREQ, |
---|
| 1179 | + BRCM_VENDOR_ATTR_ACS_VHT_SEG0_CENTER_CHANNEL, |
---|
| 1180 | + BRCM_VENDOR_ATTR_ACS_VHT_SEG1_CENTER_CHANNEL, |
---|
| 1181 | + BRCM_VENDOR_ATTR_ACS_HW_MODE, |
---|
| 1182 | + BRCM_VENDOR_ATTR_ACS_HT_ENABLED, |
---|
| 1183 | + BRCM_VENDOR_ATTR_ACS_HT40_ENABLED, |
---|
| 1184 | + BRCM_VENDOR_ATTR_ACS_VHT_ENABLED, |
---|
| 1185 | + BRCM_VENDOR_ATTR_ACS_CHWIDTH, |
---|
| 1186 | + BRCM_VENDOR_ATTR_ACS_CH_LIST, |
---|
| 1187 | + BRCM_VENDOR_ATTR_ACS_FREQ_LIST, |
---|
| 1188 | + BRCM_VENDOR_ATTR_ACS_LAST |
---|
| 1189 | +}; |
---|
| 1190 | + |
---|
| 1191 | +/* defined in "hostapd/src/common/defs.h" */ |
---|
| 1192 | +enum hostapd_hw_mode { |
---|
| 1193 | + HOSTAPD_MODE_IEEE80211B, |
---|
| 1194 | + HOSTAPD_MODE_IEEE80211G, |
---|
| 1195 | + HOSTAPD_MODE_IEEE80211A, |
---|
| 1196 | + HOSTAPD_MODE_IEEE80211AD, |
---|
| 1197 | + HOSTAPD_MODE_IEEE80211ANY, |
---|
| 1198 | + NUM_HOSTAPD_MODES |
---|
| 1199 | +}; |
---|
| 1200 | + |
---|
| 1201 | +typedef struct drv_acs_offload_params { |
---|
| 1202 | + /* Selected mode (HOSTAPD_MODE_*) */ |
---|
| 1203 | + enum hostapd_hw_mode hw_mode; |
---|
| 1204 | + /* Indicates whether HT is enabled */ |
---|
| 1205 | + int ht_enabled; |
---|
| 1206 | + /* Indicates whether HT40 is enabled */ |
---|
| 1207 | + int ht40_enabled; |
---|
| 1208 | + /* Indicates whether VHT is enabled */ |
---|
| 1209 | + int vht_enabled; |
---|
| 1210 | + /* Configured ACS channel width */ |
---|
| 1211 | + u16 ch_width; |
---|
| 1212 | + u8 band; |
---|
| 1213 | + /* ACS frequency list info */ |
---|
| 1214 | + int chan_cnt; |
---|
| 1215 | + int *channels; |
---|
| 1216 | +} drv_acs_offload_params_t; |
---|
| 1217 | + |
---|
| 1218 | +typedef struct acs_offload_work { |
---|
| 1219 | + struct delayed_work work; |
---|
| 1220 | + struct wireless_dev *wdev; /* representing cfg cfg80211 device */ |
---|
| 1221 | + struct net_device *ndev; |
---|
| 1222 | + chanspec_t selected; |
---|
| 1223 | + drv_acs_offload_params_t parameter; |
---|
| 1224 | +} acs_offload_work_t; |
---|
| 1225 | +#endif // endif |
---|
| 1226 | +typedef struct buf_data { |
---|
| 1227 | + u32 ver; /* version of struct */ |
---|
| 1228 | + u32 len; /* Total len */ |
---|
| 1229 | + /* size of each buffer in case of split buffers (0 - single buffer). */ |
---|
| 1230 | + u32 buf_threshold; |
---|
| 1231 | + const void *data_buf[1]; /* array of user space buffer pointers. */ |
---|
| 1232 | +} buf_data_t; |
---|
511 | 1233 | |
---|
512 | 1234 | /* private data of cfg80211 interface */ |
---|
513 | 1235 | struct bcm_cfg80211 { |
---|
.. | .. |
---|
528 | 1250 | struct completion iface_disable; |
---|
529 | 1251 | struct completion wait_next_af; |
---|
530 | 1252 | struct mutex usr_sync; /* maily for up/down synchronization */ |
---|
531 | | - struct mutex scan_complete; /* serialize scan_complete call */ |
---|
| 1253 | + struct mutex if_sync; /* maily for iface op synchronization */ |
---|
| 1254 | + struct mutex scan_sync; /* scan sync from different scan contexts */ |
---|
532 | 1255 | struct wl_scan_results *bss_list; |
---|
533 | 1256 | struct wl_scan_results *scan_results; |
---|
534 | 1257 | |
---|
.. | .. |
---|
539 | 1262 | struct wl_ie *ie; |
---|
540 | 1263 | #else |
---|
541 | 1264 | struct wl_ie ie; |
---|
542 | | -#endif |
---|
| 1265 | +#endif // endif |
---|
543 | 1266 | |
---|
544 | 1267 | /* association information container */ |
---|
545 | 1268 | #if defined(STATIC_WL_PRIV_STRUCT) |
---|
546 | 1269 | struct wl_connect_info *conn_info; |
---|
547 | 1270 | #else |
---|
548 | 1271 | struct wl_connect_info conn_info; |
---|
549 | | -#endif |
---|
| 1272 | +#endif // endif |
---|
550 | 1273 | #ifdef DEBUGFS_CFG80211 |
---|
551 | 1274 | struct dentry *debugfs; |
---|
552 | 1275 | #endif /* DEBUGFS_CFG80211 */ |
---|
.. | .. |
---|
570 | 1293 | bool pwr_save; |
---|
571 | 1294 | bool roam_on; /* on/off switch for self-roaming */ |
---|
572 | 1295 | bool scan_tried; /* indicates if first scan attempted */ |
---|
573 | | -#if defined(BCMSDIO) || defined(BCMDBUS) || defined(BCMPCIE) |
---|
| 1296 | +#if defined(BCMSDIO) || defined(BCMPCIE) |
---|
574 | 1297 | bool wlfc_on; |
---|
575 | | -#endif /* defined(BCMSDIO) || defined(BCMDBUS) */ |
---|
| 1298 | +#endif // endif |
---|
576 | 1299 | bool vsdb_mode; |
---|
577 | | -#define WL_ROAM_OFF_ON_CONCURRENT 0x0001 |
---|
578 | | -#define WL_ROAM_OFF_REVERT 0x0002 |
---|
| 1300 | +#define WL_ROAM_OFF_ON_CONCURRENT 0x0001 |
---|
| 1301 | +#define WL_ROAM_REVERT_STATUS 0x0002 |
---|
579 | 1302 | u32 roam_flags; |
---|
580 | 1303 | u8 *ioctl_buf; /* ioctl buffer */ |
---|
581 | 1304 | struct mutex ioctl_buf_sync; |
---|
.. | .. |
---|
595 | 1318 | struct p2p_info *p2p; |
---|
596 | 1319 | bool p2p_supported; |
---|
597 | 1320 | void *btcoex_info; |
---|
598 | | - struct timer_list scan_timeout; /* Timer for catch scan event timeout */ |
---|
| 1321 | + timer_list_compat_t scan_timeout; /* Timer for catch scan event timeout */ |
---|
| 1322 | +#ifdef WL_CFG80211_GON_COLLISION |
---|
| 1323 | + u8 block_gon_req_tx_count; |
---|
| 1324 | + u8 block_gon_req_rx_count; |
---|
| 1325 | +#endif /* WL_CFG80211_GON_COLLISION */ |
---|
599 | 1326 | #if defined(P2P_IE_MISSING_FIX) |
---|
600 | 1327 | bool p2p_prb_noti; |
---|
601 | | -#endif |
---|
| 1328 | +#endif // endif |
---|
602 | 1329 | s32(*state_notifier) (struct bcm_cfg80211 *cfg, |
---|
603 | 1330 | struct net_info *_net_info, enum wl_status state, bool set); |
---|
604 | 1331 | unsigned long interrested_state; |
---|
605 | 1332 | wlc_ssid_t hostapd_ssid; |
---|
606 | 1333 | #ifdef WL11U |
---|
607 | 1334 | bool wl11u; |
---|
608 | | - u8 iw_ie[IW_IES_MAX_BUF_LEN]; |
---|
609 | | - u32 iw_ie_len; |
---|
610 | 1335 | #endif /* WL11U */ |
---|
611 | 1336 | bool sched_scan_running; /* scheduled scan req status */ |
---|
612 | | -#ifdef WL_SCHED_SCAN |
---|
613 | 1337 | struct cfg80211_sched_scan_request *sched_scan_req; /* scheduled scan req */ |
---|
614 | | -#endif /* WL_SCHED_SCAN */ |
---|
| 1338 | +#ifdef WL_HOST_BAND_MGMT |
---|
| 1339 | + u8 curr_band; |
---|
| 1340 | +#endif /* WL_HOST_BAND_MGMT */ |
---|
615 | 1341 | bool scan_suppressed; |
---|
616 | | - struct timer_list scan_supp_timer; |
---|
| 1342 | +#ifdef OEM_ANDROID |
---|
| 1343 | + timer_list_compat_t scan_supp_timer; |
---|
617 | 1344 | struct work_struct wlan_work; |
---|
| 1345 | +#endif /* OEM_ANDROID */ |
---|
618 | 1346 | struct mutex event_sync; /* maily for up/down synchronization */ |
---|
619 | 1347 | bool disable_roam_event; |
---|
620 | | - bool pm_enable_work_on; |
---|
621 | 1348 | struct delayed_work pm_enable_work; |
---|
| 1349 | +#ifdef OEM_ANDROID |
---|
| 1350 | + struct workqueue_struct *event_workq; /* workqueue for event */ |
---|
| 1351 | +#else |
---|
| 1352 | + bool event_workq_init; |
---|
| 1353 | +#endif /* OEM_ANDROID */ |
---|
| 1354 | + struct work_struct event_work; /* work item for event */ |
---|
| 1355 | + struct mutex pm_sync; /* mainly for pm work synchronization */ |
---|
| 1356 | + |
---|
622 | 1357 | vndr_ie_setbuf_t *ibss_vsie; /* keep the VSIE for IBSS */ |
---|
623 | 1358 | int ibss_vsie_len; |
---|
| 1359 | +#ifdef WLAIBSS |
---|
| 1360 | + u32 aibss_txfail_pid; |
---|
| 1361 | + u32 aibss_txfail_seq; |
---|
| 1362 | +#endif /* WLAIBSS */ |
---|
| 1363 | +#ifdef WL_RELMCAST |
---|
624 | 1364 | u32 rmc_event_pid; |
---|
625 | 1365 | u32 rmc_event_seq; |
---|
| 1366 | +#endif /* WL_RELMCAST */ |
---|
626 | 1367 | #ifdef WLAIBSS_MCHAN |
---|
627 | 1368 | struct ether_addr ibss_if_addr; |
---|
628 | 1369 | bcm_struct_cfgdev *ibss_cfgdev; /* For AIBSS */ |
---|
629 | 1370 | #endif /* WLAIBSS_MCHAN */ |
---|
630 | | - bcm_struct_cfgdev *bss_cfgdev; /* For DUAL STA/STA+AP */ |
---|
631 | | - s32 cfgdev_bssidx; |
---|
632 | 1371 | bool bss_pending_op; /* indicate where there is a pending IF operation */ |
---|
633 | 1372 | #ifdef WLFBT |
---|
634 | 1373 | uint8 fbt_key[FBT_KEYLEN]; |
---|
635 | | -#endif |
---|
| 1374 | +#endif // endif |
---|
636 | 1375 | int roam_offload; |
---|
637 | 1376 | #ifdef WL_NAN |
---|
638 | 1377 | bool nan_enable; |
---|
639 | | - bool nan_running; |
---|
| 1378 | + nan_svc_inst_t nan_inst_ctrl[NAN_ID_CTRL_SIZE]; |
---|
| 1379 | + struct ether_addr initiator_ndi; |
---|
| 1380 | + uint8 nan_dp_state; |
---|
| 1381 | + bool nan_init_state; /* nan initialization state */ |
---|
| 1382 | + wait_queue_head_t ndp_if_change_event; |
---|
| 1383 | + uint8 support_5g; |
---|
| 1384 | + u8 nan_nmi_mac[ETH_ALEN]; |
---|
| 1385 | + u8 nan_dp_mask; |
---|
| 1386 | + wl_nancfg_t nancfg; |
---|
| 1387 | +#ifdef WL_NAN_DISC_CACHE |
---|
| 1388 | + int nan_disc_count; |
---|
| 1389 | + nan_disc_result_cache *nan_disc_cache; |
---|
| 1390 | + nan_svc_info_t svc_info[NAN_MAX_SVC_INST]; |
---|
| 1391 | + nan_ranging_inst_t nan_ranging_info[NAN_MAX_RANGING_INST]; |
---|
| 1392 | +#endif /* WL_NAN_DISC_CACHE */ |
---|
| 1393 | +#ifdef WL_NANP2P |
---|
| 1394 | + uint8 conc_disc; |
---|
| 1395 | + bool nan_p2p_supported; |
---|
| 1396 | +#endif /* WL_NANP2P */ |
---|
640 | 1397 | #endif /* WL_NAN */ |
---|
| 1398 | +#ifdef WL_IFACE_MGMT |
---|
| 1399 | + iface_mgmt_data_t iface_data; |
---|
| 1400 | +#endif /* WL_IFACE_MGMT */ |
---|
641 | 1401 | #ifdef WL_CFG80211_P2P_DEV_IF |
---|
642 | 1402 | bool down_disc_if; |
---|
643 | 1403 | #endif /* WL_CFG80211_P2P_DEV_IF */ |
---|
.. | .. |
---|
655 | 1415 | uint8 *up_table; /* user priority table, size is UP_TABLE_MAX */ |
---|
656 | 1416 | #endif /* QOS_MAP_SET */ |
---|
657 | 1417 | struct ether_addr last_roamed_addr; |
---|
658 | | -#ifdef DHD_LOSSLESS_ROAMING |
---|
659 | | - struct timer_list roam_timeout; /* Timer for catch roam timeout */ |
---|
660 | | -#endif |
---|
661 | 1418 | bool rcc_enabled; /* flag for Roam channel cache feature */ |
---|
| 1419 | +#if defined(DHD_ENABLE_BIGDATA_LOGGING) |
---|
| 1420 | + char bss_info[GET_BSS_INFO_LEN]; |
---|
| 1421 | + wl_event_msg_t event_auth_assoc; |
---|
| 1422 | + u32 assoc_reject_status; |
---|
| 1423 | + u32 roam_count; |
---|
| 1424 | +#endif /* DHD_ENABLE_BIGDATA_LOGGING */ |
---|
| 1425 | + u16 ap_oper_channel; |
---|
| 1426 | +#if defined(SUPPORT_RANDOM_MAC_SCAN) |
---|
| 1427 | + bool random_mac_enabled; |
---|
| 1428 | +#endif /* SUPPORT_RANDOM_MAC_SCAN */ |
---|
| 1429 | +#ifdef DHD_LOSSLESS_ROAMING |
---|
| 1430 | + timer_list_compat_t roam_timeout; /* Timer for catch roam timeout */ |
---|
| 1431 | +#endif // endif |
---|
| 1432 | +#ifndef DUAL_ESCAN_RESULT_BUFFER |
---|
| 1433 | + uint16 escan_sync_id_cntr; |
---|
| 1434 | +#endif // endif |
---|
| 1435 | +#ifdef WLTDLS |
---|
| 1436 | + uint8 tdls_supported; |
---|
| 1437 | + struct mutex tdls_sync; /* protect tdls config operations */ |
---|
| 1438 | +#endif /* WLTDLS */ |
---|
| 1439 | +#ifdef MFP |
---|
| 1440 | + const uint8 *bip_pos; |
---|
| 1441 | + int mfp_mode; |
---|
| 1442 | +#endif /* MFP */ |
---|
| 1443 | +#ifdef WES_SUPPORT |
---|
| 1444 | +#ifdef CUSTOMER_SCAN_TIMEOUT_SETTING |
---|
| 1445 | + int custom_scan_channel_time; |
---|
| 1446 | + int custom_scan_unassoc_time; |
---|
| 1447 | + int custom_scan_passive_time; |
---|
| 1448 | + int custom_scan_home_time; |
---|
| 1449 | + int custom_scan_home_away_time; |
---|
| 1450 | +#endif /* CUSTOMER_SCAN_TIMEOUT_SETTING */ |
---|
| 1451 | +#endif /* WES_SUPPORT */ |
---|
| 1452 | + uint8 vif_count; /* Virtual Interface count */ |
---|
| 1453 | +#ifdef WBTEXT |
---|
| 1454 | + struct list_head wbtext_bssid_list; |
---|
| 1455 | +#endif /* WBTEXT */ |
---|
| 1456 | +#ifdef SUPPORT_AP_RADIO_PWRSAVE |
---|
| 1457 | + ap_rps_info_t ap_rps_info; |
---|
| 1458 | +#endif /* SUPPORT_AP_RADIO_PWRSAVE */ |
---|
| 1459 | + u16 vif_macaddr_mask; |
---|
| 1460 | + osl_t *osh; |
---|
| 1461 | + struct list_head vndr_oui_list; |
---|
| 1462 | + spinlock_t vndr_oui_sync; /* to protect vndr_oui_list */ |
---|
| 1463 | + bool rssi_sum_report; |
---|
| 1464 | + int rssi; /* previous RSSI (backup) of get_station */ |
---|
| 1465 | + uint64 scan_enq_time; |
---|
| 1466 | + uint64 scan_deq_time; |
---|
| 1467 | + uint64 scan_hdlr_cmplt_time; |
---|
| 1468 | + uint64 scan_cmplt_time; |
---|
| 1469 | + uint64 wl_evt_deq_time; |
---|
| 1470 | + uint64 wl_evt_hdlr_entry_time; |
---|
| 1471 | + uint64 wl_evt_hdlr_exit_time; |
---|
| 1472 | +#ifdef WL_WPS_SYNC |
---|
| 1473 | + wl_wps_session_t wps_session[WPS_MAX_SESSIONS]; |
---|
| 1474 | + spinlock_t wps_sync; /* to protect wps states (and others if needed) */ |
---|
| 1475 | +#endif /* WL_WPS_SYNC */ |
---|
| 1476 | + struct wl_fils_info fils_info; |
---|
| 1477 | +#ifdef WL_BAM |
---|
| 1478 | + wl_bad_ap_mngr_t bad_ap_mngr; |
---|
| 1479 | +#endif /* WL_BAM */ |
---|
| 1480 | +#ifdef BIGDATA_SOFTAP |
---|
| 1481 | + struct wl_ap_sta_info *ap_sta_info; |
---|
| 1482 | +#endif /* BIGDATA_SOFTAP */ |
---|
| 1483 | + uint8 scanmac_enabled; |
---|
| 1484 | +#ifdef WL_BCNRECV |
---|
| 1485 | + /* structure used for fake ap detection info */ |
---|
| 1486 | + struct mutex bcn_sync; /* mainly for bcn resume/suspend synchronization */ |
---|
| 1487 | + wl_bcnrecv_info_t bcnrecv_info; |
---|
| 1488 | +#endif /* WL_BCNRECV */ |
---|
| 1489 | + struct net_device *static_ndev[DHD_MAX_STATIC_IFS]; |
---|
| 1490 | + uint8 static_ndev_state[DHD_MAX_STATIC_IFS]; |
---|
| 1491 | + bool hal_started; |
---|
| 1492 | + u32 hal_pid; |
---|
| 1493 | + wl_wlc_version_t wlc_ver; |
---|
| 1494 | + bool scan_params_v2; |
---|
| 1495 | +#ifdef DHD_BANDSTEER |
---|
| 1496 | + void *dhd_bandsteer_cntx; |
---|
| 1497 | + bool p2p_bs; |
---|
| 1498 | + bool ap_bs; |
---|
| 1499 | +#endif /* DHD_BANDSTEER */ |
---|
| 1500 | +#ifdef ENABLE_HOGSQS |
---|
| 1501 | + struct delayed_work hogsqs_eventwork; /* hog detection event work */ |
---|
| 1502 | +#endif // endif |
---|
| 1503 | +#if !defined(DISABLE_11H) && defined(DHD_NOSCAN_DURING_CSA) |
---|
| 1504 | + bool in_csa; |
---|
| 1505 | + timer_list_compat_t csa_timeout; /* Timer for csa timeout */ |
---|
| 1506 | +#endif // endif |
---|
| 1507 | +#ifdef WL_SUPPORT_ACS_OFFLOAD |
---|
| 1508 | + acs_offload_work_t *acs_offload; |
---|
| 1509 | +#endif // endif |
---|
662 | 1510 | }; |
---|
| 1511 | +#define WL_STATIC_IFIDX (DHD_MAX_IFS + DHD_MAX_STATIC_IFS - 1) |
---|
| 1512 | +enum static_ndev_states { |
---|
| 1513 | + NDEV_STATE_NONE, |
---|
| 1514 | + NDEV_STATE_OS_IF_CREATED, |
---|
| 1515 | + NDEV_STATE_FW_IF_CREATED, |
---|
| 1516 | + NDEV_STATE_FW_IF_FAILED, |
---|
| 1517 | + NDEV_STATE_FW_IF_DELETED |
---|
| 1518 | +}; |
---|
| 1519 | +#ifdef WL_IFACE_MGMT |
---|
| 1520 | +#define IS_CFG80211_STATIC_IF_ACTIVE(cfg) \ |
---|
| 1521 | + ((cfg && cfg->static_ndev && \ |
---|
| 1522 | + (cfg->static_ndev_state & NDEV_STATE_FW_IF_CREATED)) ? true : false) |
---|
| 1523 | +#endif // endif |
---|
| 1524 | +#ifdef WL_SAE |
---|
| 1525 | +typedef struct wl_sae_key_info { |
---|
| 1526 | + uint8 peer_mac[ETHER_ADDR_LEN]; |
---|
| 1527 | + uint16 pmk_len; |
---|
| 1528 | + uint16 pmkid_len; |
---|
| 1529 | + const uint8 *pmk; |
---|
| 1530 | + const uint8 *pmkid; |
---|
| 1531 | +} wl_sae_key_info_t; |
---|
| 1532 | +#endif /* WL_SAE */ |
---|
663 | 1533 | |
---|
664 | | -#if defined(STRICT_GCC_WARNINGS) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == \ |
---|
665 | | - 4 && __GNUC_MINOR__ >= 6)) |
---|
| 1534 | +typedef enum wl_concurrency_mode { |
---|
| 1535 | + CONCURRENCY_MODE_NONE = 0, |
---|
| 1536 | + CONCURRENCY_SCC_MODE, |
---|
| 1537 | + CONCURRENCY_VSDB_MODE, |
---|
| 1538 | + CONCURRENCY_RSDB_MODE |
---|
| 1539 | +} wl_concurrency_mode_t; |
---|
| 1540 | + |
---|
| 1541 | +s32 wl_iftype_to_mode(wl_iftype_t iftype); |
---|
666 | 1542 | |
---|
667 | 1543 | #define BCM_LIST_FOR_EACH_ENTRY_SAFE(pos, next, head, member) \ |
---|
668 | | -_Pragma("GCC diagnostic push") \ |
---|
669 | | -_Pragma("GCC diagnostic ignored \"-Wcast-qual\"") \ |
---|
670 | | -list_for_each_entry_safe((pos), (next), (head), member) \ |
---|
671 | | -_Pragma("GCC diagnostic pop") \ |
---|
| 1544 | + list_for_each_entry_safe((pos), (next), (head), member) |
---|
| 1545 | +extern int ioctl_version; |
---|
672 | 1546 | |
---|
673 | | -#else |
---|
674 | | -#define BCM_LIST_FOR_EACH_ENTRY_SAFE(pos, next, head, member) \ |
---|
675 | | -list_for_each_entry_safe((pos), (next), (head), member) \ |
---|
676 | | - |
---|
677 | | -#endif /* STRICT_GCC_WARNINGS */ |
---|
678 | | - |
---|
679 | | -static inline struct wl_bss_info *next_bss(struct wl_scan_results *list, struct wl_bss_info *bss) |
---|
| 1547 | +static inline wl_bss_info_t *next_bss(struct wl_scan_results *list, wl_bss_info_t *bss) |
---|
680 | 1548 | { |
---|
681 | | - return bss = bss ? (struct wl_bss_info *)((uintptr) bss + dtoh32(bss->length)) : |
---|
682 | | - list->bss_info; |
---|
| 1549 | + return bss = bss ? |
---|
| 1550 | + (wl_bss_info_t *)((uintptr) bss + dtoh32(bss->length)) : list->bss_info; |
---|
683 | 1551 | } |
---|
684 | 1552 | |
---|
685 | 1553 | static inline void |
---|
.. | .. |
---|
688 | 1556 | struct net_info *_net_info, *next; |
---|
689 | 1557 | unsigned long int flags; |
---|
690 | 1558 | int idx = 0; |
---|
691 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1559 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1560 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
692 | 1561 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, |
---|
693 | 1562 | &cfg->net_list, list) { |
---|
694 | | - WL_ERR(("%s: net_list[%d] bssidx: %d, " |
---|
695 | | - "ndev: %p, wdev: %p \n", __FUNCTION__, |
---|
696 | | - idx++, _net_info->bssidx, |
---|
697 | | - _net_info->ndev, _net_info->wdev)); |
---|
| 1563 | + GCC_DIAGNOSTIC_POP(); |
---|
| 1564 | + WL_INFORM_MEM(("wl_probe_wdev_all: net_list[%d] bssidx: %d\n", |
---|
| 1565 | + idx++, _net_info->bssidx)); |
---|
698 | 1566 | } |
---|
699 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1567 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
700 | 1568 | return; |
---|
701 | 1569 | } |
---|
702 | 1570 | |
---|
703 | 1571 | static inline struct net_info * |
---|
704 | | -wl_get_netinfo_by_bssidx(struct bcm_cfg80211 *cfg, s32 bssidx) |
---|
| 1572 | +wl_get_netinfo_by_fw_idx(struct bcm_cfg80211 *cfg, s32 bssidx, u8 ifidx) |
---|
705 | 1573 | { |
---|
706 | 1574 | struct net_info *_net_info, *next, *info = NULL; |
---|
707 | 1575 | unsigned long int flags; |
---|
708 | 1576 | |
---|
709 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1577 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1578 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
710 | 1579 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
711 | | - if ((bssidx >= 0) && (_net_info->bssidx == bssidx)) { |
---|
| 1580 | + GCC_DIAGNOSTIC_POP(); |
---|
| 1581 | + if ((bssidx >= 0) && (_net_info->bssidx == bssidx) && |
---|
| 1582 | + (_net_info->ifidx == ifidx)) { |
---|
712 | 1583 | info = _net_info; |
---|
713 | 1584 | break; |
---|
714 | 1585 | } |
---|
715 | 1586 | } |
---|
716 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1587 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
717 | 1588 | return info; |
---|
718 | 1589 | } |
---|
719 | | - |
---|
720 | 1590 | |
---|
721 | 1591 | static inline void |
---|
722 | 1592 | wl_dealloc_netinfo_by_wdev(struct bcm_cfg80211 *cfg, struct wireless_dev *wdev) |
---|
.. | .. |
---|
725 | 1595 | unsigned long int flags; |
---|
726 | 1596 | |
---|
727 | 1597 | #ifdef DHD_IFDEBUG |
---|
728 | | - WL_ERR(("dealloc_netinfo enter wdev=%p \n", wdev)); |
---|
729 | | -#endif |
---|
730 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1598 | + WL_INFORM_MEM(("dealloc_netinfo enter wdev=%p \n", OSL_OBFUSCATE_BUF(wdev))); |
---|
| 1599 | +#endif // endif |
---|
| 1600 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1601 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
731 | 1602 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 1603 | + GCC_DIAGNOSTIC_POP(); |
---|
732 | 1604 | if (wdev && (_net_info->wdev == wdev)) { |
---|
733 | 1605 | wl_cfgbss_t *bss = &_net_info->bss; |
---|
734 | 1606 | |
---|
735 | | - kfree(bss->wpa_ie); |
---|
736 | | - bss->wpa_ie = NULL; |
---|
737 | | - kfree(bss->rsn_ie); |
---|
738 | | - bss->rsn_ie = NULL; |
---|
739 | | - kfree(bss->wps_ie); |
---|
740 | | - bss->wps_ie = NULL; |
---|
| 1607 | + if (bss->wpa_ie) { |
---|
| 1608 | + MFREE(cfg->osh, bss->wpa_ie, bss->wpa_ie[1] |
---|
| 1609 | + + WPA_RSN_IE_TAG_FIXED_LEN); |
---|
| 1610 | + bss->wpa_ie = NULL; |
---|
| 1611 | + } |
---|
| 1612 | + |
---|
| 1613 | + if (bss->rsn_ie) { |
---|
| 1614 | + MFREE(cfg->osh, bss->rsn_ie, |
---|
| 1615 | + bss->rsn_ie[1] + WPA_RSN_IE_TAG_FIXED_LEN); |
---|
| 1616 | + bss->rsn_ie = NULL; |
---|
| 1617 | + } |
---|
| 1618 | + |
---|
| 1619 | + if (bss->wps_ie) { |
---|
| 1620 | + MFREE(cfg->osh, bss->wps_ie, bss->wps_ie[1] + 2); |
---|
| 1621 | + bss->wps_ie = NULL; |
---|
| 1622 | + } |
---|
741 | 1623 | list_del(&_net_info->list); |
---|
742 | 1624 | cfg->iface_cnt--; |
---|
743 | | - kfree(_net_info); |
---|
| 1625 | + MFREE(cfg->osh, _net_info, sizeof(struct net_info)); |
---|
744 | 1626 | } |
---|
745 | 1627 | } |
---|
746 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1628 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
747 | 1629 | #ifdef DHD_IFDEBUG |
---|
748 | | - WL_ERR(("dealloc_netinfo exit iface_cnt=%d \n", cfg->iface_cnt)); |
---|
749 | | -#endif |
---|
| 1630 | + WL_INFORM_MEM(("dealloc_netinfo exit iface_cnt=%d \n", cfg->iface_cnt)); |
---|
| 1631 | +#endif // endif |
---|
750 | 1632 | } |
---|
751 | 1633 | |
---|
752 | 1634 | static inline s32 |
---|
753 | 1635 | wl_alloc_netinfo(struct bcm_cfg80211 *cfg, struct net_device *ndev, |
---|
754 | | - struct wireless_dev * wdev, s32 mode, bool pm_block, u8 bssidx) |
---|
| 1636 | + struct wireless_dev * wdev, wl_iftype_t iftype, bool pm_block, u8 bssidx, u8 ifidx) |
---|
755 | 1637 | { |
---|
756 | 1638 | struct net_info *_net_info; |
---|
757 | 1639 | s32 err = 0; |
---|
758 | 1640 | unsigned long int flags; |
---|
759 | 1641 | #ifdef DHD_IFDEBUG |
---|
760 | | - WL_ERR(("alloc_netinfo enter bssidx=%d wdev=%p ndev=%p\n", bssidx, wdev, ndev)); |
---|
761 | | -#endif |
---|
| 1642 | + WL_INFORM_MEM(("alloc_netinfo enter bssidx=%d wdev=%p\n", |
---|
| 1643 | + bssidx, OSL_OBFUSCATE_BUF(wdev))); |
---|
| 1644 | +#endif // endif |
---|
762 | 1645 | /* Check whether there is any duplicate entry for the |
---|
763 | | - * same bssidx. |
---|
| 1646 | + * same bssidx && ifidx. |
---|
764 | 1647 | */ |
---|
765 | | - if ((_net_info = wl_get_netinfo_by_bssidx(cfg, bssidx))) { |
---|
| 1648 | + if ((_net_info = wl_get_netinfo_by_fw_idx(cfg, bssidx, ifidx))) { |
---|
766 | 1649 | /* We have a duplicate entry for the same bssidx |
---|
767 | | - * already present which shouldn't have been the case. |
---|
768 | | - * Attempt recovery. |
---|
769 | | - */ |
---|
770 | | - WL_ERR(("Duplicate entry for bssidx=%d present\n", bssidx)); |
---|
| 1650 | + * already present which shouldn't have been the case. |
---|
| 1651 | + * Attempt recovery. |
---|
| 1652 | + */ |
---|
| 1653 | + WL_ERR(("Duplicate entry for bssidx=%d ifidx=%d present." |
---|
| 1654 | + " Can't add new entry\n", bssidx, ifidx)); |
---|
771 | 1655 | wl_probe_wdev_all(cfg); |
---|
772 | 1656 | #ifdef DHD_DEBUG |
---|
773 | 1657 | ASSERT(0); |
---|
774 | 1658 | #endif /* DHD_DEBUG */ |
---|
775 | | - WL_ERR(("Removing the Dup entry for bssidx=%d \n", bssidx)); |
---|
776 | | - wl_dealloc_netinfo_by_wdev(cfg, _net_info->wdev); |
---|
| 1659 | + return -EINVAL; |
---|
777 | 1660 | } |
---|
778 | 1661 | if (cfg->iface_cnt == IFACE_MAX_CNT) |
---|
779 | 1662 | return -ENOMEM; |
---|
780 | | - _net_info = kzalloc(sizeof(struct net_info), GFP_KERNEL); |
---|
| 1663 | + _net_info = (struct net_info *)MALLOCZ(cfg->osh, sizeof(struct net_info)); |
---|
781 | 1664 | if (!_net_info) |
---|
782 | 1665 | err = -ENOMEM; |
---|
783 | 1666 | else { |
---|
784 | | - _net_info->mode = mode; |
---|
| 1667 | + _net_info->iftype = iftype; |
---|
785 | 1668 | _net_info->ndev = ndev; |
---|
786 | 1669 | _net_info->wdev = wdev; |
---|
787 | 1670 | _net_info->pm_restore = 0; |
---|
.. | .. |
---|
789 | 1672 | _net_info->pm_block = pm_block; |
---|
790 | 1673 | _net_info->roam_off = WL_INVALID; |
---|
791 | 1674 | _net_info->bssidx = bssidx; |
---|
792 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1675 | + _net_info->ifidx = ifidx; |
---|
| 1676 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
793 | 1677 | cfg->iface_cnt++; |
---|
794 | 1678 | list_add(&_net_info->list, &cfg->net_list); |
---|
795 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1679 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
| 1680 | +#ifdef WL_SAE |
---|
| 1681 | + init_completion(&_net_info->mgmt_tx_cpl); |
---|
| 1682 | +#endif /* WL_SAE */ |
---|
796 | 1683 | } |
---|
797 | 1684 | #ifdef DHD_IFDEBUG |
---|
798 | | - WL_ERR(("alloc_netinfo exit iface_cnt=%d \n", cfg->iface_cnt)); |
---|
799 | | -#endif |
---|
| 1685 | + WL_DBG(("alloc_netinfo exit iface_cnt=%d \n", cfg->iface_cnt)); |
---|
| 1686 | +#endif // endif |
---|
800 | 1687 | return err; |
---|
801 | 1688 | } |
---|
802 | 1689 | |
---|
.. | .. |
---|
806 | 1693 | struct net_info *_net_info, *next; |
---|
807 | 1694 | unsigned long int flags; |
---|
808 | 1695 | |
---|
809 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1696 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1697 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
810 | 1698 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
811 | 1699 | wl_cfgbss_t *bss = &_net_info->bss; |
---|
| 1700 | + GCC_DIAGNOSTIC_POP(); |
---|
812 | 1701 | |
---|
813 | | - kfree(bss->wpa_ie); |
---|
814 | | - bss->wpa_ie = NULL; |
---|
815 | | - kfree(bss->rsn_ie); |
---|
816 | | - bss->rsn_ie = NULL; |
---|
817 | | - kfree(bss->wps_ie); |
---|
818 | | - bss->wps_ie = NULL; |
---|
| 1702 | + if (bss->wpa_ie) { |
---|
| 1703 | + MFREE(cfg->osh, bss->wpa_ie, bss->wpa_ie[1] |
---|
| 1704 | + + WPA_RSN_IE_TAG_FIXED_LEN); |
---|
| 1705 | + bss->wpa_ie = NULL; |
---|
| 1706 | + } |
---|
| 1707 | + |
---|
| 1708 | + if (bss->rsn_ie) { |
---|
| 1709 | + MFREE(cfg->osh, bss->rsn_ie, bss->rsn_ie[1] |
---|
| 1710 | + + WPA_RSN_IE_TAG_FIXED_LEN); |
---|
| 1711 | + bss->rsn_ie = NULL; |
---|
| 1712 | + } |
---|
| 1713 | + |
---|
| 1714 | + if (bss->wps_ie) { |
---|
| 1715 | + MFREE(cfg->osh, bss->wps_ie, bss->wps_ie[1] + 2); |
---|
| 1716 | + bss->wps_ie = NULL; |
---|
| 1717 | + } |
---|
| 1718 | + |
---|
| 1719 | + if (bss->fils_ind_ie) { |
---|
| 1720 | + MFREE(cfg->osh, bss->fils_ind_ie, bss->fils_ind_ie[1] |
---|
| 1721 | + + FILS_INDICATION_IE_TAG_FIXED_LEN); |
---|
| 1722 | + bss->fils_ind_ie = NULL; |
---|
| 1723 | + } |
---|
819 | 1724 | list_del(&_net_info->list); |
---|
820 | | - if (_net_info->wdev) |
---|
821 | | - kfree(_net_info->wdev); |
---|
822 | | - kfree(_net_info); |
---|
| 1725 | + if (_net_info->wdev) { |
---|
| 1726 | + MFREE(cfg->osh, _net_info->wdev, sizeof(struct wireless_dev)); |
---|
| 1727 | + } |
---|
| 1728 | + MFREE(cfg->osh, _net_info, sizeof(struct net_info)); |
---|
823 | 1729 | } |
---|
824 | 1730 | cfg->iface_cnt = 0; |
---|
825 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1731 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
826 | 1732 | } |
---|
827 | 1733 | static inline u32 |
---|
828 | 1734 | wl_get_status_all(struct bcm_cfg80211 *cfg, s32 status) |
---|
.. | .. |
---|
832 | 1738 | u32 cnt = 0; |
---|
833 | 1739 | unsigned long int flags; |
---|
834 | 1740 | |
---|
835 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1741 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1742 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
836 | 1743 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 1744 | + GCC_DIAGNOSTIC_POP(); |
---|
837 | 1745 | if (_net_info->ndev && |
---|
838 | 1746 | test_bit(status, &_net_info->sme_state)) |
---|
839 | 1747 | cnt++; |
---|
840 | 1748 | } |
---|
841 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1749 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
842 | 1750 | return cnt; |
---|
843 | 1751 | } |
---|
844 | 1752 | static inline void |
---|
.. | .. |
---|
847 | 1755 | struct net_info *_net_info, *next; |
---|
848 | 1756 | unsigned long int flags; |
---|
849 | 1757 | |
---|
850 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1758 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1759 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
851 | 1760 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 1761 | + GCC_DIAGNOSTIC_POP(); |
---|
852 | 1762 | switch (op) { |
---|
853 | 1763 | case 1: |
---|
854 | 1764 | break; /* set all status is not allowed */ |
---|
.. | .. |
---|
857 | 1767 | * Release the spinlock before calling notifier. Else there |
---|
858 | 1768 | * will be nested calls |
---|
859 | 1769 | */ |
---|
860 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1770 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
861 | 1771 | clear_bit(status, &_net_info->sme_state); |
---|
862 | 1772 | if (cfg->state_notifier && |
---|
863 | 1773 | test_bit(status, &(cfg->interrested_state))) |
---|
.. | .. |
---|
869 | 1779 | break; /* unknown operation */ |
---|
870 | 1780 | } |
---|
871 | 1781 | } |
---|
872 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1782 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
873 | 1783 | } |
---|
874 | 1784 | static inline void |
---|
875 | 1785 | wl_set_status_by_netdev(struct bcm_cfg80211 *cfg, s32 status, |
---|
.. | .. |
---|
879 | 1789 | struct net_info *_net_info, *next; |
---|
880 | 1790 | unsigned long int flags; |
---|
881 | 1791 | |
---|
882 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1792 | + if (status >= BITS_PER_LONG) { |
---|
| 1793 | + /* max value for shift operation is |
---|
| 1794 | + * (BITS_PER_LONG -1) for unsigned long. |
---|
| 1795 | + * if status crosses BIT_PER_LONG, the variable |
---|
| 1796 | + * sme_state should be correspondingly updated. |
---|
| 1797 | + */ |
---|
| 1798 | + ASSERT(0); |
---|
| 1799 | + return; |
---|
| 1800 | + } |
---|
| 1801 | + |
---|
| 1802 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1803 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
883 | 1804 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
884 | 1805 | if (ndev && (_net_info->ndev == ndev)) { |
---|
| 1806 | + GCC_DIAGNOSTIC_POP(); |
---|
885 | 1807 | switch (op) { |
---|
886 | 1808 | case 1: |
---|
887 | 1809 | /* |
---|
888 | 1810 | * Release the spinlock before calling notifier. Else there |
---|
889 | 1811 | * will be nested calls |
---|
890 | 1812 | */ |
---|
891 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1813 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
892 | 1814 | set_bit(status, &_net_info->sme_state); |
---|
893 | 1815 | if (cfg->state_notifier && |
---|
894 | 1816 | test_bit(status, &(cfg->interrested_state))) |
---|
.. | .. |
---|
899 | 1821 | * Release the spinlock before calling notifier. Else there |
---|
900 | 1822 | * will be nested calls |
---|
901 | 1823 | */ |
---|
902 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1824 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
903 | 1825 | clear_bit(status, &_net_info->sme_state); |
---|
904 | 1826 | if (cfg->state_notifier && |
---|
905 | 1827 | test_bit(status, &(cfg->interrested_state))) |
---|
.. | .. |
---|
912 | 1834 | } |
---|
913 | 1835 | |
---|
914 | 1836 | } |
---|
915 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1837 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
916 | 1838 | |
---|
917 | 1839 | } |
---|
918 | 1840 | |
---|
.. | .. |
---|
924 | 1846 | wl_cfgbss_t *bss = NULL; |
---|
925 | 1847 | unsigned long int flags; |
---|
926 | 1848 | |
---|
927 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1849 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1850 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
928 | 1851 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 1852 | + GCC_DIAGNOSTIC_POP(); |
---|
929 | 1853 | if (wdev && (_net_info->wdev == wdev)) { |
---|
930 | 1854 | bss = &_net_info->bss; |
---|
931 | 1855 | break; |
---|
932 | 1856 | } |
---|
933 | 1857 | } |
---|
934 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1858 | + |
---|
| 1859 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
935 | 1860 | return bss; |
---|
936 | 1861 | } |
---|
937 | 1862 | |
---|
.. | .. |
---|
943 | 1868 | u32 stat = 0; |
---|
944 | 1869 | unsigned long int flags; |
---|
945 | 1870 | |
---|
946 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1871 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1872 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
947 | 1873 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 1874 | + GCC_DIAGNOSTIC_POP(); |
---|
948 | 1875 | if (ndev && (_net_info->ndev == ndev)) { |
---|
949 | 1876 | stat = test_bit(status, &_net_info->sme_state); |
---|
950 | 1877 | break; |
---|
951 | 1878 | } |
---|
952 | 1879 | } |
---|
953 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1880 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
954 | 1881 | return stat; |
---|
955 | 1882 | } |
---|
956 | 1883 | |
---|
.. | .. |
---|
961 | 1888 | s32 mode = -1; |
---|
962 | 1889 | unsigned long int flags; |
---|
963 | 1890 | |
---|
964 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1891 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1892 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
965 | 1893 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
966 | | - if (ndev && (_net_info->ndev == ndev)) { |
---|
967 | | - mode = _net_info->mode; |
---|
| 1894 | + GCC_DIAGNOSTIC_POP(); |
---|
| 1895 | + if (_net_info->ndev && (_net_info->ndev == ndev)) { |
---|
| 1896 | + mode = wl_iftype_to_mode(_net_info->iftype); |
---|
968 | 1897 | break; |
---|
969 | 1898 | } |
---|
970 | 1899 | } |
---|
971 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1900 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
972 | 1901 | return mode; |
---|
973 | | -} |
---|
974 | | - |
---|
975 | | -static inline void |
---|
976 | | -wl_set_mode_by_netdev(struct bcm_cfg80211 *cfg, struct net_device *ndev, |
---|
977 | | - s32 mode) |
---|
978 | | -{ |
---|
979 | | - struct net_info *_net_info, *next; |
---|
980 | | - unsigned long int flags; |
---|
981 | | - |
---|
982 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
983 | | - BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
984 | | - if (ndev && (_net_info->ndev == ndev)) |
---|
985 | | - _net_info->mode = mode; |
---|
986 | | - } |
---|
987 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
988 | 1902 | } |
---|
989 | 1903 | |
---|
990 | 1904 | static inline s32 |
---|
.. | .. |
---|
994 | 1908 | s32 bssidx = -1; |
---|
995 | 1909 | unsigned long int flags; |
---|
996 | 1910 | |
---|
997 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1911 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1912 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
998 | 1913 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 1914 | + GCC_DIAGNOSTIC_POP(); |
---|
999 | 1915 | if (_net_info->wdev && (_net_info->wdev == wdev)) { |
---|
1000 | 1916 | bssidx = _net_info->bssidx; |
---|
1001 | 1917 | break; |
---|
1002 | 1918 | } |
---|
1003 | 1919 | } |
---|
1004 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1920 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
1005 | 1921 | return bssidx; |
---|
1006 | 1922 | } |
---|
1007 | 1923 | |
---|
1008 | 1924 | static inline struct wireless_dev * |
---|
1009 | | -wl_get_wdev_by_bssidx(struct bcm_cfg80211 *cfg, s32 bssidx) |
---|
| 1925 | +wl_get_wdev_by_fw_idx(struct bcm_cfg80211 *cfg, s32 bssidx, s32 ifidx) |
---|
1010 | 1926 | { |
---|
1011 | 1927 | struct net_info *_net_info, *next; |
---|
1012 | 1928 | struct wireless_dev *wdev = NULL; |
---|
.. | .. |
---|
1014 | 1930 | |
---|
1015 | 1931 | if (bssidx < 0) |
---|
1016 | 1932 | return NULL; |
---|
1017 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1933 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1934 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
1018 | 1935 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
1019 | | - if (_net_info->bssidx == bssidx) { |
---|
1020 | | - wdev = _net_info->wdev; |
---|
1021 | | - break; |
---|
| 1936 | + GCC_DIAGNOSTIC_POP(); |
---|
| 1937 | + if ((_net_info->bssidx == bssidx) && (_net_info->ifidx == ifidx)) { |
---|
| 1938 | + wdev = _net_info->wdev; |
---|
| 1939 | + break; |
---|
1022 | 1940 | } |
---|
1023 | 1941 | } |
---|
1024 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1942 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
1025 | 1943 | return wdev; |
---|
1026 | 1944 | } |
---|
1027 | 1945 | |
---|
.. | .. |
---|
1032 | 1950 | struct wl_profile *prof = NULL; |
---|
1033 | 1951 | unsigned long int flags; |
---|
1034 | 1952 | |
---|
1035 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1953 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1954 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
1036 | 1955 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 1956 | + GCC_DIAGNOSTIC_POP(); |
---|
1037 | 1957 | if (ndev && (_net_info->ndev == ndev)) { |
---|
1038 | 1958 | prof = &_net_info->profile; |
---|
1039 | 1959 | break; |
---|
1040 | 1960 | } |
---|
1041 | 1961 | } |
---|
1042 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1962 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
1043 | 1963 | return prof; |
---|
1044 | 1964 | } |
---|
1045 | 1965 | static inline struct net_info * |
---|
.. | .. |
---|
1048 | 1968 | struct net_info *_net_info, *next, *info = NULL; |
---|
1049 | 1969 | unsigned long int flags; |
---|
1050 | 1970 | |
---|
1051 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1971 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1972 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
1052 | 1973 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 1974 | + GCC_DIAGNOSTIC_POP(); |
---|
1053 | 1975 | if (ndev && (_net_info->ndev == ndev)) { |
---|
1054 | 1976 | info = _net_info; |
---|
1055 | 1977 | break; |
---|
1056 | 1978 | } |
---|
1057 | 1979 | } |
---|
1058 | | - spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 1980 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
1059 | 1981 | return info; |
---|
1060 | 1982 | } |
---|
1061 | 1983 | |
---|
.. | .. |
---|
1065 | 1987 | struct net_info *_net_info, *next, *info = NULL; |
---|
1066 | 1988 | unsigned long int flags; |
---|
1067 | 1989 | |
---|
1068 | | - spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 1990 | + WL_CFG_NET_LIST_SYNC_LOCK(&cfg->net_list_sync, flags); |
---|
| 1991 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
1069 | 1992 | BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 1993 | + GCC_DIAGNOSTIC_POP(); |
---|
1070 | 1994 | if (wdev && (_net_info->wdev == wdev)) { |
---|
1071 | 1995 | info = _net_info; |
---|
| 1996 | + break; |
---|
| 1997 | + } |
---|
| 1998 | + } |
---|
| 1999 | + WL_CFG_NET_LIST_SYNC_UNLOCK(&cfg->net_list_sync, flags); |
---|
| 2000 | + return info; |
---|
| 2001 | +} |
---|
| 2002 | + |
---|
| 2003 | +static inline u32 |
---|
| 2004 | +wl_get_chanwidth_by_netdev(struct bcm_cfg80211 *cfg, struct net_device *ndev) |
---|
| 2005 | +{ |
---|
| 2006 | + struct net_info *_net_info, *next; |
---|
| 2007 | + unsigned long int flags; |
---|
| 2008 | + u32 info = 0; |
---|
| 2009 | + spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 2010 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
| 2011 | + BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 2012 | + GCC_DIAGNOSTIC_POP(); |
---|
| 2013 | + if (ndev && (_net_info->ndev == ndev)) { |
---|
| 2014 | + info = _net_info->profile.channel_width; |
---|
1072 | 2015 | break; |
---|
1073 | 2016 | } |
---|
1074 | 2017 | } |
---|
.. | .. |
---|
1076 | 2019 | return info; |
---|
1077 | 2020 | } |
---|
1078 | 2021 | |
---|
| 2022 | +static inline void |
---|
| 2023 | +wl_set_chanwidth_by_netdev(struct bcm_cfg80211 *cfg, struct net_device *ndev, u32 chanwidth) |
---|
| 2024 | +{ |
---|
| 2025 | + struct net_info *_net_info, *next; |
---|
| 2026 | + unsigned long int flags; |
---|
| 2027 | + spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 2028 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
| 2029 | + BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 2030 | + GCC_DIAGNOSTIC_POP(); |
---|
| 2031 | + if (ndev && (_net_info->ndev == ndev)) |
---|
| 2032 | + _net_info->profile.channel_width = chanwidth; |
---|
| 2033 | + } |
---|
| 2034 | + spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 2035 | +} |
---|
| 2036 | + |
---|
| 2037 | +static inline struct wireless_dev * |
---|
| 2038 | +wl_get_wdev_by_dpp_listen(struct bcm_cfg80211 *cfg) |
---|
| 2039 | +{ |
---|
| 2040 | + struct wireless_dev *wdev = NULL; |
---|
| 2041 | + struct net_info *_net_info, *next; |
---|
| 2042 | + unsigned long int flags; |
---|
| 2043 | + spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 2044 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
| 2045 | + BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 2046 | + GCC_DIAGNOSTIC_POP(); |
---|
| 2047 | + if (_net_info->profile.dpp_listen) { |
---|
| 2048 | + wdev = _net_info->wdev; |
---|
| 2049 | + break; |
---|
| 2050 | + } |
---|
| 2051 | + } |
---|
| 2052 | + spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 2053 | + return wdev; |
---|
| 2054 | +} |
---|
| 2055 | + |
---|
| 2056 | +static inline void |
---|
| 2057 | +wl_set_dpp_listen_by_netdev(struct bcm_cfg80211 *cfg, struct net_device *ndev, bool dpp_listen) |
---|
| 2058 | +{ |
---|
| 2059 | + struct net_info *_net_info, *next; |
---|
| 2060 | + unsigned long int flags; |
---|
| 2061 | + spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 2062 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
| 2063 | + BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 2064 | + GCC_DIAGNOSTIC_POP(); |
---|
| 2065 | + if (ndev && (_net_info->ndev == ndev)) |
---|
| 2066 | + _net_info->profile.dpp_listen = dpp_listen; |
---|
| 2067 | + } |
---|
| 2068 | + spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 2069 | +} |
---|
| 2070 | + |
---|
| 2071 | +static inline char * |
---|
| 2072 | +wl_iftype_to_str(int wl_iftype) |
---|
| 2073 | +{ |
---|
| 2074 | + switch (wl_iftype) { |
---|
| 2075 | + case (WL_IF_TYPE_STA): |
---|
| 2076 | + return "WL_IF_TYPE_STA"; |
---|
| 2077 | + case (WL_IF_TYPE_AP): |
---|
| 2078 | + return "WL_IF_TYPE_AP"; |
---|
| 2079 | + case (WL_IF_TYPE_AWDL): |
---|
| 2080 | + return "WL_IF_TYPE_AWDL"; |
---|
| 2081 | + case (WL_IF_TYPE_NAN_NMI): |
---|
| 2082 | + return "WL_IF_TYPE_NAN_NMI"; |
---|
| 2083 | + case (WL_IF_TYPE_NAN): |
---|
| 2084 | + return "WL_IF_TYPE_NAN"; |
---|
| 2085 | + case (WL_IF_TYPE_P2P_GO): |
---|
| 2086 | + return "WL_IF_TYPE_P2P_GO"; |
---|
| 2087 | + case (WL_IF_TYPE_P2P_GC): |
---|
| 2088 | + return "WL_IF_TYPE_P2P_GC"; |
---|
| 2089 | + case (WL_IF_TYPE_P2P_DISC): |
---|
| 2090 | + return "WL_IF_TYPE_P2P_DISC"; |
---|
| 2091 | + case (WL_IF_TYPE_IBSS): |
---|
| 2092 | + return "WL_IF_TYPE_IBSS"; |
---|
| 2093 | + case (WL_IF_TYPE_MONITOR): |
---|
| 2094 | + return "WL_IF_TYPE_MONITOR"; |
---|
| 2095 | + case (WL_IF_TYPE_AIBSS): |
---|
| 2096 | + return "WL_IF_TYPE_AIBSS"; |
---|
| 2097 | + default: |
---|
| 2098 | + return "WL_IF_TYPE_UNKNOWN"; |
---|
| 2099 | + } |
---|
| 2100 | +} |
---|
| 2101 | + |
---|
| 2102 | +#define is_discovery_iface(iface) (((iface == WL_IF_TYPE_P2P_DISC) || \ |
---|
| 2103 | + (iface == WL_IF_TYPE_NAN_NMI)) ? 1 : 0) |
---|
1079 | 2104 | #define is_p2p_group_iface(wdev) (((wdev->iftype == NL80211_IFTYPE_P2P_GO) || \ |
---|
1080 | 2105 | (wdev->iftype == NL80211_IFTYPE_P2P_CLIENT)) ? 1 : 0) |
---|
1081 | 2106 | #define bcmcfg_to_wiphy(cfg) (cfg->wdev->wiphy) |
---|
.. | .. |
---|
1085 | 2110 | #define ndev_to_wl(n) (wdev_to_wl(n->ieee80211_ptr)) |
---|
1086 | 2111 | #define ndev_to_wdev(ndev) (ndev->ieee80211_ptr) |
---|
1087 | 2112 | #define wdev_to_ndev(wdev) (wdev->netdev) |
---|
| 2113 | + |
---|
| 2114 | +#ifdef WL_BLOCK_P2P_SCAN_ON_STA |
---|
| 2115 | +#define IS_P2P_IFACE(wdev) (wdev && \ |
---|
| 2116 | + ((wdev->iftype == NL80211_IFTYPE_P2P_DEVICE) || \ |
---|
| 2117 | + (wdev->iftype == NL80211_IFTYPE_P2P_GO) || \ |
---|
| 2118 | + (wdev->iftype == NL80211_IFTYPE_P2P_CLIENT))) |
---|
| 2119 | +#endif /* WL_BLOCK_P2P_SCAN_ON_STA */ |
---|
| 2120 | + |
---|
| 2121 | +#define IS_STA_IFACE(wdev) (wdev && \ |
---|
| 2122 | + (wdev->iftype == NL80211_IFTYPE_STATION)) |
---|
| 2123 | + |
---|
| 2124 | +#define IS_AP_IFACE(wdev) (wdev && \ |
---|
| 2125 | + (wdev->iftype == NL80211_IFTYPE_AP)) |
---|
1088 | 2126 | |
---|
1089 | 2127 | #if defined(WL_ENABLE_P2P_IF) |
---|
1090 | 2128 | #define ndev_to_wlc_ndev(ndev, cfg) ((ndev == cfg->p2p_net) ? \ |
---|
.. | .. |
---|
1132 | 2170 | true : false) |
---|
1133 | 2171 | #endif /* WL_CFG80211_P2P_DEV_IF */ |
---|
1134 | 2172 | |
---|
| 2173 | +#define PRINT_WDEV_INFO(cfgdev) \ |
---|
| 2174 | + { \ |
---|
| 2175 | + struct wireless_dev *wdev = cfgdev_to_wdev(cfgdev); \ |
---|
| 2176 | + struct net_device *netdev = wdev ? wdev->netdev : NULL; \ |
---|
| 2177 | + WL_DBG(("wdev_ptr:%p ndev_ptr:%p ifname:%s iftype:%d\n", OSL_OBFUSCATE_BUF(wdev), \ |
---|
| 2178 | + OSL_OBFUSCATE_BUF(netdev), \ |
---|
| 2179 | + netdev ? netdev->name : "NULL (non-ndev device)", \ |
---|
| 2180 | + wdev ? wdev->iftype : 0xff)); \ |
---|
| 2181 | + } |
---|
| 2182 | + |
---|
1135 | 2183 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)) |
---|
1136 | 2184 | #define scan_req_iftype(req) (req->dev->ieee80211_ptr->iftype) |
---|
1137 | 2185 | #else |
---|
.. | .. |
---|
1145 | 2193 | #else |
---|
1146 | 2194 | #define wl_to_ie(w) (&w->ie) |
---|
1147 | 2195 | #define wl_to_conn(w) (&w->conn_info) |
---|
1148 | | -#endif |
---|
| 2196 | +#endif // endif |
---|
| 2197 | +#define wl_to_fils_info(w) (&w->fils_info) |
---|
1149 | 2198 | #define wiphy_from_scan(w) (w->escan_info.wiphy) |
---|
1150 | 2199 | #define wl_get_drv_status_all(cfg, stat) \ |
---|
1151 | 2200 | (wl_get_status_all(cfg, WL_STATUS_ ## stat)) |
---|
.. | .. |
---|
1170 | 2219 | * In addtion to that, wpa_version is WPA_VERSION_1 |
---|
1171 | 2220 | */ |
---|
1172 | 2221 | #define is_wps_conn(_sme) \ |
---|
1173 | | - ((wl_cfgp2p_find_wpsie((u8 *)_sme->ie, _sme->ie_len) != NULL) && \ |
---|
| 2222 | + ((wl_cfgp2p_find_wpsie(_sme->ie, _sme->ie_len) != NULL) && \ |
---|
1174 | 2223 | (!_sme->crypto.n_ciphers_pairwise) && \ |
---|
1175 | 2224 | (!_sme->crypto.cipher_group)) |
---|
1176 | 2225 | |
---|
1177 | 2226 | #ifdef WLFBT |
---|
1178 | 2227 | #if defined(WLAN_AKM_SUITE_FT_8021X) && defined(WLAN_AKM_SUITE_FT_PSK) |
---|
1179 | 2228 | #define IS_AKM_SUITE_FT(sec) (sec->wpa_auth == WLAN_AKM_SUITE_FT_8021X || \ |
---|
1180 | | - sec->wpa_auth == WLAN_AKM_SUITE_FT_PSK) |
---|
| 2229 | + sec->wpa_auth == WLAN_AKM_SUITE_FT_PSK) |
---|
1181 | 2230 | #elif defined(WLAN_AKM_SUITE_FT_8021X) |
---|
1182 | 2231 | #define IS_AKM_SUITE_FT(sec) (sec->wpa_auth == WLAN_AKM_SUITE_FT_8021X) |
---|
1183 | 2232 | #elif defined(WLAN_AKM_SUITE_FT_PSK) |
---|
1184 | 2233 | #define IS_AKM_SUITE_FT(sec) (sec->wpa_auth == WLAN_AKM_SUITE_FT_PSK) |
---|
1185 | 2234 | #else |
---|
1186 | | -#define IS_AKM_SUITE_FT(sec) false |
---|
| 2235 | +#define IS_AKM_SUITE_FT(sec) ({BCM_REFERENCE(sec); FALSE;}) |
---|
1187 | 2236 | #endif /* WLAN_AKM_SUITE_FT_8021X && WLAN_AKM_SUITE_FT_PSK */ |
---|
1188 | 2237 | #else |
---|
1189 | | -#define IS_AKM_SUITE_FT(sec) false |
---|
| 2238 | +#define IS_AKM_SUITE_FT(sec) ({BCM_REFERENCE(sec); FALSE;}) |
---|
1190 | 2239 | #endif /* WLFBT */ |
---|
1191 | 2240 | |
---|
1192 | | -#define IS_AKM_SUITE_CCKM(sec) false |
---|
| 2241 | +#define IS_AKM_SUITE_CCKM(sec) ({BCM_REFERENCE(sec); FALSE;}) |
---|
1193 | 2242 | |
---|
1194 | 2243 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) |
---|
1195 | 2244 | #define STA_INFO_BIT(info) (1ul << NL80211_STA_ ## info) |
---|
| 2245 | +#ifdef strnicmp |
---|
| 2246 | +#undef strnicmp |
---|
| 2247 | +#endif /* strnicmp */ |
---|
1196 | 2248 | #define strnicmp(str1, str2, len) strncasecmp((str1), (str2), (len)) |
---|
1197 | 2249 | #else |
---|
1198 | 2250 | #define STA_INFO_BIT(info) (STATION_ ## info) |
---|
1199 | 2251 | #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) */ |
---|
1200 | 2252 | |
---|
1201 | 2253 | extern s32 wl_cfg80211_attach(struct net_device *ndev, void *context); |
---|
1202 | | -extern s32 wl_cfg80211_attach_post(struct net_device *ndev); |
---|
1203 | | -extern void wl_cfg80211_detach(void *para); |
---|
| 2254 | +extern void wl_cfg80211_detach(struct bcm_cfg80211 *cfg); |
---|
1204 | 2255 | |
---|
1205 | 2256 | extern void wl_cfg80211_event(struct net_device *ndev, const wl_event_msg_t *e, |
---|
1206 | 2257 | void *data); |
---|
| 2258 | +extern s32 wl_cfg80211_handle_critical_events(struct bcm_cfg80211 *cfg, |
---|
| 2259 | + const wl_event_msg_t * e); |
---|
| 2260 | + |
---|
1207 | 2261 | void wl_cfg80211_set_parent_dev(void *dev); |
---|
1208 | 2262 | struct device *wl_cfg80211_get_parent_dev(void); |
---|
| 2263 | +struct bcm_cfg80211 *wl_cfg80211_get_bcmcfg(void); |
---|
| 2264 | +void wl_cfg80211_set_bcmcfg(struct bcm_cfg80211 *cfg); |
---|
1209 | 2265 | |
---|
1210 | 2266 | /* clear IEs */ |
---|
1211 | 2267 | extern s32 wl_cfg80211_clear_mgmt_vndr_ies(struct bcm_cfg80211 *cfg); |
---|
1212 | | -extern s32 wl_cfg80211_clear_per_bss_ies(struct bcm_cfg80211 *cfg, s32 bssidx); |
---|
1213 | | - |
---|
1214 | | -extern s32 wl_cfg80211_up(void *para); |
---|
1215 | | -extern s32 wl_cfg80211_down(void *para); |
---|
1216 | | -extern s32 wl_cfg80211_notify_ifadd(int ifidx, char *name, uint8 *mac, uint8 bssidx); |
---|
1217 | | -extern s32 wl_cfg80211_notify_ifdel(int ifidx, char *name, uint8 *mac, uint8 bssidx); |
---|
1218 | | -extern s32 wl_cfg80211_notify_ifchange(int ifidx, char *name, uint8 *mac, uint8 bssidx); |
---|
1219 | | -extern struct net_device* wl_cfg80211_allocate_if(struct bcm_cfg80211 *cfg, int ifidx, char *name, |
---|
1220 | | - uint8 *mac, uint8 bssidx, char *dngl_name); |
---|
1221 | | -extern int wl_cfg80211_register_if(struct bcm_cfg80211 *cfg, int ifidx, struct net_device* ndev); |
---|
1222 | | -extern int wl_cfg80211_remove_if(struct bcm_cfg80211 *cfg, int ifidx, struct net_device* ndev); |
---|
1223 | | -extern int wl_cfg80211_scan_stop(bcm_struct_cfgdev *cfgdev); |
---|
1224 | | -extern bool wl_cfg80211_is_vsdb_mode(void); |
---|
1225 | | -extern void* wl_cfg80211_get_dhdp(void); |
---|
1226 | | -extern bool wl_cfg80211_is_p2p_active(void); |
---|
1227 | | -extern bool wl_cfg80211_is_roam_offload(void); |
---|
1228 | | -extern bool wl_cfg80211_is_event_from_connected_bssid(const wl_event_msg_t *e, int ifidx); |
---|
| 2268 | +extern s32 wl_cfg80211_clear_per_bss_ies(struct bcm_cfg80211 *cfg, struct wireless_dev *wdev); |
---|
| 2269 | +extern void wl_cfg80211_clear_p2p_disc_ies(struct bcm_cfg80211 *cfg); |
---|
| 2270 | +#ifdef WL_STATIC_IF |
---|
| 2271 | +extern int32 wl_cfg80211_update_iflist_info(struct bcm_cfg80211 *cfg, struct net_device *ndev, |
---|
| 2272 | + int ifidx, uint8 *addr, int bssidx, char *name, int if_state); |
---|
| 2273 | +extern int get_iface_num(const char *name, struct bcm_cfg80211 *cfg); |
---|
| 2274 | +extern bool is_static_iface(struct bcm_cfg80211 *cfg, struct net_device *net); |
---|
| 2275 | +extern int static_if_ndev_get_state(struct bcm_cfg80211 *cfg, struct net_device *net); |
---|
| 2276 | +extern bool is_static_iface_name(const char *name, struct bcm_cfg80211 *cfg); |
---|
| 2277 | +#endif /* WL_STATIC_IF */ |
---|
| 2278 | +extern s32 wl_cfg80211_up(struct net_device *net); |
---|
| 2279 | +extern s32 wl_cfg80211_down(struct net_device *net); |
---|
| 2280 | +extern void wl_cfg80211_sta_ifdown(struct net_device *net); |
---|
| 2281 | +extern s32 wl_cfg80211_notify_ifadd(struct net_device * dev, int ifidx, char *name, uint8 *mac, |
---|
| 2282 | + uint8 bssidx, uint8 role); |
---|
| 2283 | +extern s32 wl_cfg80211_notify_ifdel(struct net_device * dev, int ifidx, char *name, uint8 *mac, |
---|
| 2284 | + uint8 bssidx); |
---|
| 2285 | +extern s32 wl_cfg80211_notify_ifchange(struct net_device * dev, int ifidx, char *name, uint8 *mac, |
---|
| 2286 | + uint8 bssidx); |
---|
| 2287 | +extern struct net_device* wl_cfg80211_allocate_if(struct bcm_cfg80211 *cfg, int ifidx, |
---|
| 2288 | + const char *name, uint8 *mac, uint8 bssidx, const char *dngl_name); |
---|
| 2289 | +extern int wl_cfg80211_register_if(struct bcm_cfg80211 *cfg, |
---|
| 2290 | + int ifidx, struct net_device* ndev, bool rtnl_lock_reqd); |
---|
| 2291 | +extern int wl_cfg80211_remove_if(struct bcm_cfg80211 *cfg, |
---|
| 2292 | + int ifidx, struct net_device* ndev, bool rtnl_lock_reqd); |
---|
| 2293 | +extern void wl_cfg80211_cleanup_if(struct net_device *dev); |
---|
| 2294 | +extern bool wl_cfg80211_is_concurrent_mode(struct net_device * dev); |
---|
| 2295 | +extern void wl_cfg80211_disassoc(struct net_device *ndev, uint32 reason); |
---|
| 2296 | +extern void wl_cfg80211_del_all_sta(struct net_device *ndev, uint32 reason); |
---|
| 2297 | +extern void* wl_cfg80211_get_dhdp(struct net_device * dev); |
---|
| 2298 | +extern bool wl_cfg80211_is_p2p_active(struct net_device * dev); |
---|
| 2299 | +extern bool wl_cfg80211_is_roam_offload(struct net_device * dev); |
---|
| 2300 | +extern bool wl_cfg80211_is_event_from_connected_bssid(struct net_device * dev, |
---|
| 2301 | + const wl_event_msg_t *e, int ifidx); |
---|
1229 | 2302 | extern void wl_cfg80211_dbg_level(u32 level); |
---|
1230 | 2303 | extern s32 wl_cfg80211_get_p2p_dev_addr(struct net_device *net, struct ether_addr *p2pdev_addr); |
---|
1231 | 2304 | extern s32 wl_cfg80211_set_p2p_noa(struct net_device *net, char* buf, int len); |
---|
.. | .. |
---|
1234 | 2307 | enum wl_management_type type); |
---|
1235 | 2308 | extern s32 wl_cfg80211_set_p2p_ps(struct net_device *net, char* buf, int len); |
---|
1236 | 2309 | extern s32 wl_cfg80211_set_p2p_ecsa(struct net_device *net, char* buf, int len); |
---|
1237 | | -#ifdef WL11ULB |
---|
1238 | | -extern s32 wl_cfg80211_set_ulb_mode(struct net_device *dev, int mode); |
---|
1239 | | -extern s32 wl_cfg80211_set_ulb_bw(struct net_device *dev, |
---|
1240 | | - u32 ulb_bw, char *ifname); |
---|
1241 | | -#endif /* WL11ULB */ |
---|
| 2310 | +extern s32 wl_cfg80211_increase_p2p_bw(struct net_device *net, char* buf, int len); |
---|
| 2311 | +extern bool wl_cfg80211_check_vif_in_use(struct net_device *ndev); |
---|
1242 | 2312 | #ifdef P2PLISTEN_AP_SAMECHN |
---|
1243 | 2313 | extern s32 wl_cfg80211_set_p2p_resp_ap_chn(struct net_device *net, s32 enable); |
---|
1244 | 2314 | #endif /* P2PLISTEN_AP_SAMECHN */ |
---|
.. | .. |
---|
1246 | 2316 | /* btcoex functions */ |
---|
1247 | 2317 | void* wl_cfg80211_btcoex_init(struct net_device *ndev); |
---|
1248 | 2318 | void wl_cfg80211_btcoex_deinit(void); |
---|
| 2319 | + |
---|
| 2320 | +extern chanspec_t wl_chspec_from_legacy(chanspec_t legacy_chspec); |
---|
| 2321 | +extern chanspec_t wl_chspec_driver_to_host(chanspec_t chanspec); |
---|
1249 | 2322 | |
---|
1250 | 2323 | #ifdef WL_SUPPORT_AUTO_CHANNEL |
---|
1251 | 2324 | #define CHANSPEC_BUF_SIZE 1024 |
---|
.. | .. |
---|
1268 | 2341 | extern s32 wl_update_wiphybands(struct bcm_cfg80211 *cfg, bool notify); |
---|
1269 | 2342 | extern s32 wl_cfg80211_if_is_group_owner(void); |
---|
1270 | 2343 | extern chanspec_t wl_chspec_host_to_driver(chanspec_t chanspec); |
---|
1271 | | -extern chanspec_t wl_ch_host_to_driver(s32 bssidx, u16 channel); |
---|
| 2344 | +extern chanspec_t wl_ch_host_to_driver(u16 channel); |
---|
1272 | 2345 | extern s32 wl_set_tx_power(struct net_device *dev, |
---|
1273 | 2346 | enum nl80211_tx_power_setting type, s32 dbm); |
---|
1274 | 2347 | extern s32 wl_get_tx_power(struct net_device *dev, s32 *dbm); |
---|
1275 | 2348 | extern s32 wl_add_remove_eventmsg(struct net_device *ndev, u16 event, bool add); |
---|
1276 | | -extern void wl_stop_wait_next_action_frame(struct bcm_cfg80211 *cfg, struct net_device *ndev); |
---|
| 2349 | +extern s32 wl_add_remove_eventextmsg(struct net_device *ndev, u16 event, bool add); |
---|
| 2350 | +extern void wl_stop_wait_next_action_frame(struct bcm_cfg80211 *cfg, struct net_device *ndev, |
---|
| 2351 | + u8 bsscfgidx); |
---|
| 2352 | +#ifdef WL_HOST_BAND_MGMT |
---|
| 2353 | +extern s32 wl_cfg80211_set_band(struct net_device *ndev, int band); |
---|
| 2354 | +#endif /* WL_HOST_BAND_MGMT */ |
---|
1277 | 2355 | extern void wl_cfg80211_add_to_eventbuffer(wl_eventmsg_buf_t *ev, u16 event, bool set); |
---|
1278 | 2356 | extern s32 wl_cfg80211_apply_eventbuffer(struct net_device *ndev, |
---|
1279 | 2357 | struct bcm_cfg80211 *cfg, wl_eventmsg_buf_t *ev); |
---|
1280 | 2358 | extern void get_primary_mac(struct bcm_cfg80211 *cfg, struct ether_addr *mac); |
---|
1281 | 2359 | extern void wl_cfg80211_update_power_mode(struct net_device *dev); |
---|
1282 | | -extern void wl_cfg80211_set_passive_scan(struct net_device *dev, char *command); |
---|
1283 | | -extern void wl_terminate_event_handler(void); |
---|
| 2360 | +extern void wl_terminate_event_handler(struct net_device *dev); |
---|
| 2361 | +#if defined(DHD_ENABLE_BIGDATA_LOGGING) |
---|
| 2362 | +extern s32 wl_cfg80211_get_bss_info(struct net_device *dev, char* cmd, int total_len); |
---|
| 2363 | +extern s32 wl_cfg80211_get_connect_failed_status(struct net_device *dev, char* cmd, int total_len); |
---|
| 2364 | +#endif /* DHD_ENABLE_BIGDATA_LOGGING */ |
---|
| 2365 | +extern struct bcm_cfg80211 *wl_get_cfg(struct net_device *ndev); |
---|
| 2366 | +extern s32 wl_cfg80211_set_if_band(struct net_device *ndev, int band); |
---|
| 2367 | +extern s32 wl_cfg80211_set_country_code(struct net_device *dev, char *country_code, |
---|
| 2368 | + bool notify, bool user_enforced, int revinfo); |
---|
| 2369 | +extern bool wl_cfg80211_is_hal_started(struct bcm_cfg80211 *cfg); |
---|
| 2370 | +#ifdef WL_WIPSEVT |
---|
| 2371 | +extern int wl_cfg80211_wips_event(uint16 misdeauth, char* bssid); |
---|
| 2372 | +#endif /* WL_WIPSEVT */ |
---|
| 2373 | + |
---|
1284 | 2374 | #define SCAN_BUF_CNT 2 |
---|
1285 | 2375 | #define SCAN_BUF_NEXT 1 |
---|
1286 | 2376 | #define WL_SCANTYPE_LEGACY 0x1 |
---|
1287 | 2377 | #define WL_SCANTYPE_P2P 0x2 |
---|
1288 | | -#define wl_escan_set_sync_id(a, b) ((a) = htod16(0x1234)) |
---|
| 2378 | +#ifdef DUAL_ESCAN_RESULT_BUFFER |
---|
| 2379 | +#define wl_escan_set_sync_id(a, b) ((a) = (b)->escan_info.cur_sync_id) |
---|
| 2380 | +#define wl_escan_set_type(a, b) ((a)->escan_info.escan_type\ |
---|
| 2381 | + [((a)->escan_info.cur_sync_id)%SCAN_BUF_CNT] = (b)) |
---|
| 2382 | +static inline wl_scan_results_t *wl_escan_get_buf(struct bcm_cfg80211 *cfg, bool aborted) |
---|
| 2383 | +{ |
---|
| 2384 | + u8 index; |
---|
| 2385 | + if (aborted) { |
---|
| 2386 | + if (cfg->escan_info.escan_type[0] == cfg->escan_info.escan_type[1]) |
---|
| 2387 | + index = (cfg->escan_info.cur_sync_id + 1)%SCAN_BUF_CNT; |
---|
| 2388 | + else |
---|
| 2389 | + index = (cfg->escan_info.cur_sync_id)%SCAN_BUF_CNT; |
---|
| 2390 | + } |
---|
| 2391 | + else |
---|
| 2392 | + index = (cfg->escan_info.cur_sync_id)%SCAN_BUF_CNT; |
---|
| 2393 | + |
---|
| 2394 | + return (wl_scan_results_t *)cfg->escan_info.escan_buf[index]; |
---|
| 2395 | +} |
---|
| 2396 | +static inline int wl_escan_check_sync_id(s32 status, u16 result_id, u16 wl_id) |
---|
| 2397 | +{ |
---|
| 2398 | + if (result_id != wl_id) { |
---|
| 2399 | + WL_ERR(("ESCAN sync id mismatch :status :%d " |
---|
| 2400 | + "cur_sync_id:%d coming sync_id:%d\n", |
---|
| 2401 | + status, wl_id, result_id)); |
---|
| 2402 | + return -1; |
---|
| 2403 | + } |
---|
| 2404 | + else |
---|
| 2405 | + return 0; |
---|
| 2406 | +} |
---|
| 2407 | +static inline void wl_escan_print_sync_id(s32 status, u16 result_id, u16 wl_id) |
---|
| 2408 | +{ |
---|
| 2409 | + if (result_id != wl_id) { |
---|
| 2410 | + WL_ERR(("ESCAN sync id mismatch :status :%d " |
---|
| 2411 | + "cur_sync_id:%d coming sync_id:%d\n", |
---|
| 2412 | + status, wl_id, result_id)); |
---|
| 2413 | + } |
---|
| 2414 | +} |
---|
| 2415 | +#define wl_escan_increment_sync_id(a, b) ((a)->escan_info.cur_sync_id += b) |
---|
| 2416 | +#define wl_escan_init_sync_id(a) ((a)->escan_info.cur_sync_id = 0) |
---|
| 2417 | +#else |
---|
| 2418 | +#define wl_escan_set_sync_id(a, b) ((a) = htod16((b)->escan_sync_id_cntr++)) |
---|
1289 | 2419 | #define wl_escan_set_type(a, b) |
---|
1290 | 2420 | #define wl_escan_get_buf(a, b) ((wl_scan_results_t *) (a)->escan_info.escan_buf) |
---|
1291 | 2421 | #define wl_escan_check_sync_id(a, b, c) 0 |
---|
1292 | 2422 | #define wl_escan_print_sync_id(a, b, c) |
---|
1293 | 2423 | #define wl_escan_increment_sync_id(a, b) |
---|
1294 | 2424 | #define wl_escan_init_sync_id(a) |
---|
1295 | | -extern void wl_cfg80211_ibss_vsie_set_buffer(vndr_ie_setbuf_t *ibss_vsie, int ibss_vsie_len); |
---|
| 2425 | +#endif /* DUAL_ESCAN_RESULT_BUFFER */ |
---|
| 2426 | +extern void wl_cfg80211_ibss_vsie_set_buffer(struct net_device *dev, vndr_ie_setbuf_t *ibss_vsie, |
---|
| 2427 | + int ibss_vsie_len); |
---|
1296 | 2428 | extern s32 wl_cfg80211_ibss_vsie_delete(struct net_device *dev); |
---|
1297 | | -extern void wl_cfg80211_set_rmc_pid(int pid); |
---|
| 2429 | +#ifdef WLAIBSS |
---|
| 2430 | +extern void wl_cfg80211_set_txfail_pid(struct net_device *dev, int pid); |
---|
| 2431 | +#endif /* WLAIBSS */ |
---|
| 2432 | +#ifdef WL_RELMCAST |
---|
| 2433 | +extern void wl_cfg80211_set_rmc_pid(struct net_device *dev, int pid); |
---|
| 2434 | +#endif /* WL_RELMCAST */ |
---|
1298 | 2435 | extern int wl_cfg80211_set_mgmt_vndr_ies(struct bcm_cfg80211 *cfg, |
---|
1299 | 2436 | bcm_struct_cfgdev *cfgdev, s32 bssidx, s32 pktflag, |
---|
1300 | 2437 | const u8 *vndr_ie, u32 vndr_ie_len); |
---|
1301 | 2438 | |
---|
1302 | 2439 | #ifdef WLFBT |
---|
1303 | | -extern void wl_cfg80211_get_fbt_key(uint8 *key); |
---|
1304 | | -#endif |
---|
| 2440 | +extern int wl_cfg80211_get_fbt_key(struct net_device *dev, uint8 *key, int total_len); |
---|
| 2441 | +#endif // endif |
---|
1305 | 2442 | |
---|
1306 | 2443 | /* Action frame specific functions */ |
---|
1307 | 2444 | extern u8 wl_get_action_category(void *frame, u32 frame_len); |
---|
.. | .. |
---|
1323 | 2460 | #define IDLE_TOKEN_IDX 12 |
---|
1324 | 2461 | #endif /* WL_SUPPORT_ACS */ |
---|
1325 | 2462 | |
---|
| 2463 | +#ifdef BCMWAPI_WPI |
---|
| 2464 | +#define is_wapi(cipher) (cipher == WLAN_CIPHER_SUITE_SMS4) ? 1 : 0 |
---|
| 2465 | +#endif /* BCMWAPI_WPI */ |
---|
1326 | 2466 | |
---|
1327 | 2467 | extern int wl_cfg80211_get_ioctl_version(void); |
---|
1328 | 2468 | extern int wl_cfg80211_enable_roam_offload(struct net_device *dev, int enable); |
---|
1329 | 2469 | extern s32 wl_cfg80211_dfs_ap_move(struct net_device *ndev, char *data, |
---|
1330 | 2470 | char *command, int total_len); |
---|
| 2471 | +#ifdef WBTEXT |
---|
| 2472 | +extern s32 wl_cfg80211_wbtext_set_default(struct net_device *ndev); |
---|
1331 | 2473 | extern s32 wl_cfg80211_wbtext_config(struct net_device *ndev, char *data, |
---|
1332 | 2474 | char *command, int total_len); |
---|
1333 | 2475 | extern int wl_cfg80211_wbtext_weight_config(struct net_device *ndev, char *data, |
---|
.. | .. |
---|
1336 | 2478 | char *command, int total_len); |
---|
1337 | 2479 | extern s32 wl_cfg80211_wbtext_delta_config(struct net_device *ndev, char *data, |
---|
1338 | 2480 | char *command, int total_len); |
---|
| 2481 | +#endif /* WBTEXT */ |
---|
1339 | 2482 | extern s32 wl_cfg80211_get_chanspecs_2g(struct net_device *ndev, |
---|
1340 | 2483 | void *buf, s32 buflen); |
---|
1341 | 2484 | extern s32 wl_cfg80211_get_chanspecs_5g(struct net_device *ndev, |
---|
1342 | 2485 | void *buf, s32 buflen); |
---|
1343 | | -#if defined(WL_VIRTUAL_APSTA) |
---|
1344 | | -extern int wl_cfg80211_interface_create(struct net_device *dev, char *name); |
---|
1345 | | -extern int wl_cfg80211_interface_delete(struct net_device *dev, char *name); |
---|
1346 | | -#endif /* defined (WL_VIRTUAL_APSTA) */ |
---|
| 2486 | + |
---|
| 2487 | +#if defined(SAVE_CONNECTION_WHEN_CC_UPDATE) |
---|
| 2488 | +extern bool wl_update_ap_chandef(struct net_device *ndev); |
---|
| 2489 | +extern bool wl_check_valid_channel_in_country(struct net_device *ndev, char *ccode, int forced); |
---|
| 2490 | +#endif // endif |
---|
| 2491 | + |
---|
| 2492 | +extern s32 wl_cfg80211_bss_up(struct bcm_cfg80211 *cfg, |
---|
| 2493 | + struct net_device *ndev, s32 bsscfg_idx, s32 up); |
---|
| 2494 | +extern bool wl_cfg80211_bss_isup(struct net_device *ndev, int bsscfg_idx); |
---|
| 2495 | + |
---|
| 2496 | +struct net_device *wl_cfg80211_post_ifcreate(struct net_device *ndev, |
---|
| 2497 | + wl_if_event_info *event, u8 *addr, const char *name, bool rtnl_lock_reqd); |
---|
| 2498 | +extern s32 wl_cfg80211_post_ifdel(struct net_device *ndev, bool rtnl_lock_reqd, s32 ifidx); |
---|
| 2499 | +#if defined(PKT_FILTER_SUPPORT) && defined(APSTA_BLOCK_ARP_DURING_DHCP) |
---|
| 2500 | +extern void wl_cfg80211_block_arp(struct net_device *dev, int enable); |
---|
| 2501 | +#endif /* PKT_FILTER_SUPPORT && APSTA_BLOCK_ARP_DURING_DHCP */ |
---|
| 2502 | + |
---|
| 2503 | +#ifdef WLTDLS |
---|
| 2504 | +extern s32 wl_cfg80211_tdls_config(struct bcm_cfg80211 *cfg, |
---|
| 2505 | + enum wl_tdls_config state, bool tdls_mode); |
---|
| 2506 | +extern s32 wl_tdls_event_handler(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev, |
---|
| 2507 | + const wl_event_msg_t *e, void *data); |
---|
| 2508 | +#endif /* WLTDLS */ |
---|
1347 | 2509 | |
---|
1348 | 2510 | #ifdef WL_NAN |
---|
1349 | | -extern int wl_cfg80211_nan_cmd_handler(struct net_device *ndev, char *cmd, |
---|
1350 | | - int cmd_len); |
---|
| 2511 | +extern int wl_cfgvendor_send_nan_event(struct wiphy * wiphy, |
---|
| 2512 | + struct net_device *dev, int event_id, |
---|
| 2513 | + nan_event_data_t *nan_event_data); |
---|
| 2514 | +extern int wl_cfgnan_init(struct bcm_cfg80211 *cfg); |
---|
| 2515 | +extern int wl_cfgnan_deinit(struct bcm_cfg80211 *cfg, uint8 busstate); |
---|
| 2516 | +extern bool wl_cfgnan_check_state(struct bcm_cfg80211 *cfg); |
---|
| 2517 | +#ifdef RTT_SUPPORT |
---|
| 2518 | +extern s32 wl_cfgvendor_send_as_rtt_legacy_event(struct wiphy *wiphy, |
---|
| 2519 | + struct net_device *dev, wl_nan_ev_rng_rpt_ind_t *range_res, |
---|
| 2520 | + uint32 status); |
---|
| 2521 | +#endif /* RTT_SUPPORT */ |
---|
| 2522 | +#ifdef WL_NANP2P |
---|
| 2523 | +extern int wl_cfg80211_set_iface_conc_disc(struct net_device *ndev, |
---|
| 2524 | + uint8 arg_val); |
---|
| 2525 | +extern uint8 wl_cfg80211_get_iface_conc_disc(struct net_device *ndev); |
---|
| 2526 | +#endif /* WL_NANP2P */ |
---|
1351 | 2527 | #endif /* WL_NAN */ |
---|
1352 | 2528 | |
---|
1353 | 2529 | #ifdef WL_CFG80211_P2P_DEV_IF |
---|
1354 | | -extern void wl_cfg80211_del_p2p_wdev(void); |
---|
| 2530 | +extern void wl_cfg80211_del_p2p_wdev(struct net_device *dev); |
---|
1355 | 2531 | #endif /* WL_CFG80211_P2P_DEV_IF */ |
---|
1356 | | - |
---|
1357 | | -#if (defined(STBLINUX) && defined(WL_CFG80211)) |
---|
1358 | | - |
---|
1359 | | -int wl_cfg80211_cleanup(void); |
---|
1360 | | - |
---|
1361 | | -#endif /* STBLINUX && WL_CFG80211 */ |
---|
1362 | | - |
---|
1363 | 2532 | #if defined(WL_SUPPORT_AUTO_CHANNEL) |
---|
1364 | 2533 | extern int wl_cfg80211_set_spect(struct net_device *dev, int spect); |
---|
1365 | | -extern int wl_cfg80211_get_sta_channel(struct net_device *dev); |
---|
| 2534 | +extern int wl_cfg80211_get_sta_channel(struct bcm_cfg80211 *cfg); |
---|
1366 | 2535 | #endif /* WL_SUPPORT_AUTO_CHANNEL */ |
---|
| 2536 | +#ifdef WL_CFG80211_SYNC_GON |
---|
| 2537 | +#define WL_DRV_STATUS_SENDING_AF_FRM_EXT(cfg) \ |
---|
| 2538 | + (wl_get_drv_status_all(cfg, SENDING_ACT_FRM) || \ |
---|
| 2539 | + wl_get_drv_status_all(cfg, WAITING_NEXT_ACT_FRM_LISTEN)) |
---|
| 2540 | +#else |
---|
| 2541 | +#define WL_DRV_STATUS_SENDING_AF_FRM_EXT(cfg) wl_get_drv_status_all(cfg, SENDING_ACT_FRM) |
---|
| 2542 | +#endif /* WL_CFG80211_SYNC_GON */ |
---|
| 2543 | + |
---|
| 2544 | +#ifdef P2P_LISTEN_OFFLOADING |
---|
| 2545 | +extern s32 wl_cfg80211_p2plo_deinit(struct bcm_cfg80211 *cfg); |
---|
| 2546 | +#endif /* P2P_LISTEN_OFFLOADING */ |
---|
| 2547 | + |
---|
| 2548 | +/* Function to flush the FW log buffer content */ |
---|
| 2549 | +extern void wl_flush_fw_log_buffer(struct net_device *dev, uint32 logset_mask); |
---|
1367 | 2550 | |
---|
1368 | 2551 | #define RETURN_EIO_IF_NOT_UP(wlpriv) \ |
---|
1369 | 2552 | do { \ |
---|
.. | .. |
---|
1378 | 2561 | extern uint8 *wl_get_up_table(void); |
---|
1379 | 2562 | #endif /* QOS_MAP_SET */ |
---|
1380 | 2563 | |
---|
| 2564 | +#define P2PO_COOKIE 65535 |
---|
| 2565 | +u64 wl_cfg80211_get_new_roc_id(struct bcm_cfg80211 *cfg); |
---|
| 2566 | + |
---|
| 2567 | +#ifdef SUPPORT_AP_HIGHER_BEACONRATE |
---|
| 2568 | +int wl_set_ap_beacon_rate(struct net_device *dev, int val, char *ifname); |
---|
| 2569 | +int wl_get_ap_basic_rate(struct net_device *dev, char* command, char *ifname, int total_len); |
---|
| 2570 | +#endif /* SUPPORT_AP_HIGHER_BEACONRATE */ |
---|
| 2571 | +#ifdef SUPPORT_AP_RADIO_PWRSAVE |
---|
| 2572 | +int wl_get_ap_rps(struct net_device *dev, char* command, char *ifname, int total_len); |
---|
| 2573 | +int wl_set_ap_rps(struct net_device *dev, bool enable, char *ifname); |
---|
| 2574 | +int wl_update_ap_rps_params(struct net_device *dev, ap_rps_info_t* rps, char *ifname); |
---|
| 2575 | +void wl_cfg80211_init_ap_rps(struct bcm_cfg80211 *cfg); |
---|
| 2576 | +#endif /* SUPPORT_AP_RADIO_PWRSAVE */ |
---|
| 2577 | +#ifdef SUPPORT_RSSI_SUM_REPORT |
---|
| 2578 | +int wl_get_rssi_logging(struct net_device *dev, void *param); |
---|
| 2579 | +int wl_set_rssi_logging(struct net_device *dev, void *param); |
---|
| 2580 | +int wl_get_rssi_per_ant(struct net_device *dev, char *ifname, char *peer_mac, void *param); |
---|
| 2581 | +#endif /* SUPPORT_RSSI_SUM_REPORT */ |
---|
| 2582 | +int wl_cfg80211_iface_count(struct net_device *dev); |
---|
| 2583 | +struct net_device* wl_get_ap_netdev(struct bcm_cfg80211 *cfg, char *ifname); |
---|
| 2584 | +void wl_cfg80211_cleanup_virtual_ifaces(struct bcm_cfg80211 *cfg, bool rtnl_lock_reqd); |
---|
| 2585 | +#ifdef WL_IFACE_MGMT |
---|
| 2586 | +extern int wl_cfg80211_set_iface_policy(struct net_device *ndev, char *arg, int len); |
---|
| 2587 | +extern uint8 wl_cfg80211_get_iface_policy(struct net_device *ndev); |
---|
| 2588 | +extern s32 wl_cfg80211_handle_if_role_conflict(struct bcm_cfg80211 *cfg, wl_iftype_t new_wl_iftype); |
---|
| 2589 | +s32 wl_cfg80211_data_if_mgmt(struct bcm_cfg80211 *cfg, wl_iftype_t new_wl_iftype); |
---|
| 2590 | +s32 wl_cfg80211_disc_if_mgmt(struct bcm_cfg80211 *cfg, wl_iftype_t new_wl_iftype, |
---|
| 2591 | + bool *disable_nan, bool *disable_p2p); |
---|
| 2592 | +s32 wl_cfg80211_handle_discovery_config(struct bcm_cfg80211 *cfg, wl_iftype_t new_wl_iftype); |
---|
| 2593 | +wl_iftype_t wl_cfg80211_get_sec_iface(struct bcm_cfg80211 *cfg); |
---|
| 2594 | +bool wl_cfg80211_is_associated_discovery(struct bcm_cfg80211 *cfg, wl_iftype_t new_wl_iftype); |
---|
| 2595 | +#endif /* WL_IFACE_MGMT */ |
---|
| 2596 | +struct wireless_dev * wl_cfg80211_add_if(struct bcm_cfg80211 *cfg, struct net_device *primary_ndev, |
---|
| 2597 | + wl_iftype_t wl_iftype, const char *name, u8 *mac); |
---|
| 2598 | +extern s32 wl_cfg80211_del_if(struct bcm_cfg80211 *cfg, struct net_device *primary_ndev, |
---|
| 2599 | + struct wireless_dev *wdev, char *name); |
---|
| 2600 | +s32 _wl_cfg80211_del_if(struct bcm_cfg80211 *cfg, struct net_device *primary_ndev, |
---|
| 2601 | + struct wireless_dev *wdev, char *ifname); |
---|
| 2602 | +s32 wl_cfg80211_delete_iface(struct bcm_cfg80211 *cfg, wl_iftype_t sec_data_if_type); |
---|
| 2603 | +s32 wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, bool enabled, s32 timeout); |
---|
| 2604 | + |
---|
| 2605 | +#ifdef WL_STATIC_IF |
---|
| 2606 | +extern struct net_device *wl_cfg80211_register_static_if(struct bcm_cfg80211 *cfg, |
---|
| 2607 | + u16 iftype, char *ifname, int ifidx); |
---|
| 2608 | +extern void wl_cfg80211_unregister_static_if(struct bcm_cfg80211 * cfg); |
---|
| 2609 | +extern s32 wl_cfg80211_static_if_open(struct net_device *net); |
---|
| 2610 | +extern s32 wl_cfg80211_static_if_close(struct net_device *net); |
---|
| 2611 | +extern struct net_device * wl_cfg80211_post_static_ifcreate(struct bcm_cfg80211 *cfg, |
---|
| 2612 | + wl_if_event_info *event, u8 *addr, s32 iface_type, const char *iface_name); |
---|
| 2613 | +extern s32 wl_cfg80211_post_static_ifdel(struct bcm_cfg80211 *cfg, struct net_device *ndev); |
---|
| 2614 | +#endif /* WL_STATIC_IF */ |
---|
| 2615 | +extern struct wireless_dev *wl_cfg80211_get_wdev_from_ifname(struct bcm_cfg80211 *cfg, |
---|
| 2616 | + const char *name); |
---|
| 2617 | +struct net_device* wl_get_netdev_by_name(struct bcm_cfg80211 *cfg, char *ifname); |
---|
| 2618 | +extern s32 wl_get_vif_macaddr(struct bcm_cfg80211 *cfg, u16 wl_iftype, u8 *mac_addr); |
---|
| 2619 | +extern s32 wl_release_vif_macaddr(struct bcm_cfg80211 *cfg, u8 *mac_addr, u16 wl_iftype); |
---|
| 2620 | +extern int wl_cfg80211_ifstats_counters(struct net_device *dev, wl_if_stats_t *if_stats); |
---|
| 2621 | +extern s32 wl_cfg80211_set_dbg_verbose(struct net_device *ndev, u32 level); |
---|
| 2622 | +extern s32 wl_cfg80211_set_transition_mode(struct net_device *ndev, u32 transition_disabled); |
---|
| 2623 | +extern s32 wl_cfg80211_set_sae_pwe(struct net_device *ndev, u8 sae_pwe); |
---|
| 2624 | +extern int wl_cfg80211_deinit_p2p_discovery(struct bcm_cfg80211 * cfg); |
---|
| 2625 | +extern int wl_cfg80211_set_frameburst(struct bcm_cfg80211 *cfg, bool enable); |
---|
| 2626 | +extern int wl_cfg80211_determine_p2p_rsdb_mode(struct bcm_cfg80211 *cfg); |
---|
| 2627 | +extern uint8 wl_cfg80211_get_bus_state(struct bcm_cfg80211 *cfg); |
---|
| 2628 | +#ifdef WL_WPS_SYNC |
---|
| 2629 | +void wl_handle_wps_states(struct net_device *ndev, u8 *dump_data, u16 len, bool direction); |
---|
| 2630 | +#endif /* WL_WPS_SYNC */ |
---|
| 2631 | +extern int wl_features_set(u8 *array, uint8 len, u32 ftidx); |
---|
| 2632 | +extern void *wl_read_prof(struct bcm_cfg80211 *cfg, struct net_device *ndev, s32 item); |
---|
| 2633 | +extern s32 wl_cfg80211_sup_event_handler(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev, |
---|
| 2634 | + const wl_event_msg_t *event, void *data); |
---|
| 2635 | +extern s32 wl_inform_bss(struct bcm_cfg80211 *cfg); |
---|
| 2636 | +extern void wl_cfg80211_cancel_scan(struct bcm_cfg80211 *cfg); |
---|
| 2637 | +extern s32 wl_notify_escan_complete(struct bcm_cfg80211 *cfg, |
---|
| 2638 | + struct net_device *ndev, bool aborted, bool fw_abort); |
---|
| 2639 | +#ifdef CUSTOMER_HW4_DEBUG |
---|
| 2640 | +extern void wl_scan_timeout_dbg_clear(void); |
---|
| 2641 | +#endif /* CUSTOMER_HW4_DEBUG */ |
---|
| 2642 | +extern s32 cfg80211_to_wl_iftype(uint16 type, uint16 *role, uint16 *mode); |
---|
| 2643 | +extern s32 wl_cfg80211_net_attach(struct net_device *primary_ndev); |
---|
| 2644 | +extern void wl_print_verinfo(struct bcm_cfg80211 *cfg); |
---|
| 2645 | +extern const u8 *wl_find_attribute(const u8 *buf, u16 len, u16 element_id); |
---|
| 2646 | +extern int wl_cfg80211_get_concurrency_mode(struct bcm_cfg80211 *cfg); |
---|
| 2647 | +#if defined(WL_DISABLE_HE_SOFTAP) || defined(WL_DISABLE_HE_P2P) |
---|
| 2648 | +int wl_cfg80211_set_he_mode(struct net_device *dev, struct bcm_cfg80211 *cfg, |
---|
| 2649 | + s32 bssidx, u32 interface_type, bool set); |
---|
| 2650 | +#define WL_HE_FEATURES_HE_AP 0x8 |
---|
| 2651 | +#define WL_HE_FEATURES_HE_P2P 0x20 |
---|
| 2652 | +#endif /* WL_DISABLE_HE_SOFTAP || WL_DISABLE_HE_P2P */ |
---|
| 2653 | +extern s32 wl_cfg80211_config_suspend_events(struct net_device *ndev, bool enable); |
---|
| 2654 | +void wl_cfg80211_overtemp_event(struct net_device *ndev); |
---|
| 2655 | + |
---|
| 2656 | +#ifdef WL11U |
---|
| 2657 | +extern bcm_tlv_t * |
---|
| 2658 | +wl_cfg80211_find_interworking_ie(const u8 *parse, u32 len); |
---|
| 2659 | +extern s32 |
---|
| 2660 | +wl_cfg80211_add_iw_ie(struct bcm_cfg80211 *cfg, struct net_device *ndev, s32 bssidx, s32 pktflag, |
---|
| 2661 | + uint8 ie_id, uint8 *data, uint8 data_len); |
---|
| 2662 | +extern s32 |
---|
| 2663 | +wl_cfg80211_clear_iw_ie(struct bcm_cfg80211 *cfg, struct net_device *ndev, s32 bssidx); |
---|
| 2664 | + |
---|
| 2665 | +static inline void |
---|
| 2666 | +wl_get_iwdata_by_netdev(struct bcm_cfg80211 *cfg, struct net_device *ndev, u8 *iw_ie, |
---|
| 2667 | + u32 *iw_ie_len) |
---|
| 2668 | +{ |
---|
| 2669 | + struct net_info *_net_info, *next; |
---|
| 2670 | + unsigned long int flags; |
---|
| 2671 | + |
---|
| 2672 | + spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 2673 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
| 2674 | + BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 2675 | + GCC_DIAGNOSTIC_POP(); |
---|
| 2676 | + if (ndev && (_net_info->ndev == ndev)) { |
---|
| 2677 | + *iw_ie_len = _net_info->profile.iw_ie_len; |
---|
| 2678 | + memcpy(iw_ie, _net_info->profile.iw_ie, _net_info->profile.iw_ie_len); |
---|
| 2679 | + break; |
---|
| 2680 | + } |
---|
| 2681 | + } |
---|
| 2682 | + spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 2683 | +} |
---|
| 2684 | + |
---|
| 2685 | +static inline void |
---|
| 2686 | +wl_set_iwdata_by_netdev(struct bcm_cfg80211 *cfg, struct net_device *ndev, u8 *iw_ie, u32 iw_ie_len) |
---|
| 2687 | +{ |
---|
| 2688 | + struct net_info *_net_info, *next; |
---|
| 2689 | + unsigned long int flags; |
---|
| 2690 | + |
---|
| 2691 | + spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 2692 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
| 2693 | + BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 2694 | + GCC_DIAGNOSTIC_POP(); |
---|
| 2695 | + if (ndev && (_net_info->ndev == ndev)) { |
---|
| 2696 | + _net_info->profile.iw_ie_len = iw_ie_len; |
---|
| 2697 | + memcpy(_net_info->profile.iw_ie, iw_ie, _net_info->profile.iw_ie_len); |
---|
| 2698 | + } |
---|
| 2699 | + } |
---|
| 2700 | + spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 2701 | +} |
---|
| 2702 | + |
---|
| 2703 | +static inline void |
---|
| 2704 | +wl_clear_iwdata_by_netdev(struct bcm_cfg80211 *cfg, struct net_device *ndev) |
---|
| 2705 | +{ |
---|
| 2706 | + struct net_info *_net_info, *next; |
---|
| 2707 | + unsigned long int flags; |
---|
| 2708 | + |
---|
| 2709 | + spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 2710 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
| 2711 | + BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, &cfg->net_list, list) { |
---|
| 2712 | + GCC_DIAGNOSTIC_POP(); |
---|
| 2713 | + if (ndev && (_net_info->ndev == ndev)) { |
---|
| 2714 | + _net_info->profile.iw_ie_len = 0; |
---|
| 2715 | + memset(_net_info->profile.iw_ie, 0, IW_IES_MAX_BUF_LEN); |
---|
| 2716 | + } |
---|
| 2717 | + } |
---|
| 2718 | + spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 2719 | +} |
---|
| 2720 | + |
---|
| 2721 | +static inline void |
---|
| 2722 | +wl_clear_iwdata(struct bcm_cfg80211 *cfg) |
---|
| 2723 | +{ |
---|
| 2724 | + struct net_info *_net_info, *next; |
---|
| 2725 | + unsigned long int flags; |
---|
| 2726 | + spin_lock_irqsave(&cfg->net_list_sync, flags); |
---|
| 2727 | + GCC_DIAGNOSTIC_PUSH_SUPPRESS_CAST(); |
---|
| 2728 | + BCM_LIST_FOR_EACH_ENTRY_SAFE(_net_info, next, |
---|
| 2729 | + &cfg->net_list, list) { |
---|
| 2730 | + GCC_DIAGNOSTIC_POP(); |
---|
| 2731 | + if (_net_info->profile.iw_ie_len) { |
---|
| 2732 | + _net_info->profile.iw_ie_len = 0; |
---|
| 2733 | + memset(_net_info->profile.iw_ie, 0, IW_IES_MAX_BUF_LEN); |
---|
| 2734 | + } |
---|
| 2735 | + } |
---|
| 2736 | + spin_unlock_irqrestore(&cfg->net_list_sync, flags); |
---|
| 2737 | + return; |
---|
| 2738 | +} |
---|
| 2739 | +#endif /* WL11U */ |
---|
1381 | 2740 | #endif /* _wl_cfg80211_h_ */ |
---|