Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Prashanth Bhatta | 9e14305 | 2015-12-04 11:56:47 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | #if !defined(WLAN_HDD_MAIN_H) |
| 29 | #define WLAN_HDD_MAIN_H |
| 30 | /**=========================================================================== |
| 31 | |
| 32 | \file WLAN_HDD_MAIN_H.h |
| 33 | |
| 34 | \brief Linux HDD Adapter Type |
| 35 | |
| 36 | ==========================================================================*/ |
| 37 | |
| 38 | /*--------------------------------------------------------------------------- |
| 39 | Include files |
| 40 | -------------------------------------------------------------------------*/ |
| 41 | |
| 42 | #include <linux/netdevice.h> |
| 43 | #include <linux/skbuff.h> |
| 44 | #include <net/cfg80211.h> |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 45 | #include <qdf_list.h> |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 46 | #include <qdf_types.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 47 | #include "sir_mac_prot_def.h" |
| 48 | #include "csr_api.h" |
| 49 | #include <wlan_hdd_assoc.h> |
| 50 | #include <wlan_hdd_wmm.h> |
| 51 | #include <wlan_hdd_cfg.h> |
| 52 | #include <linux/spinlock.h> |
| 53 | #if defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK) |
| 54 | #include <linux/wakelock.h> |
| 55 | #endif |
| 56 | #include <wlan_hdd_ftm.h> |
| 57 | #ifdef FEATURE_WLAN_TDLS |
| 58 | #include "wlan_hdd_tdls.h" |
| 59 | #endif |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 60 | #include "wlan_hdd_tsf.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 61 | #include "wlan_hdd_cfg80211.h" |
Anurag Chouhan | 42958bb | 2016-02-19 15:43:11 +0530 | [diff] [blame] | 62 | #include <qdf_defer.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 63 | #ifdef WLAN_FEATURE_MBSSID |
| 64 | #include "sap_api.h" |
| 65 | #endif |
| 66 | #include "ol_txrx_osif_api.h" |
| 67 | #include "ol_txrx_ctrl_api.h" |
| 68 | #include <wlan_hdd_lro.h> |
Dhanashri Atre | b08959a | 2016-03-01 17:28:03 -0800 | [diff] [blame] | 69 | #include "cdp_txrx_flow_ctrl_legacy.h" |
Manjunathappa Prakash | 3454fd6 | 2016-04-01 08:52:06 -0700 | [diff] [blame] | 70 | #include <cdp_txrx_peer_ops.h> |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 71 | #include "wlan_hdd_nan_datapath.h" |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 72 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 73 | /*--------------------------------------------------------------------------- |
| 74 | Preprocessor definitions and constants |
| 75 | -------------------------------------------------------------------------*/ |
| 76 | /** Number of Tx Queues */ |
| 77 | #ifdef QCA_LL_TX_FLOW_CONTROL_V2 |
| 78 | #define NUM_TX_QUEUES 5 |
| 79 | #else |
| 80 | #define NUM_TX_QUEUES 4 |
| 81 | #endif |
Mohit Khanna | ee9e80f | 2015-11-10 11:32:49 -0800 | [diff] [blame] | 82 | |
| 83 | /** Length of the TX queue for the netdev */ |
| 84 | #define HDD_NETDEV_TX_QUEUE_LEN (3000) |
| 85 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 86 | /** Hdd Tx Time out value */ |
| 87 | #ifdef LIBRA_LINUX_PC |
| 88 | #define HDD_TX_TIMEOUT (8000) |
| 89 | #else |
| 90 | #define HDD_TX_TIMEOUT msecs_to_jiffies(5000) |
| 91 | #endif |
| 92 | /** Hdd Default MTU */ |
| 93 | #define HDD_DEFAULT_MTU (1500) |
| 94 | |
| 95 | #ifdef QCA_CONFIG_SMP |
| 96 | #define NUM_CPUS NR_CPUS |
| 97 | #else |
| 98 | #define NUM_CPUS 1 |
| 99 | #endif |
| 100 | |
| 101 | /**event flags registered net device*/ |
| 102 | #define NET_DEVICE_REGISTERED (0) |
| 103 | #define SME_SESSION_OPENED (1) |
| 104 | #define INIT_TX_RX_SUCCESS (2) |
| 105 | #define WMM_INIT_DONE (3) |
| 106 | #define SOFTAP_BSS_STARTED (4) |
| 107 | #define DEVICE_IFACE_OPENED (5) |
| 108 | #define TDLS_INIT_DONE (6) |
| 109 | #define ACS_PENDING (7) |
| 110 | |
| 111 | /* HDD global event flags */ |
| 112 | #define ACS_IN_PROGRESS (0) |
| 113 | |
| 114 | /** Maximum time(ms)to wait for disconnect to complete **/ |
| 115 | #ifdef QCA_WIFI_3_0_EMU |
Abhishek Singh | 5a33171 | 2016-08-08 18:10:20 +0530 | [diff] [blame] | 116 | #define WLAN_WAIT_TIME_DISCONNECT 5000 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 117 | #else |
Abhishek Singh | 5a33171 | 2016-08-08 18:10:20 +0530 | [diff] [blame] | 118 | #define WLAN_WAIT_TIME_DISCONNECT 5000 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 119 | #endif |
| 120 | #define WLAN_WAIT_TIME_STATS 800 |
| 121 | #define WLAN_WAIT_TIME_POWER 800 |
| 122 | #define WLAN_WAIT_TIME_COUNTRY 1000 |
| 123 | #define WLAN_WAIT_TIME_LINK_STATUS 800 |
| 124 | /* Amount of time to wait for sme close session callback. |
| 125 | This value should be larger than the timeout used by WDI to wait for |
| 126 | a response from WCNSS */ |
| 127 | #define WLAN_WAIT_TIME_SESSIONOPENCLOSE 15000 |
| 128 | #define WLAN_WAIT_TIME_ABORTSCAN 2000 |
| 129 | |
| 130 | /** Maximum time(ms) to wait for mc thread suspend **/ |
| 131 | #define WLAN_WAIT_TIME_MCTHREAD_SUSPEND 1200 |
| 132 | |
| 133 | /** Maximum time(ms) to wait for target to be ready for suspend **/ |
| 134 | #define WLAN_WAIT_TIME_READY_TO_SUSPEND 2000 |
| 135 | |
| 136 | /** Maximum time(ms) to wait for tdls add sta to complete **/ |
| 137 | #define WAIT_TIME_TDLS_ADD_STA 1500 |
| 138 | |
| 139 | /** Maximum time(ms) to wait for tdls del sta to complete **/ |
| 140 | #define WAIT_TIME_TDLS_DEL_STA 1500 |
| 141 | |
| 142 | /** Maximum time(ms) to wait for Link Establish Req to complete **/ |
| 143 | #define WAIT_TIME_TDLS_LINK_ESTABLISH_REQ 1500 |
| 144 | |
| 145 | /** Maximum time(ms) to wait for tdls mgmt to complete **/ |
| 146 | #define WAIT_TIME_TDLS_MGMT 11000 |
| 147 | |
| 148 | /* Scan Req Timeout */ |
| 149 | #define WLAN_WAIT_TIME_SCAN_REQ 100 |
| 150 | |
Archana Ramachandran | d41c3ed | 2016-02-10 15:48:06 -0800 | [diff] [blame] | 151 | #define WLAN_WAIT_TIME_ANTENNA_MODE_REQ 3000 |
| 152 | #define WLAN_WAIT_TIME_SET_DUAL_MAC_CFG 1500 |
| 153 | |
Arun Khandavalli | 2476ef5 | 2016-04-26 20:19:43 +0530 | [diff] [blame] | 154 | #define WLAN_WAIT_TIME_BPF 1000 |
| 155 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 156 | #define MAX_NUMBER_OF_ADAPTERS 4 |
| 157 | |
| 158 | #define MAX_CFG_STRING_LEN 255 |
| 159 | |
| 160 | #define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] |
| 161 | /** Mac Address string **/ |
| 162 | #define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x" |
| 163 | #define MAC_ADDRESS_STR_LEN 18 /* Including null terminator */ |
| 164 | #define MAX_GENIE_LEN 255 |
| 165 | |
| 166 | #define WLAN_CHIP_VERSION "WCNSS" |
| 167 | |
Jeff Johnson | 32ad174 | 2015-12-09 13:26:44 -0800 | [diff] [blame] | 168 | #ifndef HDD_DISALLOW_LEGACY_HDDLOG |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 169 | #define hddLog(level, args ...) QDF_TRACE(QDF_MODULE_ID_HDD, level, ## args) |
Jeff Johnson | 32ad174 | 2015-12-09 13:26:44 -0800 | [diff] [blame] | 170 | #endif |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 171 | #define hdd_log(level, args...) QDF_TRACE(QDF_MODULE_ID_HDD, level, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 172 | #define hdd_logfl(level, format, args...) hdd_log(level, FL(format), ## args) |
| 173 | |
| 174 | #define hdd_alert(format, args...) \ |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 175 | hdd_logfl(QDF_TRACE_LEVEL_FATAL, format, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 176 | #define hdd_err(format, args...) \ |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 177 | hdd_logfl(QDF_TRACE_LEVEL_ERROR, format, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 178 | #define hdd_warn(format, args...) \ |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 179 | hdd_logfl(QDF_TRACE_LEVEL_WARN, format, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 180 | #define hdd_notice(format, args...) \ |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 181 | hdd_logfl(QDF_TRACE_LEVEL_INFO, format, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 182 | #define hdd_info(format, args...) \ |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 183 | hdd_logfl(QDF_TRACE_LEVEL_INFO_HIGH, format, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 184 | #define hdd_debug(format, args...) \ |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 185 | hdd_logfl(QDF_TRACE_LEVEL_DEBUG, format, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 186 | |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 187 | #define ENTER() hdd_logfl(QDF_TRACE_LEVEL_INFO_LOW, "enter") |
Jeff Johnson | 398b3d6 | 2016-02-10 17:19:39 -0800 | [diff] [blame] | 188 | #define ENTER_DEV(dev) \ |
| 189 | hdd_logfl(QDF_TRACE_LEVEL_INFO_LOW, "enter(%s)", (dev)->name) |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 190 | #define EXIT() hdd_logfl(QDF_TRACE_LEVEL_INFO_LOW, "exit") |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 191 | |
| 192 | #define WLAN_HDD_GET_PRIV_PTR(__dev__) (hdd_adapter_t *)(netdev_priv((__dev__))) |
| 193 | |
| 194 | #define MAX_NO_OF_2_4_CHANNELS 14 |
| 195 | |
| 196 | #define WLAN_HDD_PUBLIC_ACTION_FRAME 4 |
| 197 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET 24 |
| 198 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET 24 |
| 199 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET 30 |
| 200 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_CATEGORY_OFFSET 0 |
| 201 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_ACTION_OFFSET 1 |
| 202 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_OFFSET 2 |
| 203 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_TYPE_OFFSET 5 |
| 204 | #define WLAN_HDD_VENDOR_SPECIFIC_ACTION 0x09 |
| 205 | #define WLAN_HDD_WFA_OUI 0x506F9A |
| 206 | #define WLAN_HDD_WFA_P2P_OUI_TYPE 0x09 |
| 207 | #define WLAN_HDD_P2P_SOCIAL_CHANNELS 3 |
| 208 | #define WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN 1 |
| 209 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_SUB_TYPE_OFFSET 6 |
| 210 | |
| 211 | #define WLAN_HDD_IS_SOCIAL_CHANNEL(center_freq) \ |
| 212 | (((center_freq) == 2412) || ((center_freq) == 2437) || ((center_freq) == 2462)) |
| 213 | |
| 214 | #define WLAN_HDD_CHANNEL_IN_UNII_1_BAND(center_freq) \ |
| 215 | (((center_freq) == 5180) || ((center_freq) == 5200) \ |
| 216 | || ((center_freq) == 5220) || ((center_freq) == 5240)) |
| 217 | |
| 218 | #ifdef WLAN_FEATURE_11W |
| 219 | #define WLAN_HDD_SA_QUERY_ACTION_FRAME 8 |
| 220 | #endif |
| 221 | |
| 222 | #define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14 |
| 223 | #define WLAN_HDD_TDLS_ACTION_FRAME 12 |
| 224 | #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK |
| 225 | #define HDD_WAKE_LOCK_DURATION 50 /* in msecs */ |
| 226 | #endif |
| 227 | |
| 228 | #define WLAN_HDD_QOS_ACTION_FRAME 1 |
| 229 | #define WLAN_HDD_QOS_MAP_CONFIGURE 4 |
| 230 | #define HDD_SAP_WAKE_LOCK_DURATION 10000 /* in msecs */ |
| 231 | |
Mukul Sharma | 974ca65 | 2016-09-03 16:24:48 +0530 | [diff] [blame] | 232 | #if defined(CONFIG_HL_SUPPORT) |
| 233 | #define HDD_MOD_EXIT_SSR_MAX_RETRIES 200 |
| 234 | #else |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 235 | #define HDD_MOD_EXIT_SSR_MAX_RETRIES 75 |
Mukul Sharma | 974ca65 | 2016-09-03 16:24:48 +0530 | [diff] [blame] | 236 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 237 | |
| 238 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 239 | #define GTK_OFFLOAD_ENABLE 0 |
| 240 | #define GTK_OFFLOAD_DISABLE 1 |
| 241 | #endif |
| 242 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 243 | #define MAX_USER_COMMAND_SIZE 4096 |
| 244 | |
| 245 | #define HDD_MIN_TX_POWER (-100) /* minimum tx power */ |
| 246 | #define HDD_MAX_TX_POWER (+100) /* maximum tx power */ |
| 247 | |
Manjeet Singh | e7ecb7c | 2016-09-03 12:34:53 +0530 | [diff] [blame] | 248 | /* FW expects burst duration in 1020*ms */ |
| 249 | #define SIFS_BURST_DUR_MULTIPLIER 1020 |
| 250 | #define SIFS_BURST_DUR_MAX 12240 |
| 251 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 252 | /* If IPA UC data path is enabled, target should reserve extra tx descriptors |
| 253 | * for IPA data path. |
| 254 | * Then host data path should allow less TX packet pumping in case |
| 255 | * IPA data path enabled |
| 256 | */ |
| 257 | #define WLAN_TFC_IPAUC_TX_DESC_RESERVE 100 |
| 258 | |
Ryan Hsu | 07495ea | 2016-01-21 15:25:39 -0800 | [diff] [blame] | 259 | /* |
| 260 | * NET_NAME_UNKNOWN is only introduced after Kernel 3.17, to have a macro |
| 261 | * here if the Kernel version is less than 3.17 to avoid the interleave |
| 262 | * conditional compilation. |
| 263 | */ |
| 264 | #if !((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)) || defined(WITH_BACKPORTS)) |
| 265 | #define NET_NAME_UNKNOWN 0 |
| 266 | #endif |
| 267 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 268 | #define BSS_WAIT_TIMEOUT 10000 |
| 269 | |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 270 | #define PRE_CAC_SSID "pre_cac_ssid" |
Arun Khandavalli | b2f6c26 | 2016-08-18 19:07:19 +0530 | [diff] [blame] | 271 | |
| 272 | /* session ID invalid */ |
| 273 | #define HDD_SESSION_ID_INVALID 0xFF |
| 274 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 275 | /* |
| 276 | * Generic asynchronous request/response support |
| 277 | * |
| 278 | * Many of the APIs supported by HDD require a call to SME to |
| 279 | * perform an action or to retrieve some data. In most cases SME |
| 280 | * performs the operation asynchronously, and will execute a provided |
| 281 | * callback function when the request has completed. In order to |
| 282 | * synchronize this the HDD API allocates a context which is then |
| 283 | * passed to SME, and which is then, in turn, passed back to the |
| 284 | * callback function when the operation completes. The callback |
| 285 | * function then sets a completion variable inside the context which |
| 286 | * the HDD API is waiting on. In an ideal world the HDD API would |
| 287 | * wait forever (or at least for a long time) for the response to be |
| 288 | * received and for the completion variable to be set. However in |
| 289 | * most cases these HDD APIs are being invoked in the context of a |
| 290 | * user space thread which has invoked either a cfg80211 API or a |
| 291 | * wireless extensions ioctl and which has taken the kernel rtnl_lock. |
| 292 | * Since this lock is used to synchronize many of the kernel tasks, we |
| 293 | * do not want to hold it for a long time. In addition we do not want |
| 294 | * to block user space threads (such as the wpa supplicant's main |
| 295 | * thread) for an extended time. Therefore we only block for a short |
| 296 | * time waiting for the response before we timeout. This means that |
| 297 | * it is possible for the HDD API to timeout, and for the callback to |
| 298 | * be invoked afterwards. In order for the callback function to |
| 299 | * determine if the HDD API is still waiting, a magic value is also |
| 300 | * stored in the shared context. Only if the context has a valid |
| 301 | * magic will the callback routine do any work. In order to further |
| 302 | * synchronize these activities a spinlock is used so that if any HDD |
| 303 | * API timeout coincides with its callback, the operations of the two |
| 304 | * threads will be serialized. |
| 305 | */ |
| 306 | |
| 307 | struct statsContext { |
| 308 | struct completion completion; |
| 309 | hdd_adapter_t *pAdapter; |
| 310 | unsigned int magic; |
| 311 | }; |
| 312 | |
| 313 | struct linkspeedContext { |
| 314 | struct completion completion; |
| 315 | hdd_adapter_t *pAdapter; |
| 316 | unsigned int magic; |
| 317 | }; |
| 318 | |
| 319 | extern spinlock_t hdd_context_lock; |
| 320 | |
| 321 | #define STATS_CONTEXT_MAGIC 0x53544154 /* STAT */ |
| 322 | #define RSSI_CONTEXT_MAGIC 0x52535349 /* RSSI */ |
| 323 | #define POWER_CONTEXT_MAGIC 0x504F5752 /* POWR */ |
| 324 | #define SNR_CONTEXT_MAGIC 0x534E5200 /* SNR */ |
| 325 | #define LINK_CONTEXT_MAGIC 0x4C494E4B /* LINKSPEED */ |
| 326 | #define LINK_STATUS_MAGIC 0x4C4B5354 /* LINKSTATUS(LNST) */ |
| 327 | #define TEMP_CONTEXT_MAGIC 0x74656d70 /* TEMP (temperature) */ |
Arun Khandavalli | 2476ef5 | 2016-04-26 20:19:43 +0530 | [diff] [blame] | 328 | #define BPF_CONTEXT_MAGIC 0x4575354 /* BPF */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 329 | |
| 330 | /* MAX OS Q block time value in msec |
| 331 | * Prevent from permanent stall, resume OS Q if timer expired */ |
| 332 | #define WLAN_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME 1000 |
| 333 | #define WLAN_SAP_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME 100 |
| 334 | #define WLAN_HDD_TX_FLOW_CONTROL_MAX_24BAND_CH 14 |
| 335 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 336 | #define NUM_TX_RX_HISTOGRAM 1024 |
| 337 | #define NUM_TX_RX_HISTOGRAM_MASK (NUM_TX_RX_HISTOGRAM - 1) |
| 338 | |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 339 | /** |
| 340 | * struct hdd_tx_rx_histogram - structure to keep track of tx and rx packets |
| 341 | * received over 100ms intervals |
| 342 | * @interval_rx: # of rx packets received in the last 100ms interval |
| 343 | * @interval_tx: # of tx packets received in the last 100ms interval |
| 344 | * @total_rx: # of total rx packets received on interface |
| 345 | * @total_tx: # of total tx packets received on interface |
Yuanyuan Liu | 1373850 | 2016-04-06 17:41:37 -0700 | [diff] [blame] | 346 | * @next_vote_level: pld_bus_width_type voting level (high or low) |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 347 | * determined on the basis of total tx and rx packets |
| 348 | * received in the last 100ms interval |
Yuanyuan Liu | 1373850 | 2016-04-06 17:41:37 -0700 | [diff] [blame] | 349 | * @next_rx_level: pld_bus_width_type voting level (high or low) |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 350 | * determined on the basis of rx packets received in the |
| 351 | * last 100ms interval |
Yuanyuan Liu | 1373850 | 2016-04-06 17:41:37 -0700 | [diff] [blame] | 352 | * @next_tx_level: pld_bus_width_type voting level (high or low) |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 353 | * determined on the basis of tx packets received in the |
| 354 | * last 100ms interval |
| 355 | * |
| 356 | * The structure keeps track of throughput requirements of wlan driver in 100ms |
| 357 | * intervals for later analysis. |
| 358 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 359 | struct hdd_tx_rx_histogram { |
| 360 | uint64_t interval_rx; |
| 361 | uint64_t interval_tx; |
| 362 | uint64_t total_rx; |
| 363 | uint64_t total_tx; |
| 364 | uint32_t next_vote_level; |
| 365 | uint32_t next_rx_level; |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 366 | uint32_t next_tx_level; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 367 | }; |
| 368 | |
| 369 | typedef struct hdd_tx_rx_stats_s { |
| 370 | /* start_xmit stats */ |
| 371 | __u32 txXmitCalled; |
| 372 | __u32 txXmitDropped; |
| 373 | __u32 txXmitClassifiedAC[NUM_TX_QUEUES]; |
| 374 | __u32 txXmitDroppedAC[NUM_TX_QUEUES]; |
| 375 | /* complete_cbk_stats */ |
| 376 | __u32 txCompleted; |
| 377 | /* rx stats */ |
| 378 | __u32 rxPackets[NUM_CPUS]; |
| 379 | __u32 rxDropped[NUM_CPUS]; |
| 380 | __u32 rxDelivered[NUM_CPUS]; |
| 381 | __u32 rxRefused[NUM_CPUS]; |
| 382 | |
| 383 | /* txflow stats */ |
| 384 | bool is_txflow_paused; |
| 385 | __u32 txflow_pause_cnt; |
| 386 | __u32 txflow_unpause_cnt; |
| 387 | __u32 txflow_timer_cnt; |
| 388 | } hdd_tx_rx_stats_t; |
| 389 | |
| 390 | #ifdef WLAN_FEATURE_11W |
| 391 | typedef struct hdd_pmf_stats_s { |
| 392 | uint8_t numUnprotDeauthRx; |
| 393 | uint8_t numUnprotDisassocRx; |
| 394 | } hdd_pmf_stats_t; |
| 395 | #endif |
| 396 | |
| 397 | typedef struct hdd_stats_s { |
| 398 | tCsrSummaryStatsInfo summary_stat; |
| 399 | tCsrGlobalClassAStatsInfo ClassA_stat; |
| 400 | tCsrGlobalClassBStatsInfo ClassB_stat; |
| 401 | tCsrGlobalClassCStatsInfo ClassC_stat; |
| 402 | tCsrGlobalClassDStatsInfo ClassD_stat; |
| 403 | tCsrPerStaStatsInfo perStaStats; |
Himanshu Agarwal | 37e4241 | 2016-07-21 14:35:09 +0530 | [diff] [blame] | 404 | struct csr_per_chain_rssi_stats_info per_chain_rssi_stats; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 405 | hdd_tx_rx_stats_t hddTxRxStats; |
| 406 | #ifdef WLAN_FEATURE_11W |
| 407 | hdd_pmf_stats_t hddPmfStats; |
| 408 | #endif |
| 409 | } hdd_stats_t; |
| 410 | |
| 411 | typedef enum { |
| 412 | HDD_ROAM_STATE_NONE, |
| 413 | |
| 414 | /* Issuing a disconnect due to transition into low power states. */ |
| 415 | HDD_ROAM_STATE_DISCONNECTING_POWER, |
| 416 | |
| 417 | /* move to this state when HDD sets a key with SME/CSR. Note this is */ |
| 418 | /* an important state to get right because we will get calls into our SME */ |
| 419 | /* callback routine for SetKey activity that we did not initiate! */ |
| 420 | HDD_ROAM_STATE_SETTING_KEY, |
| 421 | } HDD_ROAM_STATE; |
| 422 | |
| 423 | typedef struct roaming_info_s { |
| 424 | HDD_ROAM_STATE roamingState; |
Anurag Chouhan | ce0dc99 | 2016-02-16 18:18:03 +0530 | [diff] [blame] | 425 | qdf_event_t roamingEvent; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 426 | |
| 427 | tSirMacAddr bssid; |
| 428 | tSirMacAddr peerMac; |
| 429 | uint32_t roamId; |
| 430 | eRoamCmdStatus roamStatus; |
| 431 | bool deferKeyComplete; |
| 432 | |
| 433 | } roaming_info_t; |
| 434 | |
| 435 | #ifdef FEATURE_WLAN_WAPI |
| 436 | /* Define WAPI macros for Length, BKID count etc*/ |
| 437 | #define MAX_WPI_KEY_LENGTH 16 |
| 438 | #define MAX_NUM_PN 16 |
| 439 | #define MAC_ADDR_LEN 6 |
| 440 | #define MAX_ADDR_INDEX 12 |
| 441 | #define MAX_NUM_AKM_SUITES 16 |
| 442 | #define MAX_NUM_UNI_SUITES 16 |
| 443 | #define MAX_NUM_BKIDS 16 |
| 444 | |
| 445 | /** WAPI AUTH mode definition */ |
| 446 | enum _WAPIAuthMode { |
| 447 | WAPI_AUTH_MODE_OPEN = 0, |
| 448 | WAPI_AUTH_MODE_PSK = 1, |
| 449 | WAPI_AUTH_MODE_CERT |
| 450 | } __packed; |
| 451 | typedef enum _WAPIAuthMode WAPIAuthMode; |
| 452 | |
| 453 | /** WAPI Work mode structure definition */ |
| 454 | #define WZC_ORIGINAL 0 |
| 455 | #define WAPI_EXTENTION 1 |
| 456 | |
| 457 | struct _WAPI_FUNCTION_MODE { |
| 458 | unsigned char wapiMode; |
| 459 | } __packed; |
| 460 | |
| 461 | typedef struct _WAPI_FUNCTION_MODE WAPI_FUNCTION_MODE; |
| 462 | |
| 463 | typedef struct _WAPI_BKID { |
| 464 | uint8_t bkid[16]; |
| 465 | } WAPI_BKID, *pWAPI_BKID; |
| 466 | |
| 467 | /** WAPI Association information structure definition */ |
| 468 | struct _WAPI_AssocInfo { |
| 469 | uint8_t elementID; |
| 470 | uint8_t length; |
| 471 | uint16_t version; |
| 472 | uint16_t akmSuiteCount; |
| 473 | uint32_t akmSuite[MAX_NUM_AKM_SUITES]; |
| 474 | uint16_t unicastSuiteCount; |
| 475 | uint32_t unicastSuite[MAX_NUM_UNI_SUITES]; |
| 476 | uint32_t multicastSuite; |
| 477 | uint16_t wapiCability; |
| 478 | uint16_t bkidCount; |
| 479 | WAPI_BKID bkidList[MAX_NUM_BKIDS]; |
| 480 | } __packed; |
| 481 | |
| 482 | typedef struct _WAPI_AssocInfo WAPI_AssocInfo; |
| 483 | typedef struct _WAPI_AssocInfo *pWAPI_IEAssocInfo; |
| 484 | |
| 485 | /** WAPI KEY Type definition */ |
| 486 | enum _WAPIKeyType { |
| 487 | PAIRWISE_KEY, /* 0 */ |
| 488 | GROUP_KEY /* 1 */ |
| 489 | } __packed; |
| 490 | typedef enum _WAPIKeyType WAPIKeyType; |
| 491 | |
| 492 | /** WAPI KEY Direction definition */ |
| 493 | enum _KEY_DIRECTION { |
| 494 | None, |
| 495 | Rx, |
| 496 | Tx, |
| 497 | Rx_Tx |
| 498 | } __packed; |
| 499 | |
| 500 | typedef enum _KEY_DIRECTION WAPI_KEY_DIRECTION; |
| 501 | |
| 502 | /* WAPI KEY structure definition */ |
| 503 | struct WLAN_WAPI_KEY { |
| 504 | WAPIKeyType keyType; |
| 505 | WAPI_KEY_DIRECTION keyDirection; /*reserved for future use */ |
| 506 | uint8_t keyId; |
| 507 | uint8_t addrIndex[MAX_ADDR_INDEX]; /*reserved for future use */ |
| 508 | int wpiekLen; |
| 509 | uint8_t wpiek[MAX_WPI_KEY_LENGTH]; |
| 510 | int wpickLen; |
| 511 | uint8_t wpick[MAX_WPI_KEY_LENGTH]; |
| 512 | uint8_t pn[MAX_NUM_PN]; /*reserved for future use */ |
| 513 | } __packed; |
| 514 | |
| 515 | typedef struct WLAN_WAPI_KEY WLAN_WAPI_KEY; |
| 516 | typedef struct WLAN_WAPI_KEY *pWLAN_WAPI_KEY; |
| 517 | |
| 518 | #define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) |
| 519 | #define WPA_GET_BE24(a) ((u32) ((a[0] << 16) | (a[1] << 8) | a[2])) |
| 520 | #define WLAN_EID_WAPI 68 |
| 521 | #define WAPI_PSK_AKM_SUITE 0x02721400 |
| 522 | #define WAPI_CERT_AKM_SUITE 0x01721400 |
| 523 | |
| 524 | /* WAPI BKID List structure definition */ |
| 525 | struct _WLAN_BKID_LIST { |
| 526 | uint32_t length; |
| 527 | uint32_t BKIDCount; |
| 528 | WAPI_BKID BKID[1]; |
| 529 | } __packed; |
| 530 | |
| 531 | typedef struct _WLAN_BKID_LIST WLAN_BKID_LIST; |
| 532 | typedef struct _WLAN_BKID_LIST *pWLAN_BKID_LIST; |
| 533 | |
| 534 | /* WAPI Information structure definition */ |
| 535 | struct hdd_wapi_info_s { |
| 536 | uint32_t nWapiMode; |
| 537 | bool fIsWapiSta; |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 538 | struct qdf_mac_addr cachedMacAddr; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 539 | uint8_t wapiAuthMode; |
| 540 | } __packed; |
| 541 | typedef struct hdd_wapi_info_s hdd_wapi_info_t; |
| 542 | #endif /* FEATURE_WLAN_WAPI */ |
| 543 | |
| 544 | typedef struct beacon_data_s { |
| 545 | u8 *head; |
| 546 | u8 *tail; |
| 547 | u8 *proberesp_ies; |
| 548 | u8 *assocresp_ies; |
| 549 | int head_len; |
| 550 | int tail_len; |
| 551 | int proberesp_ies_len; |
| 552 | int assocresp_ies_len; |
| 553 | int dtim_period; |
| 554 | } beacon_data_t; |
| 555 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 556 | typedef enum rem_on_channel_request_type { |
| 557 | REMAIN_ON_CHANNEL_REQUEST, |
| 558 | OFF_CHANNEL_ACTION_TX, |
| 559 | } rem_on_channel_request_type_t; |
| 560 | |
| 561 | typedef struct action_pkt_buffer { |
| 562 | uint8_t *frame_ptr; |
| 563 | uint32_t frame_length; |
| 564 | uint16_t freq; |
| 565 | } action_pkt_buffer_t; |
| 566 | |
| 567 | typedef struct hdd_remain_on_chan_ctx { |
| 568 | struct net_device *dev; |
| 569 | struct ieee80211_channel chan; |
| 570 | enum nl80211_channel_type chan_type; |
| 571 | unsigned int duration; |
| 572 | u64 cookie; |
| 573 | rem_on_channel_request_type_t rem_on_chan_request; |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 574 | qdf_mc_timer_t hdd_remain_on_chan_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 575 | action_pkt_buffer_t action_pkt_buff; |
| 576 | bool hdd_remain_on_chan_cancel_in_progress; |
| 577 | uint32_t scan_id; |
| 578 | } hdd_remain_on_chan_ctx_t; |
| 579 | |
| 580 | /* RoC Request entry */ |
| 581 | typedef struct hdd_roc_req { |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 582 | qdf_list_node_t node; /* MUST be first element */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 583 | hdd_adapter_t *pAdapter; |
| 584 | hdd_remain_on_chan_ctx_t *pRemainChanCtx; |
| 585 | } hdd_roc_req_t; |
| 586 | |
| 587 | /** |
| 588 | * struct hdd_scan_req - Scan Request entry |
| 589 | * @node : List entry element |
| 590 | * @adapter: Adapter address |
| 591 | * @scan_request: scan request holder |
| 592 | * @scan_id: scan identifier used across host layers which is generated at WMI |
| 593 | * @cookie: scan request identifier sent to userspace |
| 594 | * @source: scan request originator (NL/Vendor scan) |
| 595 | * @timestamp: scan request timestamp |
| 596 | * |
| 597 | * Scan request linked list element |
| 598 | */ |
| 599 | struct hdd_scan_req { |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 600 | qdf_list_node_t node; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 601 | hdd_adapter_t *adapter; |
| 602 | struct cfg80211_scan_request *scan_request; |
| 603 | uint32_t scan_id; |
| 604 | uint8_t source; |
| 605 | uint32_t timestamp; |
| 606 | }; |
| 607 | |
| 608 | typedef enum { |
| 609 | HDD_IDLE, |
| 610 | HDD_PD_REQ_ACK_PENDING, |
| 611 | HDD_GO_NEG_REQ_ACK_PENDING, |
| 612 | HDD_INVALID_STATE, |
| 613 | } eP2PActionFrameState; |
| 614 | |
| 615 | typedef enum { |
| 616 | WLAN_HDD_GO_NEG_REQ, |
| 617 | WLAN_HDD_GO_NEG_RESP, |
| 618 | WLAN_HDD_GO_NEG_CNF, |
| 619 | WLAN_HDD_INVITATION_REQ, |
| 620 | WLAN_HDD_INVITATION_RESP, |
| 621 | WLAN_HDD_DEV_DIS_REQ, |
| 622 | WLAN_HDD_DEV_DIS_RESP, |
| 623 | WLAN_HDD_PROV_DIS_REQ, |
| 624 | WLAN_HDD_PROV_DIS_RESP, |
| 625 | } tActionFrmType; |
| 626 | |
| 627 | typedef struct hdd_cfg80211_state_s { |
| 628 | uint16_t current_freq; |
| 629 | u64 action_cookie; |
| 630 | uint8_t *buf; |
| 631 | size_t len; |
| 632 | hdd_remain_on_chan_ctx_t *remain_on_chan_ctx; |
| 633 | struct mutex remain_on_chan_ctx_lock; |
| 634 | eP2PActionFrameState actionFrmState; |
Gowri, Deepthi | 62da33e | 2016-09-02 16:01:26 +0530 | [diff] [blame] | 635 | /* is_go_neg_ack_received flag is set to 1 when |
| 636 | * the pending ack for GO negotiation req is |
| 637 | * received. |
| 638 | */ |
| 639 | bool is_go_neg_ack_received; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 640 | } hdd_cfg80211_state_t; |
| 641 | |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 642 | /** |
| 643 | * struct hdd_mon_set_ch_info - Holds monitor mode channel switch params |
| 644 | * @channel: Channel number. |
| 645 | * @cb_mode: Channel bonding |
| 646 | * @channel_width: Channel width 0/1/2 for 20/40/80MHz respectively. |
| 647 | * @phy_mode: PHY mode |
| 648 | */ |
| 649 | struct hdd_mon_set_ch_info { |
| 650 | uint8_t channel; |
| 651 | uint8_t cb_mode; |
| 652 | uint32_t channel_width; |
| 653 | eCsrPhyMode phy_mode; |
| 654 | }; |
| 655 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 656 | struct hdd_station_ctx { |
| 657 | /** Handle to the Wireless Extension State */ |
| 658 | hdd_wext_state_t WextState; |
| 659 | |
| 660 | #ifdef FEATURE_WLAN_TDLS |
| 661 | tdlsCtx_t *pHddTdlsCtx; |
| 662 | #endif |
| 663 | |
| 664 | /**Connection information*/ |
| 665 | connection_info_t conn_info; |
| 666 | |
| 667 | roaming_info_t roam_info; |
| 668 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 669 | int ft_carrier_on; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 670 | |
| 671 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 672 | tSirGtkOffloadParams gtkOffloadReqParams; |
| 673 | #endif |
| 674 | /*Increment whenever ibss New peer joins and departs the network */ |
| 675 | int ibss_sta_generation; |
| 676 | |
| 677 | /* Indication of wep/wpa-none keys installation */ |
| 678 | bool ibss_enc_key_installed; |
| 679 | |
| 680 | /*Save the wep/wpa-none keys */ |
| 681 | tCsrRoamSetKey ibss_enc_key; |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 682 | tSirPeerInfoRspParams ibss_peer_info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 683 | |
| 684 | bool hdd_ReassocScenario; |
| 685 | |
| 686 | /* STA ctx debug variables */ |
| 687 | int staDebugState; |
Chandrasekaran, Manishekar | 34e325a | 2015-12-18 12:07:22 +0530 | [diff] [blame] | 688 | |
Rakesh Sunki | cf1c9ab | 2016-08-25 14:11:25 -0700 | [diff] [blame] | 689 | uint8_t broadcast_staid; |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 690 | |
| 691 | struct hdd_mon_set_ch_info ch_info; |
Deepak Dhamdhere | 8360d4c | 2016-06-01 13:24:31 -0700 | [diff] [blame] | 692 | #ifdef WLAN_FEATURE_NAN_DATAPATH |
| 693 | struct nan_datapath_ctx ndp_ctx; |
| 694 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 695 | }; |
| 696 | |
| 697 | #define BSS_STOP 0 |
| 698 | #define BSS_START 1 |
| 699 | typedef struct hdd_hostapd_state_s { |
| 700 | int bssState; |
Anurag Chouhan | f04e84f | 2016-03-03 10:12:12 +0530 | [diff] [blame] | 701 | qdf_event_t qdf_event; |
| 702 | qdf_event_t qdf_stop_bss_event; |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 703 | QDF_STATUS qdf_status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 704 | bool bCommit; |
| 705 | |
| 706 | } hdd_hostapd_state_t; |
| 707 | |
| 708 | /* |
| 709 | * Per station structure kept in HDD for multiple station support for SoftAP |
| 710 | */ |
| 711 | typedef struct { |
| 712 | /** The station entry is used or not */ |
| 713 | bool isUsed; |
| 714 | |
| 715 | /** Station ID reported back from HAL (through SAP). Broadcast |
| 716 | * uses station ID zero by default in both libra and volans. */ |
| 717 | uint8_t ucSTAId; |
| 718 | |
| 719 | /** MAC address of the station */ |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 720 | struct qdf_mac_addr macAddrSTA; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 721 | |
| 722 | /** Current Station state so HDD knows how to deal with packet |
| 723 | * queue. Most recent states used to change TLSHIM STA state */ |
| 724 | enum ol_txrx_peer_state tlSTAState; |
| 725 | |
| 726 | /** Track QoS status of station */ |
| 727 | bool isQosEnabled; |
| 728 | |
| 729 | /** The station entry for which Deauth is in progress */ |
| 730 | bool isDeauthInProgress; |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 731 | |
| 732 | /** Number of spatial streams supported */ |
| 733 | uint8_t nss; |
| 734 | |
| 735 | /** Rate Flags for this connection */ |
| 736 | uint32_t rate_flags; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 737 | } hdd_station_info_t; |
| 738 | |
| 739 | struct hdd_ap_ctx_s { |
| 740 | hdd_hostapd_state_t HostapdState; |
| 741 | |
| 742 | /* Memory differentiation mode is enabled */ |
| 743 | /* uint16_t uMemoryDiffThreshold; */ |
| 744 | /* uint8_t uNumActiveAC; */ |
| 745 | /* uint8_t uActiveACMask; */ |
| 746 | |
| 747 | /** Packet Count to update uNumActiveAC and uActiveACMask */ |
| 748 | /* uint16_t uUpdatePktCount; */ |
| 749 | |
| 750 | /** Station ID assigned after BSS starts */ |
| 751 | uint8_t uBCStaId; |
| 752 | |
| 753 | uint8_t uPrivacy; /* The privacy bits of configuration */ |
| 754 | |
| 755 | tSirWPSPBCProbeReq WPSPBCProbeReq; |
| 756 | |
| 757 | tsap_Config_t sapConfig; |
| 758 | |
| 759 | struct semaphore semWpsPBCOverlapInd; |
| 760 | |
| 761 | bool apDisableIntraBssFwd; |
| 762 | |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 763 | qdf_mc_timer_t hdd_ap_inactivity_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 764 | |
| 765 | uint8_t operatingChannel; |
| 766 | |
| 767 | bool uIsAuthenticated; |
| 768 | |
| 769 | eCsrEncryptionType ucEncryptType; |
| 770 | |
| 771 | /* This will point to group key data, if it is received before start bss. */ |
| 772 | tCsrRoamSetKey groupKey; |
| 773 | /* This will have WEP key data, if it is received before start bss */ |
| 774 | tCsrRoamSetKey wepKey[CSR_MAX_NUM_KEY]; |
| 775 | |
Kondabattini, Ganesh | 702d90e | 2016-09-03 01:54:22 +0530 | [diff] [blame] | 776 | /* WEP default key index */ |
| 777 | uint8_t wep_def_key_idx; |
| 778 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 779 | beacon_data_t *beacon; |
| 780 | |
| 781 | bool bApActive; |
| 782 | #ifdef WLAN_FEATURE_MBSSID |
| 783 | /* SAP Context */ |
| 784 | void *sapContext; |
| 785 | #endif |
| 786 | bool dfs_cac_block_tx; |
| 787 | }; |
| 788 | |
| 789 | typedef struct hdd_scaninfo_s { |
| 790 | /* The scan pending */ |
| 791 | uint32_t mScanPending; |
| 792 | |
| 793 | /* Counter for mScanPending so that the scan pending |
| 794 | error log is not printed for more than 5 times */ |
| 795 | uint32_t mScanPendingCounter; |
| 796 | |
| 797 | /* Additional IE for scan */ |
| 798 | tSirAddie scanAddIE; |
| 799 | |
| 800 | /* Scan mode */ |
| 801 | tSirScanType scan_mode; |
| 802 | |
| 803 | /* completion variable for abortscan */ |
| 804 | struct completion abortscan_event_var; |
| 805 | |
| 806 | } hdd_scaninfo_t; |
| 807 | |
| 808 | #define WLAN_HDD_MAX_MC_ADDR_LIST 10 |
| 809 | |
| 810 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 811 | typedef struct multicast_addr_list { |
| 812 | uint8_t isFilterApplied; |
| 813 | uint8_t mc_cnt; |
| 814 | uint8_t addr[WLAN_HDD_MAX_MC_ADDR_LIST][ETH_ALEN]; |
| 815 | } t_multicast_add_list; |
| 816 | #endif |
| 817 | |
| 818 | #define WLAN_HDD_MAX_HISTORY_ENTRY 10 |
| 819 | |
| 820 | /** |
| 821 | * struct hdd_netif_queue_stats - netif queue operation statistics |
| 822 | * @pause_count - pause counter |
| 823 | * @unpause_count - unpause counter |
| 824 | */ |
| 825 | struct hdd_netif_queue_stats { |
| 826 | uint16_t pause_count; |
| 827 | uint16_t unpause_count; |
Nirav Shah | da00834 | 2016-05-17 18:50:40 +0530 | [diff] [blame] | 828 | qdf_time_t total_pause_time; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 829 | }; |
| 830 | |
| 831 | /** |
| 832 | * struct hdd_netif_queue_history - netif queue operation history |
| 833 | * @time: timestamp |
| 834 | * @netif_action: action type |
| 835 | * @netif_reason: reason type |
| 836 | * @pause_map: pause map |
| 837 | */ |
| 838 | struct hdd_netif_queue_history { |
Anurag Chouhan | 50220ce | 2016-02-18 20:11:33 +0530 | [diff] [blame] | 839 | qdf_time_t time; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 840 | uint16_t netif_action; |
| 841 | uint16_t netif_reason; |
| 842 | uint32_t pause_map; |
| 843 | }; |
| 844 | |
Manishekar Chandrasekaran | ec26759 | 2016-05-26 19:10:04 +0530 | [diff] [blame] | 845 | /** |
| 846 | * struct hdd_chan_change_params - channel related information |
| 847 | * @chan: operating channel |
| 848 | * @chan_params: channel parameters |
| 849 | */ |
| 850 | struct hdd_chan_change_params { |
| 851 | uint8_t chan; |
| 852 | struct ch_params_s chan_params; |
| 853 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 854 | |
| 855 | #define WLAN_HDD_ADAPTER_MAGIC 0x574c414e /* ASCII "WLAN" */ |
| 856 | |
| 857 | |
| 858 | struct hdd_adapter_s { |
Jeff Johnson | d399e90 | 2015-12-17 15:17:02 -0800 | [diff] [blame] | 859 | /* Magic cookie for adapter sanity verification. Note that this |
| 860 | * needs to be at the beginning of the private data structure so |
| 861 | * that it will exists at the beginning of dev->priv and hence |
| 862 | * will always be in mapped memory |
| 863 | */ |
| 864 | uint32_t magic; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 865 | |
Jeff Johnson | d399e90 | 2015-12-17 15:17:02 -0800 | [diff] [blame] | 866 | void *pHddCtx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 867 | |
| 868 | /** Handle to the network device */ |
| 869 | struct net_device *dev; |
| 870 | |
Krunal Soni | 276241e | 2016-03-10 12:58:11 -0800 | [diff] [blame] | 871 | enum tQDF_ADAPTER_MODE device_mode; |
Jeff Johnson | d399e90 | 2015-12-17 15:17:02 -0800 | [diff] [blame] | 872 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 873 | /** IPv4 notifier callback for handling ARP offload on change in IP */ |
| 874 | struct work_struct ipv4NotifierWorkQueue; |
| 875 | #ifdef WLAN_NS_OFFLOAD |
| 876 | /** IPv6 notifier callback for handling NS offload on change in IP */ |
| 877 | struct work_struct ipv6NotifierWorkQueue; |
| 878 | #endif |
| 879 | |
| 880 | /* TODO Move this to sta Ctx */ |
| 881 | struct wireless_dev wdev; |
| 882 | struct cfg80211_scan_request *request; |
| 883 | |
| 884 | /** ops checks if Opportunistic Power Save is Enable or Not |
| 885 | * ctw stores ctWindow value once we receive Opps command from |
| 886 | * wpa_supplicant then using ctWindow value we need to Enable |
| 887 | * Opportunistic Power Save |
| 888 | */ |
| 889 | uint8_t ops; |
| 890 | uint32_t ctw; |
| 891 | |
| 892 | /** Current MAC Address for the adapter */ |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 893 | struct qdf_mac_addr macAddressCurrent; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 894 | |
| 895 | /**Event Flags*/ |
| 896 | unsigned long event_flags; |
| 897 | |
| 898 | /**Device TX/RX statistics*/ |
| 899 | struct net_device_stats stats; |
| 900 | /** HDD statistics*/ |
| 901 | hdd_stats_t hdd_stats; |
| 902 | /** linkspeed statistics */ |
| 903 | tSirLinkSpeedInfo ls_stats; |
| 904 | /**Mib information*/ |
| 905 | sHddMib_t hdd_mib; |
| 906 | |
| 907 | uint8_t sessionId; |
| 908 | |
| 909 | /* Completion variable for session close */ |
| 910 | struct completion session_close_comp_var; |
| 911 | |
| 912 | /* Completion variable for session open */ |
| 913 | struct completion session_open_comp_var; |
| 914 | |
| 915 | /* TODO: move these to sta ctx. These may not be used in AP */ |
| 916 | /** completion variable for disconnect callback */ |
| 917 | struct completion disconnect_comp_var; |
| 918 | |
| 919 | /** Completion of change country code */ |
| 920 | struct completion change_country_code; |
| 921 | |
| 922 | /* completion variable for Linkup Event */ |
| 923 | struct completion linkup_event_var; |
| 924 | |
| 925 | /* completion variable for cancel remain on channel Event */ |
| 926 | struct completion cancel_rem_on_chan_var; |
| 927 | |
| 928 | /* completion variable for off channel remain on channel Event */ |
| 929 | struct completion offchannel_tx_event; |
| 930 | /* Completion variable for action frame */ |
| 931 | struct completion tx_action_cnf_event; |
| 932 | /* Completion variable for remain on channel ready */ |
| 933 | struct completion rem_on_chan_ready_event; |
| 934 | |
| 935 | struct completion sta_authorized_event; |
| 936 | #ifdef FEATURE_WLAN_TDLS |
| 937 | struct completion tdls_add_station_comp; |
| 938 | struct completion tdls_del_station_comp; |
| 939 | struct completion tdls_mgmt_comp; |
| 940 | struct completion tdls_link_establish_req_comp; |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 941 | QDF_STATUS tdlsAddStaStatus; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 942 | #endif |
| 943 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 944 | struct completion ibss_peer_info_comp; |
| 945 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 946 | /* Track whether the linkup handling is needed */ |
| 947 | bool isLinkUpSvcNeeded; |
| 948 | |
| 949 | /* Mgmt Frames TX completion status code */ |
| 950 | uint32_t mgmtTxCompletionStatus; |
| 951 | |
| 952 | /* WMM Status */ |
| 953 | hdd_wmm_status_t hddWmmStatus; |
| 954 | /************************************************************* |
| 955 | */ |
| 956 | /************************************************************* |
| 957 | * TODO - Remove it later |
| 958 | */ |
| 959 | /** Multiple station supports */ |
| 960 | /** Per-station structure */ |
| 961 | spinlock_t staInfo_lock; /* To protect access to station Info */ |
| 962 | hdd_station_info_t aStaInfo[WLAN_MAX_STA_COUNT]; |
| 963 | /* uint8_t uNumActiveStation; */ |
| 964 | |
| 965 | /************************************************************* |
| 966 | */ |
| 967 | |
| 968 | #ifdef FEATURE_WLAN_WAPI |
| 969 | hdd_wapi_info_t wapi_info; |
| 970 | #endif |
| 971 | |
| 972 | int8_t rssi; |
| 973 | #ifdef WLAN_FEATURE_LPSS |
| 974 | bool rssi_send; |
| 975 | #endif |
| 976 | |
| 977 | uint8_t snr; |
| 978 | |
| 979 | struct work_struct monTxWorkQueue; |
| 980 | struct sk_buff *skb_to_tx; |
| 981 | |
| 982 | union { |
| 983 | hdd_station_ctx_t station; |
| 984 | hdd_ap_ctx_t ap; |
| 985 | } sessionCtx; |
| 986 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 987 | #ifdef WLAN_FEATURE_TSF |
| 988 | /* tsf value received from firmware */ |
| 989 | uint32_t tsf_low; |
| 990 | uint32_t tsf_high; |
| 991 | /* TSF capture state */ |
| 992 | enum hdd_tsf_capture_state tsf_state; |
Manikandan Mohan | 5356c2b | 2016-04-03 15:51:35 -0700 | [diff] [blame] | 993 | uint64_t tsf_sync_soc_timer; |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 994 | #endif |
| 995 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 996 | hdd_cfg80211_state_t cfg80211State; |
| 997 | |
| 998 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 999 | t_multicast_add_list mc_addr_list; |
| 1000 | #endif |
| 1001 | uint8_t addr_filter_pattern; |
| 1002 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1003 | bool higherDtimTransition; |
| 1004 | bool survey_idx; |
| 1005 | |
| 1006 | hdd_scaninfo_t scan_info; |
Srinivas Girigowda | 515a9ef | 2015-12-11 11:00:48 -0800 | [diff] [blame] | 1007 | #ifdef FEATURE_WLAN_ESE |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1008 | tAniTrafStrmMetrics tsmStats; |
| 1009 | #endif |
| 1010 | /* Flag to ensure PSB is configured through framework */ |
| 1011 | uint8_t psbChanged; |
| 1012 | /* UAPSD psb value configured through framework */ |
| 1013 | uint8_t configuredPsb; |
| 1014 | #ifdef IPA_OFFLOAD |
| 1015 | void *ipa_context; |
| 1016 | #endif |
| 1017 | /* Use delayed work for Sec AP ACS as Pri AP Startup need to complete |
| 1018 | * since CSR (PMAC Struct) Config is same for both AP |
| 1019 | */ |
| 1020 | struct delayed_work acs_pending_work; |
| 1021 | |
| 1022 | struct work_struct scan_block_work; |
| 1023 | #ifdef MSM_PLATFORM |
| 1024 | unsigned long prev_rx_packets; |
| 1025 | unsigned long prev_tx_packets; |
Himanshu Agarwal | a6cedee | 2016-06-08 14:50:00 +0530 | [diff] [blame] | 1026 | uint64_t prev_fwd_tx_packets; |
| 1027 | uint64_t prev_fwd_rx_packets; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1028 | int connection; |
| 1029 | #endif |
| 1030 | bool is_roc_inprogress; |
| 1031 | |
| 1032 | #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 1033 | qdf_mc_timer_t tx_flow_control_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1034 | bool tx_flow_timer_initialized; |
| 1035 | unsigned int tx_flow_low_watermark; |
| 1036 | unsigned int tx_flow_high_watermark_offset; |
| 1037 | #endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */ |
| 1038 | bool offloads_configured; |
| 1039 | |
| 1040 | /* DSCP to UP QoS Mapping */ |
| 1041 | sme_QosWmmUpType hddWmmDscpToUpMap[WLAN_HDD_MAX_DSCP + 1]; |
| 1042 | |
| 1043 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
| 1044 | bool isLinkLayerStatsSet; |
| 1045 | #endif |
| 1046 | uint8_t linkStatus; |
| 1047 | |
| 1048 | /* variable for temperature in Celsius */ |
| 1049 | int temperature; |
| 1050 | |
| 1051 | /* Time stamp for last completed RoC request */ |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1052 | unsigned long last_roc_ts; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1053 | |
| 1054 | /* Time stamp for start RoC request */ |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1055 | unsigned long start_roc_ts; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1056 | |
| 1057 | /* State for synchronous OCB requests to WMI */ |
| 1058 | struct sir_ocb_set_config_response ocb_set_config_resp; |
| 1059 | struct sir_ocb_get_tsf_timer_response ocb_get_tsf_timer_resp; |
| 1060 | struct sir_dcc_get_stats_response *dcc_get_stats_resp; |
| 1061 | struct sir_dcc_update_ndl_response dcc_update_ndl_resp; |
| 1062 | |
| 1063 | /* MAC addresses used for OCB interfaces */ |
Agrawal Ashish | b141b09 | 2016-09-02 19:59:26 +0530 | [diff] [blame] | 1064 | #ifdef WLAN_FEATURE_DSRC |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1065 | struct qdf_mac_addr ocb_mac_address[QDF_MAX_CONCURRENCY_PERSONA]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1066 | int ocb_mac_addr_count; |
Agrawal Ashish | b141b09 | 2016-09-02 19:59:26 +0530 | [diff] [blame] | 1067 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1068 | |
| 1069 | /* BITMAP indicating pause reason */ |
| 1070 | uint32_t pause_map; |
| 1071 | spinlock_t pause_map_lock; |
Nirav Shah | 617cff9 | 2016-04-25 10:24:24 +0530 | [diff] [blame] | 1072 | qdf_time_t start_time; |
| 1073 | qdf_time_t last_time; |
| 1074 | qdf_time_t total_pause_time; |
| 1075 | qdf_time_t total_unpause_time; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1076 | uint8_t history_index; |
| 1077 | struct hdd_netif_queue_history |
| 1078 | queue_oper_history[WLAN_HDD_MAX_HISTORY_ENTRY]; |
| 1079 | struct hdd_netif_queue_stats queue_oper_stats[WLAN_REASON_TYPE_MAX]; |
| 1080 | struct hdd_lro_s lro_info; |
Dhanashri Atre | 168d2b4 | 2016-02-22 14:43:06 -0800 | [diff] [blame] | 1081 | ol_txrx_tx_fp tx_fn; |
Rajeev Kumar | dca5f81 | 2016-02-04 17:28:06 -0800 | [diff] [blame] | 1082 | /* debugfs entry */ |
| 1083 | struct dentry *debugfs_phy; |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 1084 | /* |
| 1085 | * The pre cac channel is saved here and will be used when the SAP's |
| 1086 | * channel needs to be moved from the existing 2.4GHz channel. |
| 1087 | */ |
| 1088 | uint8_t pre_cac_chan; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1089 | }; |
| 1090 | |
| 1091 | #define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station) |
| 1092 | #define WLAN_HDD_GET_AP_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap) |
| 1093 | #define WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.station.WextState) |
| 1094 | #define WLAN_HDD_GET_CTX(pAdapter) ((hdd_context_t *)pAdapter->pHddCtx) |
| 1095 | #define WLAN_HDD_GET_HAL_CTX(pAdapter) (((hdd_context_t *)(pAdapter->pHddCtx))->hHal) |
| 1096 | #define WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap.HostapdState) |
| 1097 | #define WLAN_HDD_GET_CFG_STATE_PTR(pAdapter) (&(pAdapter)->cfg80211State) |
| 1098 | #ifdef WLAN_FEATURE_MBSSID |
| 1099 | #define WLAN_HDD_GET_SAP_CTX_PTR(pAdapter) (pAdapter->sessionCtx.ap.sapContext) |
| 1100 | #endif |
| 1101 | #ifdef FEATURE_WLAN_TDLS |
| 1102 | #define WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter) \ |
Krunal Soni | 276241e | 2016-03-10 12:58:11 -0800 | [diff] [blame] | 1103 | (((QDF_STA_MODE != pAdapter->device_mode) && \ |
| 1104 | (QDF_P2P_CLIENT_MODE != pAdapter->device_mode)) ? 0 : 1) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1105 | #define WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter) \ |
| 1106 | ((WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter)) ? \ |
| 1107 | (tdlsCtx_t *)(pAdapter)->sessionCtx.station.pHddTdlsCtx : NULL) |
| 1108 | #endif |
| 1109 | |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 1110 | #ifdef WLAN_FEATURE_NAN_DATAPATH |
Deepak Dhamdhere | 8360d4c | 2016-06-01 13:24:31 -0700 | [diff] [blame] | 1111 | #define WLAN_HDD_GET_NDP_CTX_PTR(adapter) \ |
| 1112 | (&(adapter)->sessionCtx.station.ndp_ctx) |
Deepak Dhamdhere | 7e6016f | 2016-06-01 09:37:37 -0700 | [diff] [blame] | 1113 | #define WLAN_HDD_IS_NDP_ENABLED(hdd_ctx) ((hdd_ctx)->nan_datapath_enabled) |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 1114 | #else |
Deepak Dhamdhere | 8360d4c | 2016-06-01 13:24:31 -0700 | [diff] [blame] | 1115 | /* WLAN_HDD_GET_NDP_CTX_PTR and WLAN_HDD_GET_NDP_WEXT_STATE_PTR are not defined |
| 1116 | * intentionally so that all references to these must be within NDP code. |
| 1117 | * non-NDP code can call WLAN_HDD_IS_NDP_ENABLED(), and when it is enabled, |
| 1118 | * invoke NDP code to do all work. |
| 1119 | */ |
Deepak Dhamdhere | 7e6016f | 2016-06-01 09:37:37 -0700 | [diff] [blame] | 1120 | #define WLAN_HDD_IS_NDP_ENABLED(hdd_ctx) (false) |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 1121 | #endif |
| 1122 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1123 | /* Set mac address locally administered bit */ |
| 1124 | #define WLAN_HDD_RESET_LOCALLY_ADMINISTERED_BIT(macaddr) (macaddr[0] &= 0xFD) |
| 1125 | |
| 1126 | #define HDD_DEFAULT_MCC_P2P_QUOTA 70 |
| 1127 | #define HDD_RESET_MCC_P2P_QUOTA 50 |
| 1128 | |
| 1129 | typedef struct hdd_adapter_list_node { |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1130 | qdf_list_node_t node; /* MUST be first element */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1131 | hdd_adapter_t *pAdapter; |
| 1132 | } hdd_adapter_list_node_t; |
| 1133 | |
| 1134 | typedef struct hdd_priv_data_s { |
| 1135 | uint8_t *buf; |
| 1136 | int used_len; |
| 1137 | int total_len; |
| 1138 | } hdd_priv_data_t; |
| 1139 | |
| 1140 | #define MAX_MOD_LOGLEVEL 10 |
| 1141 | typedef struct { |
| 1142 | uint8_t enable; |
| 1143 | uint8_t dl_type; |
| 1144 | uint8_t dl_report; |
| 1145 | uint8_t dl_loglevel; |
| 1146 | uint8_t index; |
| 1147 | uint32_t dl_mod_loglevel[MAX_MOD_LOGLEVEL]; |
| 1148 | |
| 1149 | } fw_log_info; |
| 1150 | |
Archana Ramachandran | d41c3ed | 2016-02-10 15:48:06 -0800 | [diff] [blame] | 1151 | /** |
| 1152 | * enum antenna_mode - number of TX/RX chains |
| 1153 | * @HDD_ANTENNA_MODE_INVALID: Invalid mode place holder |
| 1154 | * @HDD_ANTENNA_MODE_1X1: Number of TX/RX chains equals 1 |
| 1155 | * @HDD_ANTENNA_MODE_2X2: Number of TX/RX chains equals 2 |
| 1156 | * @HDD_ANTENNA_MODE_MAX: Place holder for max mode |
| 1157 | */ |
| 1158 | enum antenna_mode { |
| 1159 | HDD_ANTENNA_MODE_INVALID, |
| 1160 | HDD_ANTENNA_MODE_1X1, |
| 1161 | HDD_ANTENNA_MODE_2X2, |
| 1162 | HDD_ANTENNA_MODE_MAX |
| 1163 | }; |
| 1164 | |
| 1165 | /** |
| 1166 | * enum smps_mode - SM power save mode |
| 1167 | * @HDD_SMPS_MODE_STATIC: Static power save |
| 1168 | * @HDD_SMPS_MODE_DYNAMIC: Dynamic power save |
| 1169 | * @HDD_SMPS_MODE_RESERVED: Reserved |
| 1170 | * @HDD_SMPS_MODE_DISABLED: Disable power save |
| 1171 | * @HDD_SMPS_MODE_MAX: Place holder for max mode |
| 1172 | */ |
| 1173 | enum smps_mode { |
| 1174 | HDD_SMPS_MODE_STATIC, |
| 1175 | HDD_SMPS_MODE_DYNAMIC, |
| 1176 | HDD_SMPS_MODE_RESERVED, |
| 1177 | HDD_SMPS_MODE_DISABLED, |
| 1178 | HDD_SMPS_MODE_MAX |
| 1179 | }; |
| 1180 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1181 | #ifdef WLAN_FEATURE_OFFLOAD_PACKETS |
| 1182 | /** |
| 1183 | * struct hdd_offloaded_packets - request id to pattern id mapping |
| 1184 | * @request_id: request id |
| 1185 | * @pattern_id: pattern id |
| 1186 | * |
| 1187 | */ |
| 1188 | struct hdd_offloaded_packets { |
| 1189 | uint32_t request_id; |
| 1190 | uint8_t pattern_id; |
| 1191 | }; |
| 1192 | |
| 1193 | /** |
| 1194 | * struct hdd_offloaded_packets_ctx - offloaded packets context |
| 1195 | * @op_table: request id to pattern id table |
| 1196 | * @op_lock: mutex lock |
| 1197 | */ |
| 1198 | struct hdd_offloaded_packets_ctx { |
| 1199 | struct hdd_offloaded_packets op_table[MAXNUM_PERIODIC_TX_PTRNS]; |
| 1200 | struct mutex op_lock; |
| 1201 | }; |
| 1202 | #endif |
| 1203 | |
Arun Khandavalli | 2476ef5 | 2016-04-26 20:19:43 +0530 | [diff] [blame] | 1204 | /** |
| 1205 | * struct hdd_bpf_context - hdd Context for bpf |
| 1206 | * @magic: magic number |
| 1207 | * @completion: Completion variable for BPF Get Capability |
| 1208 | * @capability_response: capabilities response received from fw |
| 1209 | */ |
| 1210 | struct hdd_bpf_context { |
| 1211 | unsigned int magic; |
| 1212 | struct completion completion; |
| 1213 | struct sir_bpf_get_offload capability_response; |
| 1214 | }; |
| 1215 | |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1216 | /** |
| 1217 | * enum driver_status: Driver Modules status |
| 1218 | * @DRIVER_MODULES_UNINITIALIZED: Driver CDS modules uninitialized |
| 1219 | * @DRIVER_MODULES_OPENED: Driver CDS modules opened |
| 1220 | * @DRIVER_MODULES_ENABLED: Driver CDS modules opened |
| 1221 | * @DRIVER_MODULES_CLOSED: Driver CDS modules closed |
| 1222 | */ |
| 1223 | enum driver_modules_status { |
| 1224 | DRIVER_MODULES_UNINITIALIZED, |
| 1225 | DRIVER_MODULES_OPENED, |
| 1226 | DRIVER_MODULES_ENABLED, |
| 1227 | DRIVER_MODULES_CLOSED |
| 1228 | }; |
| 1229 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1230 | /** Adapter structure definition */ |
| 1231 | |
| 1232 | struct hdd_context_s { |
| 1233 | /** Global CDS context */ |
| 1234 | v_CONTEXT_t pcds_context; |
| 1235 | |
| 1236 | /** HAL handle...*/ |
| 1237 | tHalHandle hHal; |
| 1238 | |
| 1239 | struct wiphy *wiphy; |
| 1240 | /* TODO Remove this from here. */ |
| 1241 | |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1242 | qdf_spinlock_t hdd_adapter_lock; |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1243 | qdf_list_t hddAdapters; /* List of adapters */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1244 | |
| 1245 | /* One per STA: 1 for BCMC_STA_ID, 1 for each SAP_SELF_STA_ID, 1 for WDS_STAID */ |
Anurag Chouhan | f04e84f | 2016-03-03 10:12:12 +0530 | [diff] [blame] | 1246 | hdd_adapter_t *sta_to_adapter[WLAN_MAX_STA_COUNT + QDF_MAX_NO_OF_SAP_MODE + 2]; /* One per sta. For quick reference. */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1247 | |
| 1248 | /** Pointer for firmware image data */ |
| 1249 | const struct firmware *fw; |
| 1250 | |
| 1251 | /** Pointer for configuration data */ |
| 1252 | const struct firmware *cfg; |
| 1253 | |
| 1254 | /** Pointer to the parent device */ |
| 1255 | struct device *parent_dev; |
| 1256 | |
| 1257 | /** Config values read from qcom_cfg.ini file */ |
| 1258 | struct hdd_config *config; |
| 1259 | |
| 1260 | struct wlan_hdd_ftm_status ftm; |
| 1261 | |
| 1262 | /* Completion variable to indicate Mc Thread Suspended */ |
| 1263 | struct completion mc_sus_event_var; |
| 1264 | |
| 1265 | struct completion reg_init; |
| 1266 | |
| 1267 | bool isMcThreadSuspended; |
| 1268 | |
| 1269 | #ifdef QCA_CONFIG_SMP |
| 1270 | bool is_ol_rx_thread_suspended; |
| 1271 | #endif |
| 1272 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1273 | /* Track whether Mcast/Bcast Filter is enabled. */ |
| 1274 | bool hdd_mcastbcast_filter_set; |
| 1275 | |
| 1276 | bool hdd_wlan_suspended; |
| 1277 | bool suspended; |
| 1278 | |
| 1279 | /* Lock to avoid race condition during start/stop bss */ |
| 1280 | struct mutex sap_lock; |
| 1281 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1282 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1283 | /* OEM App registered or not */ |
| 1284 | bool oem_app_registered; |
| 1285 | |
| 1286 | /* OEM App Process ID */ |
| 1287 | int32_t oem_pid; |
| 1288 | #endif |
| 1289 | |
| 1290 | /** Concurrency Parameters*/ |
| 1291 | uint32_t concurrency_mode; |
| 1292 | |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1293 | uint8_t no_of_open_sessions[QDF_MAX_NO_OF_MODE]; |
| 1294 | uint8_t no_of_active_sessions[QDF_MAX_NO_OF_MODE]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1295 | |
| 1296 | /** P2P Device MAC Address for the adapter */ |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1297 | struct qdf_mac_addr p2pDeviceAddress; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1298 | |
| 1299 | #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1300 | qdf_wake_lock_t rx_wake_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1301 | #endif |
| 1302 | |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1303 | qdf_wake_lock_t sap_wake_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1304 | |
| 1305 | #ifdef FEATURE_WLAN_TDLS |
| 1306 | eTDLSSupportMode tdls_mode; |
Kabilan Kannan | 163fd0b | 2016-06-08 15:21:51 -0700 | [diff] [blame] | 1307 | bool concurrency_marked; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1308 | eTDLSSupportMode tdls_mode_last; |
| 1309 | tdlsConnInfo_t tdlsConnInfo[HDD_MAX_NUM_TDLS_STA]; |
| 1310 | /* maximum TDLS station number allowed upon runtime condition */ |
| 1311 | uint16_t max_num_tdls_sta; |
| 1312 | /* TDLS peer connected count */ |
| 1313 | uint16_t connected_peer_count; |
| 1314 | tdls_scan_context_t tdls_scan_ctxt; |
| 1315 | /* Lock to avoid race condition during TDLS operations */ |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 1316 | qdf_spinlock_t tdls_ct_spinlock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1317 | struct mutex tdls_lock; |
| 1318 | uint8_t tdls_off_channel; |
| 1319 | uint16_t tdls_channel_offset; |
Masti, Narayanraddi | c4a7ab8 | 2015-11-25 15:41:10 +0530 | [diff] [blame] | 1320 | int32_t tdls_fw_off_chan_mode; |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 1321 | bool enable_tdls_connection_tracker; |
| 1322 | uint8_t tdls_external_peer_count; |
Archana Ramachandran | d5d2e92 | 2016-04-20 16:57:35 -0700 | [diff] [blame] | 1323 | bool tdls_nss_switch_in_progress; |
Kabilan Kannan | ff89f74 | 2016-08-15 18:14:10 -0700 | [diff] [blame] | 1324 | bool tdls_nss_teardown_complete; |
| 1325 | enum tdls_nss_transition_type tdls_nss_transition_mode; |
Archana Ramachandran | d5d2e92 | 2016-04-20 16:57:35 -0700 | [diff] [blame] | 1326 | int32_t tdls_teardown_peers_cnt; |
Kabilan Kannan | 163fd0b | 2016-06-08 15:21:51 -0700 | [diff] [blame] | 1327 | struct tdls_set_state_info set_state_info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1328 | #endif |
| 1329 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1330 | void *hdd_ipa; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1331 | |
| 1332 | /* MC/BC Filter state variable |
| 1333 | * This always contains the value that is currently |
| 1334 | * configured |
| 1335 | * */ |
| 1336 | uint8_t configuredMcastBcastFilter; |
| 1337 | |
| 1338 | uint8_t sus_res_mcastbcast_filter; |
| 1339 | |
| 1340 | bool sus_res_mcastbcast_filter_valid; |
| 1341 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1342 | /* Use below lock to protect access to isSchedScanUpdatePending |
| 1343 | * since it will be accessed in two different contexts. |
| 1344 | */ |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1345 | qdf_spinlock_t sched_scan_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1346 | |
| 1347 | /* Flag keeps track of wiphy suspend/resume */ |
| 1348 | bool isWiphySuspended; |
| 1349 | |
| 1350 | /* Indicates about pending sched_scan results */ |
| 1351 | bool isSchedScanUpdatePending; |
| 1352 | |
| 1353 | #ifdef MSM_PLATFORM |
| 1354 | /* DDR bus bandwidth compute timer |
| 1355 | */ |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 1356 | qdf_mc_timer_t bus_bw_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1357 | int cur_vote_level; |
| 1358 | spinlock_t bus_bw_lock; |
| 1359 | int cur_rx_level; |
| 1360 | uint64_t prev_rx; |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 1361 | int cur_tx_level; |
| 1362 | uint64_t prev_tx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1363 | #endif |
| 1364 | /* VHT80 allowed */ |
| 1365 | bool isVHT80Allowed; |
| 1366 | |
| 1367 | struct completion ready_to_suspend; |
| 1368 | /* defining the solution type */ |
| 1369 | uint32_t target_type; |
| 1370 | |
| 1371 | /* defining the firmware version */ |
| 1372 | uint32_t target_fw_version; |
Arif Hussain | 1969ec8 | 2016-07-08 10:37:01 -0700 | [diff] [blame] | 1373 | qdf_atomic_t dfs_radar_found; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1374 | |
| 1375 | /* defining the chip/rom version */ |
| 1376 | uint32_t target_hw_version; |
| 1377 | /* defining the chip/rom revision */ |
| 1378 | uint32_t target_hw_revision; |
| 1379 | /* chip/rom name */ |
| 1380 | const char *target_hw_name; |
| 1381 | struct regulatory reg; |
| 1382 | #ifdef FEATURE_WLAN_CH_AVOID |
| 1383 | uint16_t unsafe_channel_count; |
Amar Singhal | b8d4f15 | 2016-02-10 10:21:43 -0800 | [diff] [blame] | 1384 | uint16_t unsafe_channel_list[NUM_CHANNELS]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1385 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 1386 | |
| 1387 | uint8_t max_intf_count; |
| 1388 | uint8_t current_intf_count; |
| 1389 | #ifdef WLAN_FEATURE_LPSS |
| 1390 | uint8_t lpss_support; |
| 1391 | #endif |
| 1392 | uint8_t ap_arpns_support; |
| 1393 | tSirScanType ioctl_scan_mode; |
| 1394 | |
| 1395 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
Anurag Chouhan | 42958bb | 2016-02-19 15:43:11 +0530 | [diff] [blame] | 1396 | qdf_work_t sta_ap_intf_check_work; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1397 | #endif |
| 1398 | |
| 1399 | struct work_struct sap_start_work; |
| 1400 | bool is_sap_restart_required; |
| 1401 | bool is_sta_connection_pending; |
Manishekar Chandrasekaran | 7f63d05 | 2016-05-07 09:54:00 +0530 | [diff] [blame] | 1402 | qdf_spinlock_t sap_update_info_lock; |
| 1403 | qdf_spinlock_t sta_update_info_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1404 | |
| 1405 | uint8_t dev_dfs_cac_status; |
| 1406 | |
| 1407 | bool btCoexModeSet; |
| 1408 | #ifdef FEATURE_GREEN_AP |
| 1409 | struct hdd_green_ap_ctx *green_ap_ctx; |
| 1410 | #endif |
| 1411 | fw_log_info fw_log_settings; |
| 1412 | #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 1413 | qdf_mc_timer_t skip_acs_scan_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1414 | uint8_t skip_acs_scan_status; |
| 1415 | #endif |
| 1416 | |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1417 | qdf_wake_lock_t sap_dfs_wakelock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1418 | atomic_t sap_dfs_ref_cnt; |
| 1419 | |
| 1420 | #ifdef WLAN_FEATURE_EXTWOW_SUPPORT |
| 1421 | bool is_extwow_app_type1_param_set; |
| 1422 | bool is_extwow_app_type2_param_set; |
| 1423 | bool ext_wow_should_suspend; |
| 1424 | struct completion ready_to_extwow; |
| 1425 | #endif |
| 1426 | |
| 1427 | /* Time since boot up to extscan start (in micro seconds) */ |
| 1428 | uint64_t ext_scan_start_since_boot; |
| 1429 | unsigned long g_event_flags; |
| 1430 | /* RoC request queue and work */ |
| 1431 | struct delayed_work roc_req_work; |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1432 | qdf_spinlock_t hdd_roc_req_q_lock; |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1433 | qdf_list_t hdd_roc_req_q; |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1434 | qdf_spinlock_t hdd_scan_req_q_lock; |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1435 | qdf_list_t hdd_scan_req_q; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1436 | uint8_t miracast_value; |
Sravan Kumar Kairam | fece87f | 2016-07-26 14:58:28 +0530 | [diff] [blame] | 1437 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1438 | #ifdef WLAN_NS_OFFLOAD |
| 1439 | /* IPv6 notifier callback for handling NS offload on change in IP */ |
| 1440 | struct notifier_block ipv6_notifier; |
| 1441 | #endif |
Sravan Kumar Kairam | fece87f | 2016-07-26 14:58:28 +0530 | [diff] [blame] | 1442 | bool ns_offload_enable; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1443 | /* IPv4 notifier callback for handling ARP offload on change in IP */ |
| 1444 | struct notifier_block ipv4_notifier; |
| 1445 | |
| 1446 | /* number of rf chains supported by target */ |
| 1447 | uint32_t num_rf_chains; |
| 1448 | /* Is htTxSTBC supported by target */ |
| 1449 | uint8_t ht_tx_stbc_supported; |
| 1450 | #ifdef WLAN_FEATURE_OFFLOAD_PACKETS |
| 1451 | struct hdd_offloaded_packets_ctx op_ctx; |
| 1452 | #endif |
| 1453 | bool mcc_mode; |
| 1454 | #ifdef WLAN_FEATURE_MEMDUMP |
| 1455 | uint8_t *fw_dump_loc; |
| 1456 | uint32_t dump_loc_paddr; |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 1457 | qdf_mc_timer_t memdump_cleanup_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1458 | struct mutex memdump_lock; |
| 1459 | bool memdump_in_progress; |
Sachin Ahuja | 02dd2e7 | 2016-09-03 16:17:51 +0530 | [diff] [blame] | 1460 | bool memdump_init_done; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1461 | #endif /* WLAN_FEATURE_MEMDUMP */ |
| 1462 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1463 | bool connection_in_progress; |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1464 | qdf_spinlock_t connection_status_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1465 | |
| 1466 | uint16_t hdd_txrx_hist_idx; |
Nirav Shah | ed34b21 | 2016-04-25 10:59:16 +0530 | [diff] [blame] | 1467 | struct hdd_tx_rx_histogram *hdd_txrx_hist; |
Arif Hussain | 1969ec8 | 2016-07-08 10:37:01 -0700 | [diff] [blame] | 1468 | |
Krunal Soni | e353194 | 2016-04-12 17:43:53 -0700 | [diff] [blame] | 1469 | /* |
| 1470 | * place to store FTM capab of target. This allows changing of FTM capab |
| 1471 | * at runtime and intersecting it with target capab before updating. |
| 1472 | */ |
| 1473 | uint32_t fine_time_meas_cap_target; |
Ravi Joshi | b89e7f7 | 2016-09-07 13:43:15 -0700 | [diff] [blame^] | 1474 | uint32_t rx_high_ind_cnt; |
Archana Ramachandran | d41c3ed | 2016-02-10 15:48:06 -0800 | [diff] [blame] | 1475 | /* completion variable to indicate set antenna mode complete*/ |
| 1476 | struct completion set_antenna_mode_cmpl; |
| 1477 | /* Current number of TX X RX chains being used */ |
| 1478 | enum antenna_mode current_antenna_mode; |
Arun Khandavalli | 2476ef5 | 2016-04-26 20:19:43 +0530 | [diff] [blame] | 1479 | bool bpf_enabled; |
Ryan Hsu | ceddceb | 2016-04-28 10:20:14 -0700 | [diff] [blame] | 1480 | |
| 1481 | /* the radio index assigned by cnss_logger */ |
| 1482 | int radio_index; |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 1483 | qdf_work_t sap_pre_cac_work; |
Nirav Shah | ffc6a09 | 2016-06-09 16:09:08 +0530 | [diff] [blame] | 1484 | bool hbw_requested; |
Kapil Gupta | 0ed58dc | 2016-04-22 15:35:26 +0530 | [diff] [blame] | 1485 | uint32_t last_nil_scan_bug_report_timestamp; |
Deepak Dhamdhere | 7e6016f | 2016-06-01 09:37:37 -0700 | [diff] [blame] | 1486 | #ifdef WLAN_FEATURE_NAN_DATAPATH |
| 1487 | bool nan_datapath_enabled; |
| 1488 | #endif |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1489 | /* Present state of driver cds modules */ |
| 1490 | enum driver_modules_status driver_status; |
| 1491 | /* MC timer interface change */ |
| 1492 | qdf_mc_timer_t iface_change_timer; |
| 1493 | /* Interface change lock */ |
| 1494 | struct mutex iface_change_lock; |
Nirav Shah | bd36b06 | 2016-07-18 11:12:59 +0530 | [diff] [blame] | 1495 | bool rps; |
| 1496 | bool enableRxThread; |
| 1497 | bool napi_enable; |
Arun Khandavalli | a172c3e | 2016-08-26 17:33:13 +0530 | [diff] [blame] | 1498 | bool stop_modules_in_progress; |
| 1499 | bool start_modules_in_progress; |
Yuanyuan Liu | 245a3e4 | 2016-09-14 12:15:16 -0700 | [diff] [blame] | 1500 | bool update_mac_addr_to_fw; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1501 | }; |
| 1502 | |
| 1503 | /*--------------------------------------------------------------------------- |
| 1504 | Function declarations and documentation |
| 1505 | -------------------------------------------------------------------------*/ |
Chandrasekaran, Manishekar | 794a098 | 2016-01-12 19:42:20 +0530 | [diff] [blame] | 1506 | int hdd_validate_channel_and_bandwidth(hdd_adapter_t *adapter, |
| 1507 | uint32_t chan_number, |
Kiran Kumar Lokere | 1364467 | 2016-02-29 15:40:10 -0800 | [diff] [blame] | 1508 | enum phy_ch_width chan_bw); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1509 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
| 1510 | void wlan_hdd_check_sta_ap_concurrent_ch_intf(void *sta_pAdapter); |
| 1511 | #endif |
| 1512 | |
| 1513 | const char *hdd_device_mode_to_string(uint8_t device_mode); |
| 1514 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1515 | QDF_STATUS hdd_get_front_adapter(hdd_context_t *pHddCtx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1516 | hdd_adapter_list_node_t **ppAdapterNode); |
| 1517 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1518 | QDF_STATUS hdd_get_next_adapter(hdd_context_t *pHddCtx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1519 | hdd_adapter_list_node_t *pAdapterNode, |
| 1520 | hdd_adapter_list_node_t **pNextAdapterNode); |
| 1521 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1522 | QDF_STATUS hdd_remove_adapter(hdd_context_t *pHddCtx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1523 | hdd_adapter_list_node_t *pAdapterNode); |
| 1524 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1525 | QDF_STATUS hdd_remove_front_adapter(hdd_context_t *pHddCtx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1526 | hdd_adapter_list_node_t **ppAdapterNode); |
| 1527 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1528 | QDF_STATUS hdd_add_adapter_back(hdd_context_t *pHddCtx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1529 | hdd_adapter_list_node_t *pAdapterNode); |
| 1530 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1531 | QDF_STATUS hdd_add_adapter_front(hdd_context_t *pHddCtx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1532 | hdd_adapter_list_node_t *pAdapterNode); |
| 1533 | |
| 1534 | hdd_adapter_t *hdd_open_adapter(hdd_context_t *pHddCtx, uint8_t session_type, |
| 1535 | const char *name, tSirMacAddr macAddr, |
Ryan Hsu | 07495ea | 2016-01-21 15:25:39 -0800 | [diff] [blame] | 1536 | unsigned char name_assign_type, |
Prashanth Bhatta | 98f04d2 | 2016-01-08 16:46:21 -0800 | [diff] [blame] | 1537 | bool rtnl_held); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1538 | QDF_STATUS hdd_close_adapter(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, |
Prashanth Bhatta | 98f04d2 | 2016-01-08 16:46:21 -0800 | [diff] [blame] | 1539 | bool rtnl_held); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1540 | QDF_STATUS hdd_close_all_adapters(hdd_context_t *pHddCtx, bool rtnl_held); |
| 1541 | QDF_STATUS hdd_stop_all_adapters(hdd_context_t *pHddCtx); |
| 1542 | QDF_STATUS hdd_reset_all_adapters(hdd_context_t *pHddCtx); |
| 1543 | QDF_STATUS hdd_start_all_adapters(hdd_context_t *pHddCtx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1544 | hdd_adapter_t *hdd_get_adapter_by_vdev(hdd_context_t *pHddCtx, |
| 1545 | uint32_t vdev_id); |
| 1546 | hdd_adapter_t *hdd_get_adapter_by_macaddr(hdd_context_t *pHddCtx, |
| 1547 | tSirMacAddr macAddr); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1548 | QDF_STATUS hdd_init_station_mode(hdd_adapter_t *pAdapter); |
Krunal Soni | 276241e | 2016-03-10 12:58:11 -0800 | [diff] [blame] | 1549 | hdd_adapter_t *hdd_get_adapter(hdd_context_t *pHddCtx, |
| 1550 | enum tQDF_ADAPTER_MODE mode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1551 | void hdd_deinit_adapter(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, |
| 1552 | bool rtnl_held); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1553 | QDF_STATUS hdd_stop_adapter(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1554 | const bool bCloseSession); |
| 1555 | void hdd_set_station_ops(struct net_device *pWlanDev); |
| 1556 | uint8_t *wlan_hdd_get_intf_addr(hdd_context_t *pHddCtx); |
| 1557 | void wlan_hdd_release_intf_addr(hdd_context_t *pHddCtx, uint8_t *releaseAddr); |
Krunal Soni | 276241e | 2016-03-10 12:58:11 -0800 | [diff] [blame] | 1558 | uint8_t hdd_get_operating_channel(hdd_context_t *pHddCtx, |
| 1559 | enum tQDF_ADAPTER_MODE mode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1560 | |
Prashanth Bhatta | 05aaf01 | 2015-12-10 17:34:24 -0800 | [diff] [blame] | 1561 | void hdd_set_conparam(uint32_t con_param); |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1562 | enum tQDF_GLOBAL_CON_MODE hdd_get_conparam(void); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1563 | |
| 1564 | void hdd_abort_mac_scan(hdd_context_t *pHddCtx, uint8_t sessionId, |
| 1565 | eCsrAbortReason reason); |
| 1566 | void hdd_cleanup_actionframe(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter); |
| 1567 | |
| 1568 | void crda_regulatory_entry_default(uint8_t *countryCode, int domain_id); |
| 1569 | void wlan_hdd_reset_prob_rspies(hdd_adapter_t *pHostapdAdapter); |
| 1570 | void hdd_prevent_suspend(uint32_t reason); |
| 1571 | void hdd_allow_suspend(uint32_t reason); |
| 1572 | void hdd_prevent_suspend_timeout(uint32_t timeout, uint32_t reason); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1573 | |
| 1574 | void wlan_hdd_cfg80211_update_wiphy_caps(struct wiphy *wiphy); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1575 | QDF_STATUS hdd_set_ibss_power_save_params(hdd_adapter_t *pAdapter); |
| 1576 | QDF_STATUS wlan_hdd_restart_driver(hdd_context_t *pHddCtx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1577 | void hdd_exchange_version_and_caps(hdd_context_t *pHddCtx); |
| 1578 | int wlan_hdd_validate_context(hdd_context_t *pHddCtx); |
| 1579 | bool hdd_is_valid_mac_address(const uint8_t *pMacAddr); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1580 | QDF_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *pHddCtx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1581 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 1582 | struct qdf_mac_addr * |
| 1583 | hdd_wlan_get_ibss_mac_addr_from_staid(hdd_adapter_t *pAdapter, |
| 1584 | uint8_t staIdx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1585 | void hdd_checkandupdate_phymode(hdd_context_t *pHddCtx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1586 | #ifdef MSM_PLATFORM |
| 1587 | void hdd_start_bus_bw_compute_timer(hdd_adapter_t *pAdapter); |
| 1588 | void hdd_stop_bus_bw_compute_timer(hdd_adapter_t *pAdapter); |
| 1589 | #else |
| 1590 | static inline void hdd_start_bus_bw_compute_timer(hdd_adapter_t *pAdapter) |
| 1591 | { |
| 1592 | return; |
| 1593 | } |
| 1594 | |
| 1595 | static inline void hdd_stop_bus_bw_computer_timer(hdd_adapter_t *pAdapter) |
| 1596 | { |
| 1597 | return; |
| 1598 | } |
| 1599 | #endif |
| 1600 | |
Prashanth Bhatta | 5da711e | 2015-11-30 14:28:52 -0800 | [diff] [blame] | 1601 | int hdd_init(void); |
| 1602 | void hdd_deinit(void); |
| 1603 | |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1604 | int hdd_wlan_startup(struct device *dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1605 | void __hdd_wlan_exit(void); |
| 1606 | int hdd_wlan_notify_modem_power_state(int state); |
| 1607 | #ifdef QCA_HT_2040_COEX |
| 1608 | int hdd_wlan_set_ht2040_mode(hdd_adapter_t *pAdapter, uint16_t staId, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1609 | struct qdf_mac_addr macAddrSTA, int width); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1610 | #endif |
| 1611 | |
Kondabattini, Ganesh | 96ac37b | 2016-09-02 23:12:15 +0530 | [diff] [blame] | 1612 | void wlan_hdd_send_svc_nlink_msg(int radio, int type, void *data, int len); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1613 | #ifdef FEATURE_WLAN_AUTO_SHUTDOWN |
| 1614 | void wlan_hdd_auto_shutdown_enable(hdd_context_t *hdd_ctx, bool enable); |
| 1615 | #endif |
| 1616 | |
| 1617 | hdd_adapter_t *hdd_get_con_sap_adapter(hdd_adapter_t *this_sap_adapter, |
| 1618 | bool check_start_bss); |
| 1619 | |
| 1620 | bool hdd_is_5g_supported(hdd_context_t *pHddCtx); |
| 1621 | |
| 1622 | int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter); |
| 1623 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1624 | void hdd_get_fw_version(hdd_context_t *hdd_ctx, |
| 1625 | uint32_t *major_spid, uint32_t *minor_spid, |
| 1626 | uint32_t *siid, uint32_t *crmid); |
| 1627 | |
| 1628 | #ifdef WLAN_FEATURE_MEMDUMP |
| 1629 | /** |
| 1630 | * hdd_is_memdump_supported() - to check if memdump feature support |
| 1631 | * |
| 1632 | * This function is used to check if memdump feature is supported in |
| 1633 | * the host driver |
| 1634 | * |
| 1635 | * Return: true if supported and false otherwise |
| 1636 | */ |
| 1637 | static inline bool hdd_is_memdump_supported(void) |
| 1638 | { |
| 1639 | return true; |
| 1640 | } |
| 1641 | #else |
| 1642 | static inline bool hdd_is_memdump_supported(void) |
| 1643 | { |
| 1644 | return false; |
| 1645 | } |
| 1646 | #endif /* WLAN_FEATURE_MEMDUMP */ |
| 1647 | |
| 1648 | void hdd_update_macaddr(struct hdd_config *config, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1649 | struct qdf_mac_addr hw_macaddr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1650 | void wlan_hdd_disable_roaming(hdd_adapter_t *pAdapter); |
| 1651 | void wlan_hdd_enable_roaming(hdd_adapter_t *pAdapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1652 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1653 | QDF_STATUS hdd_post_cds_enable_config(hdd_context_t *pHddCtx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1654 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1655 | QDF_STATUS hdd_abort_mac_scan_all_adapters(hdd_context_t *hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1656 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1657 | QDF_STATUS wlan_hdd_check_custom_con_channel_rules(hdd_adapter_t *sta_adapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1658 | hdd_adapter_t *ap_adapter, |
| 1659 | tCsrRoamProfile *roam_profile, |
| 1660 | tScanResultHandle *scan_cache, |
| 1661 | bool *concurrent_chnl_same); |
| 1662 | #ifdef WLAN_FEATURE_MBSSID |
| 1663 | void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter); |
| 1664 | void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter); |
| 1665 | #else |
| 1666 | static inline void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter) {} |
| 1667 | static inline void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter) {} |
| 1668 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1669 | |
Archana Ramachandran | d41c3ed | 2016-02-10 15:48:06 -0800 | [diff] [blame] | 1670 | void wlan_hdd_soc_set_antenna_mode_cb(enum set_antenna_mode_status status); |
| 1671 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1672 | #ifdef QCA_CONFIG_SMP |
| 1673 | int wlan_hdd_get_cpu(void); |
| 1674 | #else |
| 1675 | static inline int wlan_hdd_get_cpu(void) |
| 1676 | { |
| 1677 | return 0; |
| 1678 | } |
| 1679 | #endif |
| 1680 | |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 1681 | void wlan_hdd_sap_pre_cac_failure(void *data); |
| 1682 | void hdd_clean_up_pre_cac_interface(hdd_context_t *hdd_ctx); |
| 1683 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1684 | void wlan_hdd_txrx_pause_cb(uint8_t vdev_id, |
| 1685 | enum netif_action_type action, enum netif_reason_type reason); |
| 1686 | |
| 1687 | void hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value); |
Nirav Shah | ed34b21 | 2016-04-25 10:59:16 +0530 | [diff] [blame] | 1688 | int wlan_hdd_init_tx_rx_histogram(hdd_context_t *hdd_ctx); |
| 1689 | void wlan_hdd_deinit_tx_rx_histogram(hdd_context_t *hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1690 | void wlan_hdd_display_tx_rx_histogram(hdd_context_t *pHddCtx); |
| 1691 | void wlan_hdd_clear_tx_rx_histogram(hdd_context_t *pHddCtx); |
| 1692 | void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx); |
| 1693 | void wlan_hdd_clear_netif_queue_history(hdd_context_t *hdd_ctx); |
| 1694 | const char *hdd_get_fwpath(void); |
Abhishek Singh | 7996eb7 | 2015-12-30 17:24:02 +0530 | [diff] [blame] | 1695 | void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind); |
| 1696 | hdd_adapter_t *hdd_get_adapter_by_sme_session_id(hdd_context_t *hdd_ctx, |
| 1697 | uint32_t sme_session_id); |
Kiran Kumar Lokere | 1364467 | 2016-02-29 15:40:10 -0800 | [diff] [blame] | 1698 | enum phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width); |
Masti, Narayanraddi | c4a7ab8 | 2015-11-25 15:41:10 +0530 | [diff] [blame] | 1699 | uint8_t wlan_hdd_find_opclass(tHalHandle hal, uint8_t channel, |
| 1700 | uint8_t bw_offset); |
Arun Khandavalli | c811dcc | 2016-06-26 07:37:21 +0530 | [diff] [blame] | 1701 | int hdd_update_config(hdd_context_t *hdd_ctx); |
Dhanashri Atre | 83d373d | 2015-07-28 16:45:59 -0700 | [diff] [blame] | 1702 | |
Manishekar Chandrasekaran | cb05217 | 2016-04-22 12:19:04 +0530 | [diff] [blame] | 1703 | QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *adapter, |
Manishekar Chandrasekaran | ec26759 | 2016-05-26 19:10:04 +0530 | [diff] [blame] | 1704 | struct net_device *dev, |
| 1705 | struct hdd_chan_change_params chan_change); |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 1706 | int wlan_hdd_set_channel(struct wiphy *wiphy, |
| 1707 | struct net_device *dev, |
| 1708 | struct cfg80211_chan_def *chandef, |
| 1709 | enum nl80211_channel_type channel_type); |
| 1710 | int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, |
| 1711 | struct cfg80211_beacon_data *params, |
| 1712 | const u8 *ssid, size_t ssid_len, |
| 1713 | enum nl80211_hidden_ssid hidden_ssid, |
| 1714 | bool check_for_concurrency); |
Chandrasekaran Manishekar | cde33d7 | 2016-04-14 19:03:39 +0530 | [diff] [blame] | 1715 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
| 1716 | QDF_STATUS hdd_register_for_sap_restart_with_channel_switch(void); |
| 1717 | #else |
| 1718 | static inline QDF_STATUS hdd_register_for_sap_restart_with_channel_switch(void) |
| 1719 | { |
Krunal Soni | 276241e | 2016-03-10 12:58:11 -0800 | [diff] [blame] | 1720 | return QDF_STATUS_SUCCESS; |
Chandrasekaran Manishekar | cde33d7 | 2016-04-14 19:03:39 +0530 | [diff] [blame] | 1721 | } |
| 1722 | #endif |
| 1723 | |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 1724 | #if !defined(REMOVE_PKT_LOG) |
| 1725 | int hdd_process_pktlog_command(hdd_context_t *hdd_ctx, uint32_t set_value); |
| 1726 | int hdd_pktlog_enable_disable(hdd_context_t *hdd_ctx, bool enable, uint8_t); |
| 1727 | #else |
| 1728 | int hdd_pktlog_enable_disable(hdd_context_t *hdd_ctx, bool enable, uint8_t) |
| 1729 | { |
| 1730 | return 0; |
| 1731 | } |
| 1732 | int hdd_process_pktlog_command(hdd_context_t *hdd_ctx, uint32_t set_value) |
| 1733 | { |
| 1734 | return 0; |
| 1735 | } |
| 1736 | #endif /* REMOVE_PKT_LOG */ |
| 1737 | |
Dhanashri Atre | 83d373d | 2015-07-28 16:45:59 -0700 | [diff] [blame] | 1738 | #ifdef FEATURE_TSO |
| 1739 | /** |
| 1740 | * hdd_set_tso_flags() - enable TSO flags in the network device |
| 1741 | * @hdd_ctx: HDD context |
| 1742 | * @wlan_dev: network device structure |
| 1743 | * |
| 1744 | * This function enables the TSO related feature flags in the |
| 1745 | * given network device. |
| 1746 | * |
| 1747 | * Return: none |
| 1748 | */ |
| 1749 | static inline void hdd_set_tso_flags(hdd_context_t *hdd_ctx, |
| 1750 | struct net_device *wlan_dev) |
| 1751 | { |
| 1752 | if (hdd_ctx->config->tso_enable) { |
| 1753 | hdd_info("TSO Enabled"); |
| 1754 | wlan_dev->features |= |
| 1755 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
| 1756 | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG; |
| 1757 | } |
| 1758 | } |
| 1759 | #else |
| 1760 | static inline void hdd_set_tso_flags(hdd_context_t *hdd_ctx, |
| 1761 | struct net_device *wlan_dev){} |
| 1762 | #endif /* FEATURE_TSO */ |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 1763 | |
Agrawal Ashish | c9ddbab | 2016-05-25 12:04:47 +0530 | [diff] [blame] | 1764 | #if defined(FEATURE_WLAN_MCC_TO_SCC_SWITCH) || \ |
| 1765 | defined(FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE) |
| 1766 | void wlan_hdd_restart_sap(hdd_adapter_t *ap_adapter); |
| 1767 | #else |
| 1768 | static inline void wlan_hdd_restart_sap(hdd_adapter_t *ap_adapter) |
| 1769 | { |
| 1770 | } |
| 1771 | #endif |
| 1772 | |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 1773 | #ifdef WLAN_FEATURE_ROAM_OFFLOAD |
Varun Reddy Yeturu | d351a6c | 2016-03-16 14:01:00 -0700 | [diff] [blame] | 1774 | static inline bool roaming_offload_enabled(hdd_context_t *hdd_ctx) |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 1775 | { |
| 1776 | return hdd_ctx->config->isRoamOffloadEnabled; |
| 1777 | } |
| 1778 | #else |
Varun Reddy Yeturu | d351a6c | 2016-03-16 14:01:00 -0700 | [diff] [blame] | 1779 | static inline bool roaming_offload_enabled(hdd_context_t *hdd_ctx) |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 1780 | { |
| 1781 | return false; |
| 1782 | } |
| 1783 | #endif |
| 1784 | |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 1785 | void hdd_get_ibss_peer_info_cb(void *pUserData, |
| 1786 | tSirPeerInfoRspParams *pPeerInfo); |
| 1787 | |
Ryan Hsu | ceddceb | 2016-04-28 10:20:14 -0700 | [diff] [blame] | 1788 | #ifdef CONFIG_CNSS_LOGGER |
| 1789 | /** |
| 1790 | * wlan_hdd_nl_init() - wrapper function to CNSS_LOGGER case |
| 1791 | * @hdd_ctx: the hdd context pointer |
| 1792 | * |
| 1793 | * The nl_srv_init() will call to cnss_logger_device_register() and |
| 1794 | * expect to get a radio_index from cnss_logger module and assign to |
| 1795 | * hdd_ctx->radio_index, then to maintain the consistency to original |
| 1796 | * design, adding the radio_index check here, then return the error |
| 1797 | * code if radio_index is not assigned correctly, which means the nl_init |
| 1798 | * from cnss_logger is failed. |
| 1799 | * |
| 1800 | * Return: 0 if successfully, otherwise error code |
| 1801 | */ |
| 1802 | static inline int wlan_hdd_nl_init(hdd_context_t *hdd_ctx) |
| 1803 | { |
| 1804 | hdd_ctx->radio_index = nl_srv_init(hdd_ctx->wiphy); |
| 1805 | |
| 1806 | /* radio_index is assigned from 0, so only >=0 will be valid index */ |
| 1807 | if (hdd_ctx->radio_index >= 0) |
| 1808 | return 0; |
| 1809 | else |
| 1810 | return -EINVAL; |
| 1811 | } |
| 1812 | #else |
| 1813 | /** |
| 1814 | * wlan_hdd_nl_init() - wrapper function to non CNSS_LOGGER case |
| 1815 | * @hdd_ctx: the hdd context pointer |
| 1816 | * |
| 1817 | * In case of non CNSS_LOGGER case, the nl_srv_init() will initialize |
| 1818 | * the netlink socket and return the success or not. |
| 1819 | * |
| 1820 | * Return: the return value from nl_srv_init() |
| 1821 | */ |
| 1822 | static inline int wlan_hdd_nl_init(hdd_context_t *hdd_ctx) |
| 1823 | { |
| 1824 | return nl_srv_init(hdd_ctx->wiphy); |
| 1825 | } |
| 1826 | #endif |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 1827 | QDF_STATUS hdd_sme_close_session_callback(void *pContext); |
| 1828 | |
Varun Reddy Yeturu | 3e91dad | 2016-07-18 15:58:47 -0700 | [diff] [blame] | 1829 | int hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid, |
| 1830 | const uint8_t channel, const handoff_src src); |
| 1831 | |
Arun Khandavalli | 4b55da7 | 2016-07-19 19:55:01 +0530 | [diff] [blame] | 1832 | int hdd_register_cb(hdd_context_t *hdd_ctx); |
| 1833 | void hdd_deregister_cb(hdd_context_t *hdd_ctx); |
Arun Khandavalli | 7e857c3 | 2016-06-26 12:07:16 +0530 | [diff] [blame] | 1834 | int hdd_start_station_adapter(hdd_adapter_t *adapter); |
| 1835 | int hdd_start_ap_adapter(hdd_adapter_t *adapter); |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1836 | int hdd_configure_cds(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter); |
Arun Khandavalli | 7e857c3 | 2016-06-26 12:07:16 +0530 | [diff] [blame] | 1837 | int hdd_start_ftm_adapter(hdd_adapter_t *adapter); |
Arun Khandavalli | 2358d52 | 2016-05-16 18:05:37 +0530 | [diff] [blame] | 1838 | int hdd_set_fw_params(hdd_adapter_t *adapter); |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1839 | int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, |
| 1840 | bool reinit); |
| 1841 | int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx, bool shutdown); |
| 1842 | int hdd_start_adapter(hdd_adapter_t *adapter); |
Anurag Chouhan | c409292 | 2016-09-08 15:56:11 +0530 | [diff] [blame] | 1843 | void hdd_connect_result(struct net_device *dev, const u8 *bssid, |
| 1844 | tCsrRoamInfo *roam_info, const u8 *req_ie, |
| 1845 | size_t req_ie_len, const u8 *resp_ie, |
Abhishek Singh | a84d395 | 2016-09-13 13:45:05 +0530 | [diff] [blame] | 1846 | size_t resp_ie_len, u16 status, gfp_t gfp, |
| 1847 | bool connect_timeout); |
Anurag Chouhan | c409292 | 2016-09-08 15:56:11 +0530 | [diff] [blame] | 1848 | |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1849 | #ifdef WLAN_FEATURE_FASTPATH |
| 1850 | void hdd_enable_fastpath(struct hdd_config *hdd_cfg, |
| 1851 | void *context); |
| 1852 | #else |
| 1853 | static inline void hdd_enable_fastpath(struct hdd_config *hdd_cfg, |
| 1854 | void *context) |
| 1855 | { |
| 1856 | } |
| 1857 | #endif |
| 1858 | void hdd_wlan_update_target_info(hdd_context_t *hdd_ctx, void *context); |
Srinivas Girigowda | d9e6f7b | 2016-02-01 19:37:52 -0800 | [diff] [blame] | 1859 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1860 | #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ |