Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Selvaraj, Sridhar | 0672a12 | 2016-12-29 16:11:48 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2017 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 |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 30 | /** |
| 31 | * DOC: wlan_hdd_main.h |
| 32 | * |
| 33 | * Linux HDD Adapter Type |
| 34 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 35 | |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 36 | /* |
| 37 | * Include files |
| 38 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 39 | |
| 40 | #include <linux/netdevice.h> |
| 41 | #include <linux/skbuff.h> |
| 42 | #include <net/cfg80211.h> |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 43 | #include <qdf_list.h> |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 44 | #include <qdf_types.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 45 | #include "sir_mac_prot_def.h" |
| 46 | #include "csr_api.h" |
| 47 | #include <wlan_hdd_assoc.h> |
| 48 | #include <wlan_hdd_wmm.h> |
| 49 | #include <wlan_hdd_cfg.h> |
| 50 | #include <linux/spinlock.h> |
| 51 | #if defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK) |
| 52 | #include <linux/wakelock.h> |
| 53 | #endif |
| 54 | #include <wlan_hdd_ftm.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 55 | #include "wlan_hdd_tdls.h" |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 56 | #include "wlan_hdd_tsf.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 57 | #include "wlan_hdd_cfg80211.h" |
Anurag Chouhan | 42958bb | 2016-02-19 15:43:11 +0530 | [diff] [blame] | 58 | #include <qdf_defer.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 59 | #include "sap_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 60 | #include <wlan_hdd_lro.h> |
Dhanashri Atre | b08959a | 2016-03-01 17:28:03 -0800 | [diff] [blame] | 61 | #include "cdp_txrx_flow_ctrl_legacy.h" |
Manjunathappa Prakash | 3454fd6 | 2016-04-01 08:52:06 -0700 | [diff] [blame] | 62 | #include <cdp_txrx_peer_ops.h> |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 63 | #include "wlan_hdd_nan_datapath.h" |
hqu | 6153382 | 2017-06-20 15:04:05 +0800 | [diff] [blame] | 64 | #if defined(CONFIG_HL_SUPPORT) |
| 65 | #include "wlan_tgt_def_config_hl.h" |
| 66 | #else |
Dustin Brown | 6126946 | 2016-09-19 13:25:45 -0700 | [diff] [blame] | 67 | #include "wlan_tgt_def_config.h" |
hqu | 6153382 | 2017-06-20 15:04:05 +0800 | [diff] [blame] | 68 | #endif |
Selvaraj, Sridhar | 0672a12 | 2016-12-29 16:11:48 +0530 | [diff] [blame] | 69 | #include <wlan_objmgr_cmn.h> |
| 70 | #include <wlan_objmgr_global_obj.h> |
| 71 | #include <wlan_objmgr_psoc_obj.h> |
| 72 | #include <wlan_objmgr_pdev_obj.h> |
| 73 | #include <wlan_objmgr_vdev_obj.h> |
| 74 | #include <wlan_objmgr_peer_obj.h> |
Mukul Sharma | 9d797a0 | 2017-01-05 20:26:03 +0530 | [diff] [blame] | 75 | #include "wlan_pmo_ucfg_api.h" |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 76 | #ifdef WIFI_POS_CONVERGED |
| 77 | #include "os_if_wifi_pos.h" |
| 78 | #include "wifi_pos_api.h" |
| 79 | #else |
| 80 | #include "wlan_hdd_oemdata.h" |
| 81 | #endif |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 82 | #include "wlan_hdd_he.h" |
| 83 | |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 84 | /* |
| 85 | * Preprocessor definitions and constants |
| 86 | */ |
| 87 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 88 | /** Number of Tx Queues */ |
| 89 | #ifdef QCA_LL_TX_FLOW_CONTROL_V2 |
| 90 | #define NUM_TX_QUEUES 5 |
| 91 | #else |
| 92 | #define NUM_TX_QUEUES 4 |
| 93 | #endif |
Mohit Khanna | ee9e80f | 2015-11-10 11:32:49 -0800 | [diff] [blame] | 94 | |
| 95 | /** Length of the TX queue for the netdev */ |
| 96 | #define HDD_NETDEV_TX_QUEUE_LEN (3000) |
| 97 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 98 | /** Hdd Tx Time out value */ |
| 99 | #ifdef LIBRA_LINUX_PC |
| 100 | #define HDD_TX_TIMEOUT (8000) |
| 101 | #else |
| 102 | #define HDD_TX_TIMEOUT msecs_to_jiffies(5000) |
| 103 | #endif |
| 104 | /** Hdd Default MTU */ |
| 105 | #define HDD_DEFAULT_MTU (1500) |
| 106 | |
| 107 | #ifdef QCA_CONFIG_SMP |
| 108 | #define NUM_CPUS NR_CPUS |
| 109 | #else |
| 110 | #define NUM_CPUS 1 |
| 111 | #endif |
| 112 | |
| 113 | /**event flags registered net device*/ |
| 114 | #define NET_DEVICE_REGISTERED (0) |
| 115 | #define SME_SESSION_OPENED (1) |
| 116 | #define INIT_TX_RX_SUCCESS (2) |
| 117 | #define WMM_INIT_DONE (3) |
| 118 | #define SOFTAP_BSS_STARTED (4) |
| 119 | #define DEVICE_IFACE_OPENED (5) |
| 120 | #define TDLS_INIT_DONE (6) |
| 121 | #define ACS_PENDING (7) |
Manikandan Mohan | 0a0ac95 | 2017-02-16 15:49:31 -0800 | [diff] [blame] | 122 | #define SOFTAP_INIT_DONE (8) |
| 123 | |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 124 | /* Waiting for event for vendor acs */ |
| 125 | #define VENDOR_ACS_RESPONSE_PENDING (8) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 126 | |
| 127 | /* HDD global event flags */ |
| 128 | #define ACS_IN_PROGRESS (0) |
| 129 | |
| 130 | /** Maximum time(ms)to wait for disconnect to complete **/ |
| 131 | #ifdef QCA_WIFI_3_0_EMU |
Abhishek Singh | 5a33171 | 2016-08-08 18:10:20 +0530 | [diff] [blame] | 132 | #define WLAN_WAIT_TIME_DISCONNECT 5000 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 133 | #else |
Abhishek Singh | 5a33171 | 2016-08-08 18:10:20 +0530 | [diff] [blame] | 134 | #define WLAN_WAIT_TIME_DISCONNECT 5000 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 135 | #endif |
Abhishek Singh | 533c9da | 2017-05-04 10:23:34 +0530 | [diff] [blame] | 136 | #define WLAN_WAIT_TIME_STOP_ROAM 4000 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 137 | #define WLAN_WAIT_TIME_STATS 800 |
| 138 | #define WLAN_WAIT_TIME_POWER 800 |
| 139 | #define WLAN_WAIT_TIME_COUNTRY 1000 |
| 140 | #define WLAN_WAIT_TIME_LINK_STATUS 800 |
Sridhar Selvaraj | dc400d2 | 2016-10-18 17:18:03 +0530 | [diff] [blame] | 141 | #define WLAN_WAIT_TIME_POWER_STATS 800 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 142 | /* Amount of time to wait for sme close session callback. |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 143 | * This value should be larger than the timeout used by WDI to wait for |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 144 | * a response from WCNSS |
| 145 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 146 | #define WLAN_WAIT_TIME_SESSIONOPENCLOSE 15000 |
| 147 | #define WLAN_WAIT_TIME_ABORTSCAN 2000 |
| 148 | |
| 149 | /** Maximum time(ms) to wait for mc thread suspend **/ |
| 150 | #define WLAN_WAIT_TIME_MCTHREAD_SUSPEND 1200 |
| 151 | |
| 152 | /** Maximum time(ms) to wait for target to be ready for suspend **/ |
| 153 | #define WLAN_WAIT_TIME_READY_TO_SUSPEND 2000 |
| 154 | |
| 155 | /** Maximum time(ms) to wait for tdls add sta to complete **/ |
| 156 | #define WAIT_TIME_TDLS_ADD_STA 1500 |
| 157 | |
| 158 | /** Maximum time(ms) to wait for tdls del sta to complete **/ |
| 159 | #define WAIT_TIME_TDLS_DEL_STA 1500 |
| 160 | |
| 161 | /** Maximum time(ms) to wait for Link Establish Req to complete **/ |
| 162 | #define WAIT_TIME_TDLS_LINK_ESTABLISH_REQ 1500 |
| 163 | |
| 164 | /** Maximum time(ms) to wait for tdls mgmt to complete **/ |
| 165 | #define WAIT_TIME_TDLS_MGMT 11000 |
| 166 | |
| 167 | /* Scan Req Timeout */ |
| 168 | #define WLAN_WAIT_TIME_SCAN_REQ 100 |
| 169 | |
Archana Ramachandran | d41c3ed | 2016-02-10 15:48:06 -0800 | [diff] [blame] | 170 | #define WLAN_WAIT_TIME_ANTENNA_MODE_REQ 3000 |
| 171 | #define WLAN_WAIT_TIME_SET_DUAL_MAC_CFG 1500 |
| 172 | |
Arun Khandavalli | 2476ef5 | 2016-04-26 20:19:43 +0530 | [diff] [blame] | 173 | #define WLAN_WAIT_TIME_BPF 1000 |
| 174 | |
Sreelakshmi Konamki | 88a2a41 | 2017-04-14 15:11:55 +0530 | [diff] [blame] | 175 | /* Maximum time(ms) to wait for RSO CMD status event */ |
| 176 | #define WAIT_TIME_RSO_CMD_STATUS 2000 |
| 177 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 178 | #define MAX_NUMBER_OF_ADAPTERS 4 |
| 179 | |
| 180 | #define MAX_CFG_STRING_LEN 255 |
| 181 | |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 182 | /* Maximum time(ms) to wait for external acs response */ |
| 183 | #define WLAN_VENDOR_ACS_WAIT_TIME 1000 |
| 184 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 185 | #define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] |
| 186 | /** Mac Address string **/ |
| 187 | #define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x" |
| 188 | #define MAC_ADDRESS_STR_LEN 18 /* Including null terminator */ |
Rajeev Kumar | 67f5b87 | 2017-06-06 13:26:57 -0700 | [diff] [blame] | 189 | /* Max and min IEs length in bytes */ |
| 190 | #define MAX_GENIE_LEN (512) |
| 191 | #define MIN_GENIE_LEN (2) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 192 | |
| 193 | #define WLAN_CHIP_VERSION "WCNSS" |
| 194 | |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 195 | #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] | 196 | #define hdd_logfl(level, format, args...) hdd_log(level, FL(format), ## args) |
| 197 | |
| 198 | #define hdd_alert(format, args...) \ |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 199 | hdd_logfl(QDF_TRACE_LEVEL_FATAL, format, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 200 | #define hdd_err(format, args...) \ |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 201 | hdd_logfl(QDF_TRACE_LEVEL_ERROR, format, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 202 | #define hdd_warn(format, args...) \ |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 203 | hdd_logfl(QDF_TRACE_LEVEL_WARN, format, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 204 | #define hdd_notice(format, args...) \ |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 205 | hdd_logfl(QDF_TRACE_LEVEL_INFO, format, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 206 | #define hdd_info(format, args...) \ |
Srinivas Girigowda | 67044ad | 2017-03-30 21:23:51 -0700 | [diff] [blame] | 207 | hdd_logfl(QDF_TRACE_LEVEL_INFO, format, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 208 | #define hdd_debug(format, args...) \ |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 209 | hdd_logfl(QDF_TRACE_LEVEL_DEBUG, format, ## args) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 210 | |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 211 | #define ENTER() hdd_logfl(QDF_TRACE_LEVEL_INFO_LOW, "enter") |
Jeff Johnson | 398b3d6 | 2016-02-10 17:19:39 -0800 | [diff] [blame] | 212 | #define ENTER_DEV(dev) \ |
| 213 | hdd_logfl(QDF_TRACE_LEVEL_INFO_LOW, "enter(%s)", (dev)->name) |
Anurag Chouhan | b2dc16f | 2016-02-25 11:47:37 +0530 | [diff] [blame] | 214 | #define EXIT() hdd_logfl(QDF_TRACE_LEVEL_INFO_LOW, "exit") |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 215 | |
| 216 | #define WLAN_HDD_GET_PRIV_PTR(__dev__) (hdd_adapter_t *)(netdev_priv((__dev__))) |
| 217 | |
| 218 | #define MAX_NO_OF_2_4_CHANNELS 14 |
| 219 | |
| 220 | #define WLAN_HDD_PUBLIC_ACTION_FRAME 4 |
| 221 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET 24 |
| 222 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET 24 |
| 223 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET 30 |
| 224 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_CATEGORY_OFFSET 0 |
| 225 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_ACTION_OFFSET 1 |
| 226 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_OFFSET 2 |
| 227 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_TYPE_OFFSET 5 |
| 228 | #define WLAN_HDD_VENDOR_SPECIFIC_ACTION 0x09 |
| 229 | #define WLAN_HDD_WFA_OUI 0x506F9A |
| 230 | #define WLAN_HDD_WFA_P2P_OUI_TYPE 0x09 |
| 231 | #define WLAN_HDD_P2P_SOCIAL_CHANNELS 3 |
| 232 | #define WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN 1 |
| 233 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_SUB_TYPE_OFFSET 6 |
| 234 | |
| 235 | #define WLAN_HDD_IS_SOCIAL_CHANNEL(center_freq) \ |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 236 | (((center_freq) == 2412) || ((center_freq) == 2437) || \ |
| 237 | ((center_freq) == 2462)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 238 | |
| 239 | #define WLAN_HDD_CHANNEL_IN_UNII_1_BAND(center_freq) \ |
| 240 | (((center_freq) == 5180) || ((center_freq) == 5200) \ |
| 241 | || ((center_freq) == 5220) || ((center_freq) == 5240)) |
| 242 | |
| 243 | #ifdef WLAN_FEATURE_11W |
| 244 | #define WLAN_HDD_SA_QUERY_ACTION_FRAME 8 |
| 245 | #endif |
| 246 | |
| 247 | #define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14 |
| 248 | #define WLAN_HDD_TDLS_ACTION_FRAME 12 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 249 | |
| 250 | #define WLAN_HDD_QOS_ACTION_FRAME 1 |
| 251 | #define WLAN_HDD_QOS_MAP_CONFIGURE 4 |
| 252 | #define HDD_SAP_WAKE_LOCK_DURATION 10000 /* in msecs */ |
| 253 | |
Mukul Sharma | 974ca65 | 2016-09-03 16:24:48 +0530 | [diff] [blame] | 254 | #if defined(CONFIG_HL_SUPPORT) |
| 255 | #define HDD_MOD_EXIT_SSR_MAX_RETRIES 200 |
| 256 | #else |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 257 | #define HDD_MOD_EXIT_SSR_MAX_RETRIES 75 |
Mukul Sharma | 974ca65 | 2016-09-03 16:24:48 +0530 | [diff] [blame] | 258 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 259 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 260 | #define MAX_USER_COMMAND_SIZE 4096 |
| 261 | |
| 262 | #define HDD_MIN_TX_POWER (-100) /* minimum tx power */ |
| 263 | #define HDD_MAX_TX_POWER (+100) /* maximum tx power */ |
| 264 | |
Manjeet Singh | e7ecb7c | 2016-09-03 12:34:53 +0530 | [diff] [blame] | 265 | /* FW expects burst duration in 1020*ms */ |
| 266 | #define SIFS_BURST_DUR_MULTIPLIER 1020 |
| 267 | #define SIFS_BURST_DUR_MAX 12240 |
| 268 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 269 | /* If IPA UC data path is enabled, target should reserve extra tx descriptors |
| 270 | * for IPA data path. |
| 271 | * Then host data path should allow less TX packet pumping in case |
| 272 | * IPA data path enabled |
| 273 | */ |
| 274 | #define WLAN_TFC_IPAUC_TX_DESC_RESERVE 100 |
| 275 | |
Ryan Hsu | 07495ea | 2016-01-21 15:25:39 -0800 | [diff] [blame] | 276 | /* |
| 277 | * NET_NAME_UNKNOWN is only introduced after Kernel 3.17, to have a macro |
| 278 | * here if the Kernel version is less than 3.17 to avoid the interleave |
| 279 | * conditional compilation. |
| 280 | */ |
| 281 | #if !((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)) || defined(WITH_BACKPORTS)) |
| 282 | #define NET_NAME_UNKNOWN 0 |
| 283 | #endif |
| 284 | |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 285 | #define PRE_CAC_SSID "pre_cac_ssid" |
Arun Khandavalli | b2f6c26 | 2016-08-18 19:07:19 +0530 | [diff] [blame] | 286 | |
| 287 | /* session ID invalid */ |
| 288 | #define HDD_SESSION_ID_INVALID 0xFF |
| 289 | |
Sreelakshmi Konamki | b53c629 | 2017-03-01 13:13:23 +0530 | [diff] [blame] | 290 | #define SCAN_REJECT_THRESHOLD_TIME 300000 /* Time is in msec, equal to 5 mins */ |
| 291 | |
Selvaraj, Sridhar | 0672a12 | 2016-12-29 16:11:48 +0530 | [diff] [blame] | 292 | /* Default Psoc id */ |
| 293 | #define DEFAULT_PSOC_ID 1 |
| 294 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 295 | /* |
| 296 | * Generic asynchronous request/response support |
| 297 | * |
| 298 | * Many of the APIs supported by HDD require a call to SME to |
| 299 | * perform an action or to retrieve some data. In most cases SME |
| 300 | * performs the operation asynchronously, and will execute a provided |
| 301 | * callback function when the request has completed. In order to |
| 302 | * synchronize this the HDD API allocates a context which is then |
| 303 | * passed to SME, and which is then, in turn, passed back to the |
| 304 | * callback function when the operation completes. The callback |
| 305 | * function then sets a completion variable inside the context which |
| 306 | * the HDD API is waiting on. In an ideal world the HDD API would |
| 307 | * wait forever (or at least for a long time) for the response to be |
| 308 | * received and for the completion variable to be set. However in |
| 309 | * most cases these HDD APIs are being invoked in the context of a |
| 310 | * user space thread which has invoked either a cfg80211 API or a |
| 311 | * wireless extensions ioctl and which has taken the kernel rtnl_lock. |
| 312 | * Since this lock is used to synchronize many of the kernel tasks, we |
| 313 | * do not want to hold it for a long time. In addition we do not want |
| 314 | * to block user space threads (such as the wpa supplicant's main |
| 315 | * thread) for an extended time. Therefore we only block for a short |
| 316 | * time waiting for the response before we timeout. This means that |
| 317 | * it is possible for the HDD API to timeout, and for the callback to |
| 318 | * be invoked afterwards. In order for the callback function to |
| 319 | * determine if the HDD API is still waiting, a magic value is also |
| 320 | * stored in the shared context. Only if the context has a valid |
| 321 | * magic will the callback routine do any work. In order to further |
| 322 | * synchronize these activities a spinlock is used so that if any HDD |
| 323 | * API timeout coincides with its callback, the operations of the two |
| 324 | * threads will be serialized. |
| 325 | */ |
| 326 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 327 | extern spinlock_t hdd_context_lock; |
| 328 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 329 | /* MAX OS Q block time value in msec |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 330 | * Prevent from permanent stall, resume OS Q if timer expired |
| 331 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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 | |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 336 | #define NUM_TX_RX_HISTOGRAM 128 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 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 |
Yuanyuan Liu | 1373850 | 2016-04-06 17:41:37 -0700 | [diff] [blame] | 344 | * @next_vote_level: pld_bus_width_type voting level (high or low) |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 345 | * determined on the basis of total tx and rx packets |
| 346 | * received in the last 100ms interval |
Yuanyuan Liu | 1373850 | 2016-04-06 17:41:37 -0700 | [diff] [blame] | 347 | * @next_rx_level: pld_bus_width_type voting level (high or low) |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 348 | * determined on the basis of rx packets received in the |
| 349 | * last 100ms interval |
Yuanyuan Liu | 1373850 | 2016-04-06 17:41:37 -0700 | [diff] [blame] | 350 | * @next_tx_level: pld_bus_width_type voting level (high or low) |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 351 | * determined on the basis of tx packets received in the |
| 352 | * last 100ms interval |
Mohit Khanna | afff9fb | 2016-11-16 20:22:03 -0800 | [diff] [blame] | 353 | * @qtime timestamp when the record is added |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 354 | * |
Mohit Khanna | afff9fb | 2016-11-16 20:22:03 -0800 | [diff] [blame] | 355 | * The structure keeps track of throughput requirements of wlan driver. |
| 356 | * An entry is added if either of next_vote_level, next_rx_level or |
| 357 | * next_tx_level changes. An entry is not added for every 100ms interval. |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 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; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 362 | uint32_t next_vote_level; |
| 363 | uint32_t next_rx_level; |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 364 | uint32_t next_tx_level; |
Mohit Khanna | afff9fb | 2016-11-16 20:22:03 -0800 | [diff] [blame] | 365 | uint64_t qtime; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 366 | }; |
| 367 | |
| 368 | typedef struct hdd_tx_rx_stats_s { |
| 369 | /* start_xmit stats */ |
| 370 | __u32 txXmitCalled; |
| 371 | __u32 txXmitDropped; |
Mohit Khanna | d0b63f5 | 2017-02-18 18:05:52 -0800 | [diff] [blame] | 372 | __u32 txXmitOrphaned; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 373 | __u32 txXmitClassifiedAC[NUM_TX_QUEUES]; |
| 374 | __u32 txXmitDroppedAC[NUM_TX_QUEUES]; |
Mohit Khanna | d0b63f5 | 2017-02-18 18:05:52 -0800 | [diff] [blame] | 375 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 376 | /* rx stats */ |
| 377 | __u32 rxPackets[NUM_CPUS]; |
| 378 | __u32 rxDropped[NUM_CPUS]; |
| 379 | __u32 rxDelivered[NUM_CPUS]; |
| 380 | __u32 rxRefused[NUM_CPUS]; |
| 381 | |
| 382 | /* txflow stats */ |
| 383 | bool is_txflow_paused; |
| 384 | __u32 txflow_pause_cnt; |
| 385 | __u32 txflow_unpause_cnt; |
| 386 | __u32 txflow_timer_cnt; |
| 387 | } hdd_tx_rx_stats_t; |
| 388 | |
| 389 | #ifdef WLAN_FEATURE_11W |
| 390 | typedef struct hdd_pmf_stats_s { |
| 391 | uint8_t numUnprotDeauthRx; |
| 392 | uint8_t numUnprotDisassocRx; |
| 393 | } hdd_pmf_stats_t; |
| 394 | #endif |
| 395 | |
| 396 | typedef struct hdd_stats_s { |
| 397 | tCsrSummaryStatsInfo summary_stat; |
| 398 | tCsrGlobalClassAStatsInfo ClassA_stat; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 399 | tCsrGlobalClassDStatsInfo ClassD_stat; |
Himanshu Agarwal | 37e4241 | 2016-07-21 14:35:09 +0530 | [diff] [blame] | 400 | struct csr_per_chain_rssi_stats_info per_chain_rssi_stats; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 401 | hdd_tx_rx_stats_t hddTxRxStats; |
| 402 | #ifdef WLAN_FEATURE_11W |
| 403 | hdd_pmf_stats_t hddPmfStats; |
| 404 | #endif |
| 405 | } hdd_stats_t; |
| 406 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 407 | enum hdd_roam_state { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 408 | HDD_ROAM_STATE_NONE, |
| 409 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 410 | /* Issuing a disconnect due to transition into low power states */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 411 | HDD_ROAM_STATE_DISCONNECTING_POWER, |
| 412 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 413 | /* Move to this state when HDD sets a key with SME/CSR. Note this is |
| 414 | * an important state to get right because we will get calls into our |
| 415 | * SME callback routine for SetKey activity that we did not initiate! |
| 416 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 417 | HDD_ROAM_STATE_SETTING_KEY, |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 418 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 419 | |
| 420 | typedef struct roaming_info_s { |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 421 | enum hdd_roam_state roamingState; |
Anurag Chouhan | ce0dc99 | 2016-02-16 18:18:03 +0530 | [diff] [blame] | 422 | qdf_event_t roamingEvent; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 423 | |
| 424 | tSirMacAddr bssid; |
| 425 | tSirMacAddr peerMac; |
| 426 | uint32_t roamId; |
| 427 | eRoamCmdStatus roamStatus; |
| 428 | bool deferKeyComplete; |
| 429 | |
| 430 | } roaming_info_t; |
| 431 | |
| 432 | #ifdef FEATURE_WLAN_WAPI |
| 433 | /* Define WAPI macros for Length, BKID count etc*/ |
| 434 | #define MAX_WPI_KEY_LENGTH 16 |
| 435 | #define MAX_NUM_PN 16 |
| 436 | #define MAC_ADDR_LEN 6 |
| 437 | #define MAX_ADDR_INDEX 12 |
| 438 | #define MAX_NUM_AKM_SUITES 16 |
| 439 | #define MAX_NUM_UNI_SUITES 16 |
| 440 | #define MAX_NUM_BKIDS 16 |
| 441 | |
| 442 | /** WAPI AUTH mode definition */ |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 443 | enum wapi_auth_mode { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 444 | WAPI_AUTH_MODE_OPEN = 0, |
| 445 | WAPI_AUTH_MODE_PSK = 1, |
| 446 | WAPI_AUTH_MODE_CERT |
| 447 | } __packed; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 448 | |
| 449 | /** WAPI Work mode structure definition */ |
| 450 | #define WZC_ORIGINAL 0 |
| 451 | #define WAPI_EXTENTION 1 |
| 452 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 453 | struct wapi_function_mode { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 454 | unsigned char wapiMode; |
| 455 | } __packed; |
| 456 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 457 | typedef struct _WAPI_BKID { |
| 458 | uint8_t bkid[16]; |
| 459 | } WAPI_BKID, *pWAPI_BKID; |
| 460 | |
| 461 | /** WAPI Association information structure definition */ |
| 462 | struct _WAPI_AssocInfo { |
| 463 | uint8_t elementID; |
| 464 | uint8_t length; |
| 465 | uint16_t version; |
| 466 | uint16_t akmSuiteCount; |
| 467 | uint32_t akmSuite[MAX_NUM_AKM_SUITES]; |
| 468 | uint16_t unicastSuiteCount; |
| 469 | uint32_t unicastSuite[MAX_NUM_UNI_SUITES]; |
| 470 | uint32_t multicastSuite; |
| 471 | uint16_t wapiCability; |
| 472 | uint16_t bkidCount; |
| 473 | WAPI_BKID bkidList[MAX_NUM_BKIDS]; |
| 474 | } __packed; |
| 475 | |
| 476 | typedef struct _WAPI_AssocInfo WAPI_AssocInfo; |
| 477 | typedef struct _WAPI_AssocInfo *pWAPI_IEAssocInfo; |
| 478 | |
| 479 | /** WAPI KEY Type definition */ |
| 480 | enum _WAPIKeyType { |
| 481 | PAIRWISE_KEY, /* 0 */ |
| 482 | GROUP_KEY /* 1 */ |
| 483 | } __packed; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 484 | |
| 485 | /** WAPI KEY Direction definition */ |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 486 | enum key_direction { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 487 | None, |
| 488 | Rx, |
| 489 | Tx, |
| 490 | Rx_Tx |
| 491 | } __packed; |
| 492 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 493 | /* WAPI KEY structure definition */ |
| 494 | struct WLAN_WAPI_KEY { |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 495 | enum _WAPIKeyType keyType; |
| 496 | enum key_direction keyDirection; /*reserved for future use */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 497 | uint8_t keyId; |
| 498 | uint8_t addrIndex[MAX_ADDR_INDEX]; /*reserved for future use */ |
| 499 | int wpiekLen; |
| 500 | uint8_t wpiek[MAX_WPI_KEY_LENGTH]; |
| 501 | int wpickLen; |
| 502 | uint8_t wpick[MAX_WPI_KEY_LENGTH]; |
| 503 | uint8_t pn[MAX_NUM_PN]; /*reserved for future use */ |
| 504 | } __packed; |
| 505 | |
| 506 | typedef struct WLAN_WAPI_KEY WLAN_WAPI_KEY; |
| 507 | typedef struct WLAN_WAPI_KEY *pWLAN_WAPI_KEY; |
| 508 | |
| 509 | #define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) |
| 510 | #define WPA_GET_BE24(a) ((u32) ((a[0] << 16) | (a[1] << 8) | a[2])) |
| 511 | #define WLAN_EID_WAPI 68 |
| 512 | #define WAPI_PSK_AKM_SUITE 0x02721400 |
| 513 | #define WAPI_CERT_AKM_SUITE 0x01721400 |
| 514 | |
| 515 | /* WAPI BKID List structure definition */ |
| 516 | struct _WLAN_BKID_LIST { |
| 517 | uint32_t length; |
| 518 | uint32_t BKIDCount; |
| 519 | WAPI_BKID BKID[1]; |
| 520 | } __packed; |
| 521 | |
| 522 | typedef struct _WLAN_BKID_LIST WLAN_BKID_LIST; |
| 523 | typedef struct _WLAN_BKID_LIST *pWLAN_BKID_LIST; |
| 524 | |
| 525 | /* WAPI Information structure definition */ |
| 526 | struct hdd_wapi_info_s { |
| 527 | uint32_t nWapiMode; |
| 528 | bool fIsWapiSta; |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 529 | struct qdf_mac_addr cachedMacAddr; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 530 | uint8_t wapiAuthMode; |
| 531 | } __packed; |
| 532 | typedef struct hdd_wapi_info_s hdd_wapi_info_t; |
| 533 | #endif /* FEATURE_WLAN_WAPI */ |
| 534 | |
| 535 | typedef struct beacon_data_s { |
| 536 | u8 *head; |
| 537 | u8 *tail; |
| 538 | u8 *proberesp_ies; |
| 539 | u8 *assocresp_ies; |
| 540 | int head_len; |
| 541 | int tail_len; |
| 542 | int proberesp_ies_len; |
| 543 | int assocresp_ies_len; |
| 544 | int dtim_period; |
| 545 | } beacon_data_t; |
| 546 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 547 | enum rem_on_channel_request_type { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 548 | REMAIN_ON_CHANNEL_REQUEST, |
| 549 | OFF_CHANNEL_ACTION_TX, |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 550 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 551 | |
| 552 | typedef struct action_pkt_buffer { |
| 553 | uint8_t *frame_ptr; |
| 554 | uint32_t frame_length; |
| 555 | uint16_t freq; |
| 556 | } action_pkt_buffer_t; |
| 557 | |
| 558 | typedef struct hdd_remain_on_chan_ctx { |
| 559 | struct net_device *dev; |
| 560 | struct ieee80211_channel chan; |
| 561 | enum nl80211_channel_type chan_type; |
| 562 | unsigned int duration; |
| 563 | u64 cookie; |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 564 | enum rem_on_channel_request_type rem_on_chan_request; |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 565 | qdf_mc_timer_t hdd_remain_on_chan_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 566 | action_pkt_buffer_t action_pkt_buff; |
| 567 | bool hdd_remain_on_chan_cancel_in_progress; |
| 568 | uint32_t scan_id; |
| 569 | } hdd_remain_on_chan_ctx_t; |
| 570 | |
| 571 | /* RoC Request entry */ |
| 572 | typedef struct hdd_roc_req { |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 573 | qdf_list_node_t node; /* MUST be first element */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 574 | hdd_adapter_t *pAdapter; |
| 575 | hdd_remain_on_chan_ctx_t *pRemainChanCtx; |
| 576 | } hdd_roc_req_t; |
| 577 | |
| 578 | /** |
| 579 | * struct hdd_scan_req - Scan Request entry |
| 580 | * @node : List entry element |
| 581 | * @adapter: Adapter address |
| 582 | * @scan_request: scan request holder |
| 583 | * @scan_id: scan identifier used across host layers which is generated at WMI |
| 584 | * @cookie: scan request identifier sent to userspace |
| 585 | * @source: scan request originator (NL/Vendor scan) |
| 586 | * @timestamp: scan request timestamp |
| 587 | * |
| 588 | * Scan request linked list element |
| 589 | */ |
| 590 | struct hdd_scan_req { |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 591 | qdf_list_node_t node; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 592 | hdd_adapter_t *adapter; |
| 593 | struct cfg80211_scan_request *scan_request; |
| 594 | uint32_t scan_id; |
| 595 | uint8_t source; |
| 596 | uint32_t timestamp; |
| 597 | }; |
| 598 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 599 | enum p2p_action_frame_state { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 600 | HDD_IDLE, |
| 601 | HDD_PD_REQ_ACK_PENDING, |
| 602 | HDD_GO_NEG_REQ_ACK_PENDING, |
| 603 | HDD_INVALID_STATE, |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 604 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 605 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 606 | enum action_frm_type { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 607 | WLAN_HDD_GO_NEG_REQ, |
| 608 | WLAN_HDD_GO_NEG_RESP, |
| 609 | WLAN_HDD_GO_NEG_CNF, |
| 610 | WLAN_HDD_INVITATION_REQ, |
| 611 | WLAN_HDD_INVITATION_RESP, |
| 612 | WLAN_HDD_DEV_DIS_REQ, |
| 613 | WLAN_HDD_DEV_DIS_RESP, |
| 614 | WLAN_HDD_PROV_DIS_REQ, |
| 615 | WLAN_HDD_PROV_DIS_RESP, |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 616 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 617 | |
| 618 | typedef struct hdd_cfg80211_state_s { |
| 619 | uint16_t current_freq; |
| 620 | u64 action_cookie; |
| 621 | uint8_t *buf; |
| 622 | size_t len; |
| 623 | hdd_remain_on_chan_ctx_t *remain_on_chan_ctx; |
| 624 | struct mutex remain_on_chan_ctx_lock; |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 625 | enum p2p_action_frame_state actionFrmState; |
Gowri, Deepthi | 62da33e | 2016-09-02 16:01:26 +0530 | [diff] [blame] | 626 | /* is_go_neg_ack_received flag is set to 1 when |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 627 | * the pending ack for GO negotiation req is |
| 628 | * received. |
| 629 | */ |
Gowri, Deepthi | 62da33e | 2016-09-02 16:01:26 +0530 | [diff] [blame] | 630 | bool is_go_neg_ack_received; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 631 | } hdd_cfg80211_state_t; |
| 632 | |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 633 | /** |
| 634 | * struct hdd_mon_set_ch_info - Holds monitor mode channel switch params |
| 635 | * @channel: Channel number. |
| 636 | * @cb_mode: Channel bonding |
| 637 | * @channel_width: Channel width 0/1/2 for 20/40/80MHz respectively. |
| 638 | * @phy_mode: PHY mode |
| 639 | */ |
| 640 | struct hdd_mon_set_ch_info { |
| 641 | uint8_t channel; |
| 642 | uint8_t cb_mode; |
| 643 | uint32_t channel_width; |
| 644 | eCsrPhyMode phy_mode; |
| 645 | }; |
| 646 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 647 | struct hdd_station_ctx { |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 648 | /* Handle to the Wireless Extension State */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 649 | hdd_wext_state_t WextState; |
| 650 | |
| 651 | #ifdef FEATURE_WLAN_TDLS |
| 652 | tdlsCtx_t *pHddTdlsCtx; |
| 653 | #endif |
| 654 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 655 | /* Connection information*/ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 656 | connection_info_t conn_info; |
| 657 | |
| 658 | roaming_info_t roam_info; |
| 659 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 660 | int ft_carrier_on; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 661 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 662 | /* Increment whenever ibss New peer joins and departs the network */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 663 | int ibss_sta_generation; |
| 664 | |
| 665 | /* Indication of wep/wpa-none keys installation */ |
| 666 | bool ibss_enc_key_installed; |
| 667 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 668 | /* Save the wep/wpa-none keys */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 669 | tCsrRoamSetKey ibss_enc_key; |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 670 | tSirPeerInfoRspParams ibss_peer_info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 671 | |
| 672 | bool hdd_ReassocScenario; |
| 673 | |
| 674 | /* STA ctx debug variables */ |
| 675 | int staDebugState; |
Chandrasekaran, Manishekar | 34e325a | 2015-12-18 12:07:22 +0530 | [diff] [blame] | 676 | |
Rakesh Sunki | cf1c9ab | 2016-08-25 14:11:25 -0700 | [diff] [blame] | 677 | uint8_t broadcast_staid; |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 678 | |
| 679 | struct hdd_mon_set_ch_info ch_info; |
Naveen Rawat | 9750035 | 2017-03-22 10:07:58 -0700 | [diff] [blame] | 680 | #if defined(WLAN_FEATURE_NAN_DATAPATH) && !defined(WLAN_FEATURE_NAN_CONVERGENCE) |
Deepak Dhamdhere | 8360d4c | 2016-06-01 13:24:31 -0700 | [diff] [blame] | 681 | struct nan_datapath_ctx ndp_ctx; |
| 682 | #endif |
Krunal Soni | 364e087 | 2017-05-10 21:24:34 -0700 | [diff] [blame] | 683 | bool ap_supports_immediate_power_save; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 684 | }; |
| 685 | |
| 686 | #define BSS_STOP 0 |
| 687 | #define BSS_START 1 |
| 688 | typedef struct hdd_hostapd_state_s { |
| 689 | int bssState; |
Anurag Chouhan | f04e84f | 2016-03-03 10:12:12 +0530 | [diff] [blame] | 690 | qdf_event_t qdf_event; |
| 691 | qdf_event_t qdf_stop_bss_event; |
Wei Song | 2f76f64 | 2016-11-18 16:32:53 +0800 | [diff] [blame] | 692 | qdf_event_t qdf_sta_disassoc_event; |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 693 | QDF_STATUS qdf_status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 694 | bool bCommit; |
| 695 | |
| 696 | } hdd_hostapd_state_t; |
| 697 | |
wadesong | 9b81907 | 2017-02-07 16:42:09 +0800 | [diff] [blame] | 698 | /** |
| 699 | * enum bss_stop_reason - reasons why a BSS is stopped. |
| 700 | * @BSS_STOP_REASON_INVALID: no reason specified explicitly. |
| 701 | * @BSS_STOP_DUE_TO_MCC_SCC_SWITCH: BSS stopped due to host |
| 702 | * driver is trying to switch AP role to a different channel |
| 703 | * to maintain SCC mode with the STA role on the same card. |
| 704 | * this usually happens when STA is connected to an external |
| 705 | * AP that runs on a different channel |
| 706 | */ |
| 707 | enum bss_stop_reason { |
| 708 | BSS_STOP_REASON_INVALID = 0, |
| 709 | BSS_STOP_DUE_TO_MCC_SCC_SWITCH = 1, |
| 710 | }; |
| 711 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 712 | /* |
| 713 | * Per station structure kept in HDD for multiple station support for SoftAP |
| 714 | */ |
| 715 | typedef struct { |
| 716 | /** The station entry is used or not */ |
| 717 | bool isUsed; |
| 718 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 719 | /* Station ID reported back from HAL (through SAP). |
| 720 | * Broadcast uses station ID zero by default |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 721 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 722 | uint8_t ucSTAId; |
| 723 | |
Rachit Kankane | 2487f8f | 2017-04-19 14:30:19 +0530 | [diff] [blame] | 724 | /* type of station i.e. p2p client or infrastructure station */ |
| 725 | eStationType staType; |
| 726 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 727 | /** MAC address of the station */ |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 728 | struct qdf_mac_addr macAddrSTA; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 729 | |
| 730 | /** Current Station state so HDD knows how to deal with packet |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 731 | * queue. Most recent states used to change TLSHIM STA state |
| 732 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 733 | enum ol_txrx_peer_state tlSTAState; |
| 734 | |
| 735 | /** Track QoS status of station */ |
| 736 | bool isQosEnabled; |
| 737 | |
| 738 | /** The station entry for which Deauth is in progress */ |
| 739 | bool isDeauthInProgress; |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 740 | |
| 741 | /** Number of spatial streams supported */ |
| 742 | uint8_t nss; |
| 743 | |
| 744 | /** Rate Flags for this connection */ |
| 745 | uint32_t rate_flags; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 746 | } hdd_station_info_t; |
| 747 | |
| 748 | struct hdd_ap_ctx_s { |
| 749 | hdd_hostapd_state_t HostapdState; |
| 750 | |
| 751 | /* Memory differentiation mode is enabled */ |
| 752 | /* uint16_t uMemoryDiffThreshold; */ |
| 753 | /* uint8_t uNumActiveAC; */ |
| 754 | /* uint8_t uActiveACMask; */ |
| 755 | |
| 756 | /** Packet Count to update uNumActiveAC and uActiveACMask */ |
| 757 | /* uint16_t uUpdatePktCount; */ |
| 758 | |
| 759 | /** Station ID assigned after BSS starts */ |
| 760 | uint8_t uBCStaId; |
| 761 | |
| 762 | uint8_t uPrivacy; /* The privacy bits of configuration */ |
| 763 | |
| 764 | tSirWPSPBCProbeReq WPSPBCProbeReq; |
| 765 | |
| 766 | tsap_Config_t sapConfig; |
| 767 | |
| 768 | struct semaphore semWpsPBCOverlapInd; |
| 769 | |
| 770 | bool apDisableIntraBssFwd; |
| 771 | |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 772 | qdf_mc_timer_t hdd_ap_inactivity_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 773 | |
| 774 | uint8_t operatingChannel; |
| 775 | |
| 776 | bool uIsAuthenticated; |
| 777 | |
| 778 | eCsrEncryptionType ucEncryptType; |
| 779 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 780 | /* This will point to group key data, |
| 781 | * if it is received before start bss |
| 782 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 783 | tCsrRoamSetKey groupKey; |
| 784 | /* This will have WEP key data, if it is received before start bss */ |
| 785 | tCsrRoamSetKey wepKey[CSR_MAX_NUM_KEY]; |
| 786 | |
Kondabattini, Ganesh | 702d90e | 2016-09-03 01:54:22 +0530 | [diff] [blame] | 787 | /* WEP default key index */ |
| 788 | uint8_t wep_def_key_idx; |
| 789 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 790 | beacon_data_t *beacon; |
| 791 | |
| 792 | bool bApActive; |
Dustin Brown | 5e79c10 | 2016-09-21 11:29:39 -0700 | [diff] [blame] | 793 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 794 | /* SAP Context */ |
| 795 | void *sapContext; |
Dustin Brown | 5e79c10 | 2016-09-21 11:29:39 -0700 | [diff] [blame] | 796 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 797 | bool dfs_cac_block_tx; |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 798 | qdf_mc_timer_t vendor_acs_timer; |
| 799 | bool vendor_acs_timer_initialized; |
wadesong | 9b81907 | 2017-02-07 16:42:09 +0800 | [diff] [blame] | 800 | |
| 801 | enum bss_stop_reason bss_stop_reason; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 802 | }; |
| 803 | |
| 804 | typedef struct hdd_scaninfo_s { |
| 805 | /* The scan pending */ |
| 806 | uint32_t mScanPending; |
| 807 | |
| 808 | /* Counter for mScanPending so that the scan pending |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 809 | * error log is not printed for more than 5 times |
| 810 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 811 | uint32_t mScanPendingCounter; |
| 812 | |
| 813 | /* Additional IE for scan */ |
| 814 | tSirAddie scanAddIE; |
| 815 | |
Selvaraj, Sridhar | 4ea106e | 2016-08-05 20:34:46 +0530 | [diff] [blame] | 816 | uint8_t *default_scan_ies; |
Selvaraj, Sridhar | 021ee0a | 2017-04-07 16:53:31 +0530 | [diff] [blame] | 817 | uint16_t default_scan_ies_len; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 818 | /* Scan mode */ |
| 819 | tSirScanType scan_mode; |
| 820 | |
| 821 | /* completion variable for abortscan */ |
| 822 | struct completion abortscan_event_var; |
| 823 | |
| 824 | } hdd_scaninfo_t; |
| 825 | |
Dustin Brown | 6126946 | 2016-09-19 13:25:45 -0700 | [diff] [blame] | 826 | #define WLAN_HDD_MAX_MC_ADDR_LIST CFG_TGT_MAX_MULTICAST_FILTER_ENTRIES |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 827 | |
| 828 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 829 | typedef struct multicast_addr_list { |
| 830 | uint8_t isFilterApplied; |
| 831 | uint8_t mc_cnt; |
| 832 | uint8_t addr[WLAN_HDD_MAX_MC_ADDR_LIST][ETH_ALEN]; |
| 833 | } t_multicast_add_list; |
| 834 | #endif |
| 835 | |
| 836 | #define WLAN_HDD_MAX_HISTORY_ENTRY 10 |
| 837 | |
| 838 | /** |
| 839 | * struct hdd_netif_queue_stats - netif queue operation statistics |
| 840 | * @pause_count - pause counter |
| 841 | * @unpause_count - unpause counter |
| 842 | */ |
| 843 | struct hdd_netif_queue_stats { |
| 844 | uint16_t pause_count; |
| 845 | uint16_t unpause_count; |
Nirav Shah | da00834 | 2016-05-17 18:50:40 +0530 | [diff] [blame] | 846 | qdf_time_t total_pause_time; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 847 | }; |
| 848 | |
| 849 | /** |
| 850 | * struct hdd_netif_queue_history - netif queue operation history |
| 851 | * @time: timestamp |
| 852 | * @netif_action: action type |
| 853 | * @netif_reason: reason type |
| 854 | * @pause_map: pause map |
| 855 | */ |
| 856 | struct hdd_netif_queue_history { |
Anurag Chouhan | 50220ce | 2016-02-18 20:11:33 +0530 | [diff] [blame] | 857 | qdf_time_t time; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 858 | uint16_t netif_action; |
| 859 | uint16_t netif_reason; |
| 860 | uint32_t pause_map; |
| 861 | }; |
| 862 | |
Manishekar Chandrasekaran | ec26759 | 2016-05-26 19:10:04 +0530 | [diff] [blame] | 863 | /** |
| 864 | * struct hdd_chan_change_params - channel related information |
| 865 | * @chan: operating channel |
| 866 | * @chan_params: channel parameters |
| 867 | */ |
| 868 | struct hdd_chan_change_params { |
| 869 | uint8_t chan; |
Amar Singhal | 5cccafe | 2017-02-15 12:42:58 -0800 | [diff] [blame] | 870 | struct ch_params chan_params; |
Manishekar Chandrasekaran | ec26759 | 2016-05-26 19:10:04 +0530 | [diff] [blame] | 871 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 872 | |
Komal Seelam | a89be8d | 2016-09-29 11:09:26 +0530 | [diff] [blame] | 873 | /** |
Komal Seelam | 8634b77 | 2016-09-29 12:12:24 +0530 | [diff] [blame] | 874 | * struct hdd_runtime_pm_context - context to prevent/allow runtime pm |
| 875 | * @scan: scan context to prvent/allow runtime pm |
| 876 | * |
| 877 | * Prevent Runtime PM for scan |
| 878 | */ |
| 879 | struct hdd_runtime_pm_context { |
Komal Seelam | aa75f26 | 2016-09-29 12:32:13 +0530 | [diff] [blame] | 880 | qdf_runtime_lock_t roc; |
Komal Seelam | 81cb166 | 2016-09-29 12:39:08 +0530 | [diff] [blame] | 881 | qdf_runtime_lock_t dfs; |
Komal Seelam | 8634b77 | 2016-09-29 12:12:24 +0530 | [diff] [blame] | 882 | }; |
| 883 | |
| 884 | /** |
Komal Seelam | a89be8d | 2016-09-29 11:09:26 +0530 | [diff] [blame] | 885 | * struct hdd_connect_pm_context - Runtime PM connect context per adapter |
| 886 | * @connect: Runtime Connect Context |
| 887 | * |
| 888 | * Structure to hold runtime pm connect context for each adapter. |
| 889 | */ |
| 890 | struct hdd_connect_pm_context { |
| 891 | qdf_runtime_lock_t connect; |
| 892 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 893 | |
Samuel Ahn | c9c48ca | 2016-09-19 15:46:36 +0530 | [diff] [blame] | 894 | /* |
| 895 | * WLAN_HDD_ADAPTER_MAGIC is a magic number used to identify net devices |
| 896 | * belonging to this driver from net devices belonging to other devices. |
| 897 | * Therefore, the magic number must be unique relative to the numbers for |
| 898 | * other drivers in the system. If WLAN_HDD_ADAPTER_MAGIC is already defined |
| 899 | * (e.g. by compiler argument), then use that. If it's not already defined, |
| 900 | * then use the first 4 characters of MULTI_IF_NAME to construct the magic |
| 901 | * number. If MULTI_IF_NAME is not defined, then use a default magic number. |
| 902 | */ |
| 903 | #ifndef WLAN_HDD_ADAPTER_MAGIC |
| 904 | #ifdef MULTI_IF_NAME |
| 905 | #define WLAN_HDD_ADAPTER_MAGIC \ |
| 906 | (MULTI_IF_NAME[0] == 0 ? 0x574c414e : \ |
| 907 | (MULTI_IF_NAME[1] == 0 ? (MULTI_IF_NAME[0] << 24) : \ |
| 908 | (MULTI_IF_NAME[2] == 0 ? (MULTI_IF_NAME[0] << 24) | \ |
| 909 | (MULTI_IF_NAME[1] << 16) : \ |
| 910 | (MULTI_IF_NAME[0] << 24) | (MULTI_IF_NAME[1] << 16) | \ |
| 911 | (MULTI_IF_NAME[2] << 8) | MULTI_IF_NAME[3]))) |
| 912 | #else |
Komal Seelam | a89be8d | 2016-09-29 11:09:26 +0530 | [diff] [blame] | 913 | #define WLAN_HDD_ADAPTER_MAGIC 0x574c414e /* ASCII "WLAN" */ |
Samuel Ahn | c9c48ca | 2016-09-19 15:46:36 +0530 | [diff] [blame] | 914 | #endif |
| 915 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 916 | |
| 917 | struct hdd_adapter_s { |
Jeff Johnson | d399e90 | 2015-12-17 15:17:02 -0800 | [diff] [blame] | 918 | /* Magic cookie for adapter sanity verification. Note that this |
| 919 | * needs to be at the beginning of the private data structure so |
| 920 | * that it will exists at the beginning of dev->priv and hence |
| 921 | * will always be in mapped memory |
| 922 | */ |
| 923 | uint32_t magic; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 924 | |
Jeff Johnson | d399e90 | 2015-12-17 15:17:02 -0800 | [diff] [blame] | 925 | void *pHddCtx; |
Selvaraj, Sridhar | 0672a12 | 2016-12-29 16:11:48 +0530 | [diff] [blame] | 926 | struct wlan_objmgr_vdev *hdd_vdev; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 927 | |
Leo Chang | fdb45c3 | 2016-10-28 11:09:23 -0700 | [diff] [blame] | 928 | void *txrx_vdev; |
| 929 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 930 | /** Handle to the network device */ |
| 931 | struct net_device *dev; |
| 932 | |
Krunal Soni | 276241e | 2016-03-10 12:58:11 -0800 | [diff] [blame] | 933 | enum tQDF_ADAPTER_MODE device_mode; |
Jeff Johnson | d399e90 | 2015-12-17 15:17:02 -0800 | [diff] [blame] | 934 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 935 | /** IPv4 notifier callback for handling ARP offload on change in IP */ |
| 936 | struct work_struct ipv4NotifierWorkQueue; |
| 937 | #ifdef WLAN_NS_OFFLOAD |
| 938 | /** IPv6 notifier callback for handling NS offload on change in IP */ |
| 939 | struct work_struct ipv6NotifierWorkQueue; |
| 940 | #endif |
| 941 | |
| 942 | /* TODO Move this to sta Ctx */ |
| 943 | struct wireless_dev wdev; |
| 944 | struct cfg80211_scan_request *request; |
bings | 4c6cecf | 2017-04-05 08:24:29 +0800 | [diff] [blame] | 945 | uint8_t scan_source; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 946 | |
| 947 | /** ops checks if Opportunistic Power Save is Enable or Not |
| 948 | * ctw stores ctWindow value once we receive Opps command from |
| 949 | * wpa_supplicant then using ctWindow value we need to Enable |
| 950 | * Opportunistic Power Save |
| 951 | */ |
| 952 | uint8_t ops; |
| 953 | uint32_t ctw; |
| 954 | |
| 955 | /** Current MAC Address for the adapter */ |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 956 | struct qdf_mac_addr macAddressCurrent; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 957 | |
| 958 | /**Event Flags*/ |
| 959 | unsigned long event_flags; |
| 960 | |
| 961 | /**Device TX/RX statistics*/ |
| 962 | struct net_device_stats stats; |
| 963 | /** HDD statistics*/ |
| 964 | hdd_stats_t hdd_stats; |
Jeff Johnson | e50427c | 2017-01-26 10:54:49 -0800 | [diff] [blame] | 965 | |
| 966 | /* estimated link speed */ |
| 967 | uint32_t estimated_linkspeed; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 968 | |
| 969 | uint8_t sessionId; |
| 970 | |
| 971 | /* Completion variable for session close */ |
| 972 | struct completion session_close_comp_var; |
| 973 | |
| 974 | /* Completion variable for session open */ |
| 975 | struct completion session_open_comp_var; |
| 976 | |
| 977 | /* TODO: move these to sta ctx. These may not be used in AP */ |
| 978 | /** completion variable for disconnect callback */ |
| 979 | struct completion disconnect_comp_var; |
| 980 | |
Abhishek Singh | 533c9da | 2017-05-04 10:23:34 +0530 | [diff] [blame] | 981 | struct completion roaming_comp_var; |
| 982 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 983 | /** Completion of change country code */ |
| 984 | struct completion change_country_code; |
| 985 | |
| 986 | /* completion variable for Linkup Event */ |
| 987 | struct completion linkup_event_var; |
| 988 | |
| 989 | /* completion variable for cancel remain on channel Event */ |
| 990 | struct completion cancel_rem_on_chan_var; |
| 991 | |
| 992 | /* completion variable for off channel remain on channel Event */ |
| 993 | struct completion offchannel_tx_event; |
| 994 | /* Completion variable for action frame */ |
| 995 | struct completion tx_action_cnf_event; |
| 996 | /* Completion variable for remain on channel ready */ |
| 997 | struct completion rem_on_chan_ready_event; |
| 998 | |
| 999 | struct completion sta_authorized_event; |
| 1000 | #ifdef FEATURE_WLAN_TDLS |
| 1001 | struct completion tdls_add_station_comp; |
| 1002 | struct completion tdls_del_station_comp; |
| 1003 | struct completion tdls_mgmt_comp; |
| 1004 | struct completion tdls_link_establish_req_comp; |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1005 | QDF_STATUS tdlsAddStaStatus; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1006 | #endif |
| 1007 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 1008 | struct completion ibss_peer_info_comp; |
| 1009 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1010 | /* Track whether the linkup handling is needed */ |
| 1011 | bool isLinkUpSvcNeeded; |
| 1012 | |
| 1013 | /* Mgmt Frames TX completion status code */ |
| 1014 | uint32_t mgmtTxCompletionStatus; |
| 1015 | |
| 1016 | /* WMM Status */ |
Srinivas Girigowda | ea32d6a | 2017-03-25 00:03:12 -0700 | [diff] [blame] | 1017 | struct hdd_wmm_status hddWmmStatus; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1018 | /************************************************************* |
| 1019 | */ |
| 1020 | /************************************************************* |
| 1021 | * TODO - Remove it later |
| 1022 | */ |
| 1023 | /** Multiple station supports */ |
| 1024 | /** Per-station structure */ |
| 1025 | spinlock_t staInfo_lock; /* To protect access to station Info */ |
| 1026 | hdd_station_info_t aStaInfo[WLAN_MAX_STA_COUNT]; |
| 1027 | /* uint8_t uNumActiveStation; */ |
| 1028 | |
| 1029 | /************************************************************* |
| 1030 | */ |
| 1031 | |
| 1032 | #ifdef FEATURE_WLAN_WAPI |
| 1033 | hdd_wapi_info_t wapi_info; |
| 1034 | #endif |
| 1035 | |
| 1036 | int8_t rssi; |
Sreelakshmi Konamki | 58c7243 | 2016-11-09 17:06:44 +0530 | [diff] [blame] | 1037 | int32_t rssi_on_disconnect; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1038 | #ifdef WLAN_FEATURE_LPSS |
| 1039 | bool rssi_send; |
| 1040 | #endif |
| 1041 | |
| 1042 | uint8_t snr; |
| 1043 | |
| 1044 | struct work_struct monTxWorkQueue; |
| 1045 | struct sk_buff *skb_to_tx; |
| 1046 | |
| 1047 | union { |
| 1048 | hdd_station_ctx_t station; |
| 1049 | hdd_ap_ctx_t ap; |
| 1050 | } sessionCtx; |
| 1051 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 1052 | #ifdef WLAN_FEATURE_TSF |
| 1053 | /* tsf value received from firmware */ |
Yu Wang | f5d5b5f | 2017-05-25 22:38:32 +0800 | [diff] [blame^] | 1054 | uint64_t cur_target_time; |
Manikandan Mohan | 5356c2b | 2016-04-03 15:51:35 -0700 | [diff] [blame] | 1055 | uint64_t tsf_sync_soc_timer; |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 1056 | #endif |
| 1057 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1058 | hdd_cfg80211_state_t cfg80211State; |
| 1059 | |
| 1060 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 1061 | t_multicast_add_list mc_addr_list; |
| 1062 | #endif |
| 1063 | uint8_t addr_filter_pattern; |
| 1064 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1065 | bool higherDtimTransition; |
| 1066 | bool survey_idx; |
| 1067 | |
| 1068 | hdd_scaninfo_t scan_info; |
Jeff Johnson | c13bdf1 | 2017-01-25 16:28:19 -0800 | [diff] [blame] | 1069 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1070 | /* Flag to ensure PSB is configured through framework */ |
| 1071 | uint8_t psbChanged; |
| 1072 | /* UAPSD psb value configured through framework */ |
| 1073 | uint8_t configuredPsb; |
| 1074 | #ifdef IPA_OFFLOAD |
| 1075 | void *ipa_context; |
| 1076 | #endif |
| 1077 | /* Use delayed work for Sec AP ACS as Pri AP Startup need to complete |
| 1078 | * since CSR (PMAC Struct) Config is same for both AP |
| 1079 | */ |
| 1080 | struct delayed_work acs_pending_work; |
| 1081 | |
| 1082 | struct work_struct scan_block_work; |
| 1083 | #ifdef MSM_PLATFORM |
| 1084 | unsigned long prev_rx_packets; |
| 1085 | unsigned long prev_tx_packets; |
Himanshu Agarwal | a6cedee | 2016-06-08 14:50:00 +0530 | [diff] [blame] | 1086 | uint64_t prev_fwd_tx_packets; |
| 1087 | uint64_t prev_fwd_rx_packets; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1088 | int connection; |
| 1089 | #endif |
| 1090 | bool is_roc_inprogress; |
| 1091 | |
| 1092 | #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 1093 | qdf_mc_timer_t tx_flow_control_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1094 | bool tx_flow_timer_initialized; |
| 1095 | unsigned int tx_flow_low_watermark; |
| 1096 | unsigned int tx_flow_high_watermark_offset; |
| 1097 | #endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */ |
| 1098 | bool offloads_configured; |
| 1099 | |
| 1100 | /* DSCP to UP QoS Mapping */ |
| 1101 | sme_QosWmmUpType hddWmmDscpToUpMap[WLAN_HDD_MAX_DSCP + 1]; |
| 1102 | |
| 1103 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
| 1104 | bool isLinkLayerStatsSet; |
| 1105 | #endif |
| 1106 | uint8_t linkStatus; |
| 1107 | |
| 1108 | /* variable for temperature in Celsius */ |
| 1109 | int temperature; |
| 1110 | |
| 1111 | /* Time stamp for last completed RoC request */ |
Deepthi Gowri | 6acee34 | 2016-10-28 15:00:38 +0530 | [diff] [blame] | 1112 | uint64_t last_roc_ts; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1113 | |
| 1114 | /* Time stamp for start RoC request */ |
Deepthi Gowri | 6acee34 | 2016-10-28 15:00:38 +0530 | [diff] [blame] | 1115 | uint64_t start_roc_ts; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1116 | |
Agrawal Ashish | b141b09 | 2016-09-02 19:59:26 +0530 | [diff] [blame] | 1117 | #ifdef WLAN_FEATURE_DSRC |
Jeff Johnson | 7af334b | 2017-02-01 13:03:43 -0800 | [diff] [blame] | 1118 | /* MAC addresses used for OCB interfaces */ |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1119 | struct qdf_mac_addr ocb_mac_address[QDF_MAX_CONCURRENCY_PERSONA]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1120 | int ocb_mac_addr_count; |
Agrawal Ashish | b141b09 | 2016-09-02 19:59:26 +0530 | [diff] [blame] | 1121 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1122 | |
| 1123 | /* BITMAP indicating pause reason */ |
| 1124 | uint32_t pause_map; |
| 1125 | spinlock_t pause_map_lock; |
Nirav Shah | 617cff9 | 2016-04-25 10:24:24 +0530 | [diff] [blame] | 1126 | qdf_time_t start_time; |
| 1127 | qdf_time_t last_time; |
| 1128 | qdf_time_t total_pause_time; |
| 1129 | qdf_time_t total_unpause_time; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1130 | uint8_t history_index; |
| 1131 | struct hdd_netif_queue_history |
| 1132 | queue_oper_history[WLAN_HDD_MAX_HISTORY_ENTRY]; |
| 1133 | struct hdd_netif_queue_stats queue_oper_stats[WLAN_REASON_TYPE_MAX]; |
Dhanashri Atre | 168d2b4 | 2016-02-22 14:43:06 -0800 | [diff] [blame] | 1134 | ol_txrx_tx_fp tx_fn; |
Rajeev Kumar | dca5f81 | 2016-02-04 17:28:06 -0800 | [diff] [blame] | 1135 | /* debugfs entry */ |
| 1136 | struct dentry *debugfs_phy; |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 1137 | /* |
| 1138 | * The pre cac channel is saved here and will be used when the SAP's |
| 1139 | * channel needs to be moved from the existing 2.4GHz channel. |
| 1140 | */ |
| 1141 | uint8_t pre_cac_chan; |
Komal Seelam | a89be8d | 2016-09-29 11:09:26 +0530 | [diff] [blame] | 1142 | struct hdd_connect_pm_context connect_rpm_ctx; |
Deepak Dhamdhere | a278582 | 2016-11-17 01:17:45 -0800 | [diff] [blame] | 1143 | |
| 1144 | bool fast_roaming_allowed; |
Varun Reddy Yeturu | a578414 | 2017-03-10 12:11:44 -0800 | [diff] [blame] | 1145 | /* |
Abhishek Singh | 533c9da | 2017-05-04 10:23:34 +0530 | [diff] [blame] | 1146 | * Indicate if HO fails during disconnect so that |
| 1147 | * disconnect is not initiated by HDD as its already |
| 1148 | * initiated by CSR |
Varun Reddy Yeturu | a578414 | 2017-03-10 12:11:44 -0800 | [diff] [blame] | 1149 | */ |
Abhishek Singh | 533c9da | 2017-05-04 10:23:34 +0530 | [diff] [blame] | 1150 | bool roam_ho_fail; |
Sreelakshmi Konamki | 88a2a41 | 2017-04-14 15:11:55 +0530 | [diff] [blame] | 1151 | struct lfr_firmware_status lfr_fw_status; |
Ajit Pal Singh | 747b680 | 2017-05-24 15:42:03 +0530 | [diff] [blame] | 1152 | /* |
| 1153 | * Store the restrict_offchannel count |
| 1154 | * to cater to multiple application. |
| 1155 | */ |
| 1156 | u8 restrict_offchannel_cnt; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1157 | }; |
| 1158 | |
| 1159 | #define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station) |
| 1160 | #define WLAN_HDD_GET_AP_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap) |
| 1161 | #define WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.station.WextState) |
| 1162 | #define WLAN_HDD_GET_CTX(pAdapter) ((hdd_context_t *)pAdapter->pHddCtx) |
| 1163 | #define WLAN_HDD_GET_HAL_CTX(pAdapter) (((hdd_context_t *)(pAdapter->pHddCtx))->hHal) |
| 1164 | #define WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap.HostapdState) |
| 1165 | #define WLAN_HDD_GET_CFG_STATE_PTR(pAdapter) (&(pAdapter)->cfg80211State) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1166 | #define WLAN_HDD_GET_SAP_CTX_PTR(pAdapter) (pAdapter->sessionCtx.ap.sapContext) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1167 | #ifdef FEATURE_WLAN_TDLS |
| 1168 | #define WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter) \ |
Krunal Soni | 276241e | 2016-03-10 12:58:11 -0800 | [diff] [blame] | 1169 | (((QDF_STA_MODE != pAdapter->device_mode) && \ |
| 1170 | (QDF_P2P_CLIENT_MODE != pAdapter->device_mode)) ? 0 : 1) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1171 | #define WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter) \ |
| 1172 | ((WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter)) ? \ |
| 1173 | (tdlsCtx_t *)(pAdapter)->sessionCtx.station.pHddTdlsCtx : NULL) |
| 1174 | #endif |
| 1175 | |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 1176 | #ifdef WLAN_FEATURE_NAN_DATAPATH |
Naveen Rawat | 9750035 | 2017-03-22 10:07:58 -0700 | [diff] [blame] | 1177 | #ifndef WLAN_FEATURE_NAN_CONVERGENCE |
Deepak Dhamdhere | 8360d4c | 2016-06-01 13:24:31 -0700 | [diff] [blame] | 1178 | #define WLAN_HDD_GET_NDP_CTX_PTR(adapter) \ |
| 1179 | (&(adapter)->sessionCtx.station.ndp_ctx) |
Naveen Rawat | 9750035 | 2017-03-22 10:07:58 -0700 | [diff] [blame] | 1180 | #endif /* WLAN_FEATURE_NAN_CONVERGENCE */ |
Deepak Dhamdhere | 7e6016f | 2016-06-01 09:37:37 -0700 | [diff] [blame] | 1181 | #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] | 1182 | #else |
Deepak Dhamdhere | 8360d4c | 2016-06-01 13:24:31 -0700 | [diff] [blame] | 1183 | /* WLAN_HDD_GET_NDP_CTX_PTR and WLAN_HDD_GET_NDP_WEXT_STATE_PTR are not defined |
| 1184 | * intentionally so that all references to these must be within NDP code. |
| 1185 | * non-NDP code can call WLAN_HDD_IS_NDP_ENABLED(), and when it is enabled, |
| 1186 | * invoke NDP code to do all work. |
| 1187 | */ |
Deepak Dhamdhere | 7e6016f | 2016-06-01 09:37:37 -0700 | [diff] [blame] | 1188 | #define WLAN_HDD_IS_NDP_ENABLED(hdd_ctx) (false) |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 1189 | #endif |
| 1190 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1191 | /* Set mac address locally administered bit */ |
| 1192 | #define WLAN_HDD_RESET_LOCALLY_ADMINISTERED_BIT(macaddr) (macaddr[0] &= 0xFD) |
| 1193 | |
| 1194 | #define HDD_DEFAULT_MCC_P2P_QUOTA 70 |
| 1195 | #define HDD_RESET_MCC_P2P_QUOTA 50 |
| 1196 | |
| 1197 | typedef struct hdd_adapter_list_node { |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1198 | qdf_list_node_t node; /* MUST be first element */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1199 | hdd_adapter_t *pAdapter; |
| 1200 | } hdd_adapter_list_node_t; |
| 1201 | |
| 1202 | typedef struct hdd_priv_data_s { |
| 1203 | uint8_t *buf; |
| 1204 | int used_len; |
| 1205 | int total_len; |
| 1206 | } hdd_priv_data_t; |
| 1207 | |
| 1208 | #define MAX_MOD_LOGLEVEL 10 |
| 1209 | typedef struct { |
| 1210 | uint8_t enable; |
| 1211 | uint8_t dl_type; |
| 1212 | uint8_t dl_report; |
| 1213 | uint8_t dl_loglevel; |
| 1214 | uint8_t index; |
| 1215 | uint32_t dl_mod_loglevel[MAX_MOD_LOGLEVEL]; |
| 1216 | |
| 1217 | } fw_log_info; |
| 1218 | |
Archana Ramachandran | d41c3ed | 2016-02-10 15:48:06 -0800 | [diff] [blame] | 1219 | /** |
| 1220 | * enum antenna_mode - number of TX/RX chains |
| 1221 | * @HDD_ANTENNA_MODE_INVALID: Invalid mode place holder |
| 1222 | * @HDD_ANTENNA_MODE_1X1: Number of TX/RX chains equals 1 |
| 1223 | * @HDD_ANTENNA_MODE_2X2: Number of TX/RX chains equals 2 |
| 1224 | * @HDD_ANTENNA_MODE_MAX: Place holder for max mode |
| 1225 | */ |
| 1226 | enum antenna_mode { |
| 1227 | HDD_ANTENNA_MODE_INVALID, |
| 1228 | HDD_ANTENNA_MODE_1X1, |
| 1229 | HDD_ANTENNA_MODE_2X2, |
| 1230 | HDD_ANTENNA_MODE_MAX |
| 1231 | }; |
| 1232 | |
| 1233 | /** |
| 1234 | * enum smps_mode - SM power save mode |
| 1235 | * @HDD_SMPS_MODE_STATIC: Static power save |
| 1236 | * @HDD_SMPS_MODE_DYNAMIC: Dynamic power save |
| 1237 | * @HDD_SMPS_MODE_RESERVED: Reserved |
| 1238 | * @HDD_SMPS_MODE_DISABLED: Disable power save |
| 1239 | * @HDD_SMPS_MODE_MAX: Place holder for max mode |
| 1240 | */ |
| 1241 | enum smps_mode { |
| 1242 | HDD_SMPS_MODE_STATIC, |
| 1243 | HDD_SMPS_MODE_DYNAMIC, |
| 1244 | HDD_SMPS_MODE_RESERVED, |
| 1245 | HDD_SMPS_MODE_DISABLED, |
| 1246 | HDD_SMPS_MODE_MAX |
| 1247 | }; |
| 1248 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1249 | #ifdef WLAN_FEATURE_OFFLOAD_PACKETS |
| 1250 | /** |
| 1251 | * struct hdd_offloaded_packets - request id to pattern id mapping |
| 1252 | * @request_id: request id |
| 1253 | * @pattern_id: pattern id |
| 1254 | * |
| 1255 | */ |
| 1256 | struct hdd_offloaded_packets { |
| 1257 | uint32_t request_id; |
| 1258 | uint8_t pattern_id; |
| 1259 | }; |
| 1260 | |
| 1261 | /** |
| 1262 | * struct hdd_offloaded_packets_ctx - offloaded packets context |
| 1263 | * @op_table: request id to pattern id table |
| 1264 | * @op_lock: mutex lock |
| 1265 | */ |
| 1266 | struct hdd_offloaded_packets_ctx { |
| 1267 | struct hdd_offloaded_packets op_table[MAXNUM_PERIODIC_TX_PTRNS]; |
| 1268 | struct mutex op_lock; |
| 1269 | }; |
| 1270 | #endif |
| 1271 | |
Arun Khandavalli | 2476ef5 | 2016-04-26 20:19:43 +0530 | [diff] [blame] | 1272 | /** |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1273 | * enum driver_status: Driver Modules status |
| 1274 | * @DRIVER_MODULES_UNINITIALIZED: Driver CDS modules uninitialized |
| 1275 | * @DRIVER_MODULES_OPENED: Driver CDS modules opened |
| 1276 | * @DRIVER_MODULES_ENABLED: Driver CDS modules opened |
| 1277 | * @DRIVER_MODULES_CLOSED: Driver CDS modules closed |
| 1278 | */ |
| 1279 | enum driver_modules_status { |
| 1280 | DRIVER_MODULES_UNINITIALIZED, |
| 1281 | DRIVER_MODULES_OPENED, |
| 1282 | DRIVER_MODULES_ENABLED, |
| 1283 | DRIVER_MODULES_CLOSED |
| 1284 | }; |
| 1285 | |
Agrawal Ashish | 6563461 | 2016-08-18 13:24:32 +0530 | [diff] [blame] | 1286 | /** |
| 1287 | * struct acs_dfs_policy - Define ACS policies |
| 1288 | * @acs_dfs_mode: Dfs mode enabled/disabled. |
| 1289 | * @acs_channel: pre defined channel to avoid ACS. |
| 1290 | */ |
| 1291 | struct acs_dfs_policy { |
| 1292 | enum dfs_mode acs_dfs_mode; |
| 1293 | uint8_t acs_channel; |
| 1294 | }; |
| 1295 | |
Dustin Brown | 105d790 | 2016-10-03 16:27:59 -0700 | [diff] [blame] | 1296 | /** |
| 1297 | * enum suspend_fail_reason: Reasons a WLAN suspend might fail |
| 1298 | * SUSPEND_FAIL_IPA: IPA in progress |
| 1299 | * SUSPEND_FAIL_RADAR: radar scan in progress |
| 1300 | * SUSPEND_FAIL_ROAM: roaming in progress |
| 1301 | * SUSPEND_FAIL_SCAN: scan in progress |
| 1302 | * SUSPEND_FAIL_INITIAL_WAKEUP: received initial wakeup from firmware |
| 1303 | * SUSPEND_FAIL_MAX_COUNT: the number of wakeup reasons, always at the end |
| 1304 | */ |
| 1305 | enum suspend_fail_reason { |
| 1306 | SUSPEND_FAIL_IPA, |
| 1307 | SUSPEND_FAIL_RADAR, |
| 1308 | SUSPEND_FAIL_ROAM, |
| 1309 | SUSPEND_FAIL_SCAN, |
| 1310 | SUSPEND_FAIL_INITIAL_WAKEUP, |
| 1311 | SUSPEND_FAIL_MAX_COUNT |
| 1312 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1313 | |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 1314 | /** |
| 1315 | * suspend_resume_stats - Collection of counters for suspend/resume events |
| 1316 | * @suspends: number of suspends completed |
| 1317 | * @resumes: number of resumes completed |
| 1318 | * @suspend_fail: counters for failed suspend reasons |
| 1319 | */ |
| 1320 | struct suspend_resume_stats { |
| 1321 | uint32_t suspends; |
| 1322 | uint32_t resumes; |
| 1323 | uint32_t suspend_fail[SUSPEND_FAIL_MAX_COUNT]; |
| 1324 | }; |
| 1325 | |
Dustin Brown | 105d790 | 2016-10-03 16:27:59 -0700 | [diff] [blame] | 1326 | /** Adapter structure definition */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1327 | struct hdd_context_s { |
| 1328 | /** Global CDS context */ |
| 1329 | v_CONTEXT_t pcds_context; |
| 1330 | |
Selvaraj, Sridhar | 0672a12 | 2016-12-29 16:11:48 +0530 | [diff] [blame] | 1331 | struct wlan_objmgr_psoc *hdd_psoc; |
| 1332 | struct wlan_objmgr_pdev *hdd_pdev; |
| 1333 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1334 | /** HAL handle...*/ |
| 1335 | tHalHandle hHal; |
| 1336 | |
| 1337 | struct wiphy *wiphy; |
| 1338 | /* TODO Remove this from here. */ |
| 1339 | |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1340 | qdf_spinlock_t hdd_adapter_lock; |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1341 | qdf_list_t hddAdapters; /* List of adapters */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1342 | |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 1343 | /* One per STA: 1 for BCMC_STA_ID, 1 for each SAP_SELF_STA_ID, |
| 1344 | * 1 for WDS_STAID |
| 1345 | */ |
| 1346 | hdd_adapter_t *sta_to_adapter[WLAN_MAX_STA_COUNT + QDF_MAX_NO_OF_SAP_MODE + 2]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1347 | |
| 1348 | /** Pointer for firmware image data */ |
| 1349 | const struct firmware *fw; |
| 1350 | |
| 1351 | /** Pointer for configuration data */ |
| 1352 | const struct firmware *cfg; |
| 1353 | |
| 1354 | /** Pointer to the parent device */ |
| 1355 | struct device *parent_dev; |
| 1356 | |
| 1357 | /** Config values read from qcom_cfg.ini file */ |
| 1358 | struct hdd_config *config; |
| 1359 | |
| 1360 | struct wlan_hdd_ftm_status ftm; |
| 1361 | |
| 1362 | /* Completion variable to indicate Mc Thread Suspended */ |
| 1363 | struct completion mc_sus_event_var; |
| 1364 | |
Rajeev Kumar | eada0d0 | 2016-12-08 17:44:17 -0800 | [diff] [blame] | 1365 | bool is_scheduler_suspended; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1366 | |
| 1367 | #ifdef QCA_CONFIG_SMP |
| 1368 | bool is_ol_rx_thread_suspended; |
| 1369 | #endif |
| 1370 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1371 | bool hdd_wlan_suspended; |
| 1372 | bool suspended; |
| 1373 | |
| 1374 | /* Lock to avoid race condition during start/stop bss */ |
| 1375 | struct mutex sap_lock; |
| 1376 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1377 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1378 | /* OEM App registered or not */ |
| 1379 | bool oem_app_registered; |
| 1380 | |
| 1381 | /* OEM App Process ID */ |
| 1382 | int32_t oem_pid; |
| 1383 | #endif |
| 1384 | |
| 1385 | /** Concurrency Parameters*/ |
| 1386 | uint32_t concurrency_mode; |
| 1387 | |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1388 | uint8_t no_of_open_sessions[QDF_MAX_NO_OF_MODE]; |
| 1389 | uint8_t no_of_active_sessions[QDF_MAX_NO_OF_MODE]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1390 | |
| 1391 | /** P2P Device MAC Address for the adapter */ |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1392 | struct qdf_mac_addr p2pDeviceAddress; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1393 | |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1394 | qdf_wake_lock_t rx_wake_lock; |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1395 | qdf_wake_lock_t sap_wake_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1396 | |
| 1397 | #ifdef FEATURE_WLAN_TDLS |
Srinivas Girigowda | 17d3517 | 2017-03-25 15:56:25 -0700 | [diff] [blame] | 1398 | enum tdls_support_mode tdls_mode; |
| 1399 | enum tdls_support_mode tdls_mode_last; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1400 | tdlsConnInfo_t tdlsConnInfo[HDD_MAX_NUM_TDLS_STA]; |
| 1401 | /* maximum TDLS station number allowed upon runtime condition */ |
| 1402 | uint16_t max_num_tdls_sta; |
| 1403 | /* TDLS peer connected count */ |
| 1404 | uint16_t connected_peer_count; |
| 1405 | tdls_scan_context_t tdls_scan_ctxt; |
| 1406 | /* Lock to avoid race condition during TDLS operations */ |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 1407 | qdf_spinlock_t tdls_ct_spinlock; |
Ganesh Kondabattini | 5159c43 | 2016-12-26 20:07:33 +0530 | [diff] [blame] | 1408 | /* linear mac address table for counting the packets */ |
| 1409 | struct tdls_ct_mac_table ct_peer_mac_table[TDLS_CT_MAC_MAX_TABLE_SIZE]; |
| 1410 | /* number of valid mac entry in @ct_peer_mac_table */ |
| 1411 | uint8_t valid_mac_entries; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1412 | struct mutex tdls_lock; |
| 1413 | uint8_t tdls_off_channel; |
| 1414 | uint16_t tdls_channel_offset; |
Masti, Narayanraddi | c4a7ab8 | 2015-11-25 15:41:10 +0530 | [diff] [blame] | 1415 | int32_t tdls_fw_off_chan_mode; |
Kabilan Kannan | 36090ce | 2016-05-03 19:28:44 -0700 | [diff] [blame] | 1416 | bool enable_tdls_connection_tracker; |
| 1417 | uint8_t tdls_external_peer_count; |
Archana Ramachandran | d5d2e92 | 2016-04-20 16:57:35 -0700 | [diff] [blame] | 1418 | bool tdls_nss_switch_in_progress; |
Kabilan Kannan | ff89f74 | 2016-08-15 18:14:10 -0700 | [diff] [blame] | 1419 | bool tdls_nss_teardown_complete; |
| 1420 | enum tdls_nss_transition_type tdls_nss_transition_mode; |
Archana Ramachandran | d5d2e92 | 2016-04-20 16:57:35 -0700 | [diff] [blame] | 1421 | int32_t tdls_teardown_peers_cnt; |
Kabilan Kannan | 163fd0b | 2016-06-08 15:21:51 -0700 | [diff] [blame] | 1422 | struct tdls_set_state_info set_state_info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1423 | #endif |
| 1424 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1425 | void *hdd_ipa; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1426 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1427 | /* Use below lock to protect access to isSchedScanUpdatePending |
| 1428 | * since it will be accessed in two different contexts. |
| 1429 | */ |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1430 | qdf_spinlock_t sched_scan_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1431 | |
| 1432 | /* Flag keeps track of wiphy suspend/resume */ |
| 1433 | bool isWiphySuspended; |
| 1434 | |
| 1435 | /* Indicates about pending sched_scan results */ |
| 1436 | bool isSchedScanUpdatePending; |
| 1437 | |
| 1438 | #ifdef MSM_PLATFORM |
| 1439 | /* DDR bus bandwidth compute timer |
| 1440 | */ |
Poddar, Siddarth | 2333acb | 2017-01-09 16:45:39 +0530 | [diff] [blame] | 1441 | qdf_timer_t bus_bw_timer; |
Dustin Brown | fce08d1 | 2017-01-17 16:29:38 -0800 | [diff] [blame] | 1442 | bool bus_bw_timer_running; |
| 1443 | qdf_spinlock_t bus_bw_timer_lock; |
| 1444 | struct work_struct bus_bw_work; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1445 | int cur_vote_level; |
| 1446 | spinlock_t bus_bw_lock; |
| 1447 | int cur_rx_level; |
| 1448 | uint64_t prev_rx; |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 1449 | int cur_tx_level; |
| 1450 | uint64_t prev_tx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1451 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1452 | |
| 1453 | struct completion ready_to_suspend; |
| 1454 | /* defining the solution type */ |
| 1455 | uint32_t target_type; |
| 1456 | |
| 1457 | /* defining the firmware version */ |
| 1458 | uint32_t target_fw_version; |
Sandeep Puligilla | 3d6a8e2 | 2016-10-11 18:57:14 -0700 | [diff] [blame] | 1459 | uint32_t target_fw_vers_ext; |
Arif Hussain | 1969ec8 | 2016-07-08 10:37:01 -0700 | [diff] [blame] | 1460 | qdf_atomic_t dfs_radar_found; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1461 | |
| 1462 | /* defining the chip/rom version */ |
| 1463 | uint32_t target_hw_version; |
| 1464 | /* defining the chip/rom revision */ |
| 1465 | uint32_t target_hw_revision; |
| 1466 | /* chip/rom name */ |
| 1467 | const char *target_hw_name; |
| 1468 | struct regulatory reg; |
| 1469 | #ifdef FEATURE_WLAN_CH_AVOID |
| 1470 | uint16_t unsafe_channel_count; |
Amar Singhal | b8d4f15 | 2016-02-10 10:21:43 -0800 | [diff] [blame] | 1471 | uint16_t unsafe_channel_list[NUM_CHANNELS]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1472 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 1473 | |
| 1474 | uint8_t max_intf_count; |
| 1475 | uint8_t current_intf_count; |
| 1476 | #ifdef WLAN_FEATURE_LPSS |
| 1477 | uint8_t lpss_support; |
| 1478 | #endif |
| 1479 | uint8_t ap_arpns_support; |
| 1480 | tSirScanType ioctl_scan_mode; |
| 1481 | |
| 1482 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
Anurag Chouhan | 42958bb | 2016-02-19 15:43:11 +0530 | [diff] [blame] | 1483 | qdf_work_t sta_ap_intf_check_work; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1484 | #endif |
| 1485 | |
| 1486 | struct work_struct sap_start_work; |
| 1487 | bool is_sap_restart_required; |
| 1488 | bool is_sta_connection_pending; |
Manishekar Chandrasekaran | 7f63d05 | 2016-05-07 09:54:00 +0530 | [diff] [blame] | 1489 | qdf_spinlock_t sap_update_info_lock; |
| 1490 | qdf_spinlock_t sta_update_info_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1491 | |
| 1492 | uint8_t dev_dfs_cac_status; |
| 1493 | |
| 1494 | bool btCoexModeSet; |
| 1495 | #ifdef FEATURE_GREEN_AP |
| 1496 | struct hdd_green_ap_ctx *green_ap_ctx; |
| 1497 | #endif |
| 1498 | fw_log_info fw_log_settings; |
| 1499 | #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 1500 | qdf_mc_timer_t skip_acs_scan_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1501 | uint8_t skip_acs_scan_status; |
Liangwei Dong | aef8434 | 2016-10-21 05:28:00 -0400 | [diff] [blame] | 1502 | uint8_t *last_acs_channel_list; |
| 1503 | uint8_t num_of_channels; |
| 1504 | qdf_spinlock_t acs_skip_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1505 | #endif |
| 1506 | |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1507 | qdf_wake_lock_t sap_dfs_wakelock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1508 | atomic_t sap_dfs_ref_cnt; |
| 1509 | |
| 1510 | #ifdef WLAN_FEATURE_EXTWOW_SUPPORT |
| 1511 | bool is_extwow_app_type1_param_set; |
| 1512 | bool is_extwow_app_type2_param_set; |
| 1513 | bool ext_wow_should_suspend; |
| 1514 | struct completion ready_to_extwow; |
| 1515 | #endif |
| 1516 | |
| 1517 | /* Time since boot up to extscan start (in micro seconds) */ |
| 1518 | uint64_t ext_scan_start_since_boot; |
| 1519 | unsigned long g_event_flags; |
| 1520 | /* RoC request queue and work */ |
| 1521 | struct delayed_work roc_req_work; |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1522 | qdf_spinlock_t hdd_roc_req_q_lock; |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1523 | qdf_list_t hdd_roc_req_q; |
Sandeep Puligilla | d000421 | 2017-02-26 18:34:56 -0800 | [diff] [blame] | 1524 | #ifndef NAPIER_SCAN |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1525 | qdf_spinlock_t hdd_scan_req_q_lock; |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 1526 | qdf_list_t hdd_scan_req_q; |
Sandeep Puligilla | d000421 | 2017-02-26 18:34:56 -0800 | [diff] [blame] | 1527 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1528 | uint8_t miracast_value; |
Sravan Kumar Kairam | fece87f | 2016-07-26 14:58:28 +0530 | [diff] [blame] | 1529 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1530 | #ifdef WLAN_NS_OFFLOAD |
| 1531 | /* IPv6 notifier callback for handling NS offload on change in IP */ |
| 1532 | struct notifier_block ipv6_notifier; |
| 1533 | #endif |
Sravan Kumar Kairam | fece87f | 2016-07-26 14:58:28 +0530 | [diff] [blame] | 1534 | bool ns_offload_enable; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1535 | /* IPv4 notifier callback for handling ARP offload on change in IP */ |
| 1536 | struct notifier_block ipv4_notifier; |
| 1537 | |
| 1538 | /* number of rf chains supported by target */ |
| 1539 | uint32_t num_rf_chains; |
| 1540 | /* Is htTxSTBC supported by target */ |
| 1541 | uint8_t ht_tx_stbc_supported; |
| 1542 | #ifdef WLAN_FEATURE_OFFLOAD_PACKETS |
| 1543 | struct hdd_offloaded_packets_ctx op_ctx; |
| 1544 | #endif |
| 1545 | bool mcc_mode; |
| 1546 | #ifdef WLAN_FEATURE_MEMDUMP |
| 1547 | uint8_t *fw_dump_loc; |
| 1548 | uint32_t dump_loc_paddr; |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 1549 | qdf_mc_timer_t memdump_cleanup_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1550 | struct mutex memdump_lock; |
| 1551 | bool memdump_in_progress; |
Sachin Ahuja | 02dd2e7 | 2016-09-03 16:17:51 +0530 | [diff] [blame] | 1552 | bool memdump_init_done; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1553 | #endif /* WLAN_FEATURE_MEMDUMP */ |
Padma, Santhosh Kumar | 9aba02f | 2016-08-11 16:30:25 +0530 | [diff] [blame] | 1554 | uint16_t driver_dump_size; |
| 1555 | uint8_t *driver_dump_mem; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1556 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1557 | bool connection_in_progress; |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1558 | qdf_spinlock_t connection_status_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1559 | |
| 1560 | uint16_t hdd_txrx_hist_idx; |
Nirav Shah | ed34b21 | 2016-04-25 10:59:16 +0530 | [diff] [blame] | 1561 | struct hdd_tx_rx_histogram *hdd_txrx_hist; |
Arif Hussain | 1969ec8 | 2016-07-08 10:37:01 -0700 | [diff] [blame] | 1562 | |
Krunal Soni | e353194 | 2016-04-12 17:43:53 -0700 | [diff] [blame] | 1563 | /* |
| 1564 | * place to store FTM capab of target. This allows changing of FTM capab |
| 1565 | * at runtime and intersecting it with target capab before updating. |
| 1566 | */ |
| 1567 | uint32_t fine_time_meas_cap_target; |
Ravi Joshi | b89e7f7 | 2016-09-07 13:43:15 -0700 | [diff] [blame] | 1568 | uint32_t rx_high_ind_cnt; |
Archana Ramachandran | d41c3ed | 2016-02-10 15:48:06 -0800 | [diff] [blame] | 1569 | /* completion variable to indicate set antenna mode complete*/ |
| 1570 | struct completion set_antenna_mode_cmpl; |
| 1571 | /* Current number of TX X RX chains being used */ |
| 1572 | enum antenna_mode current_antenna_mode; |
Arun Khandavalli | 2476ef5 | 2016-04-26 20:19:43 +0530 | [diff] [blame] | 1573 | bool bpf_enabled; |
Ryan Hsu | ceddceb | 2016-04-28 10:20:14 -0700 | [diff] [blame] | 1574 | |
| 1575 | /* the radio index assigned by cnss_logger */ |
| 1576 | int radio_index; |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 1577 | qdf_work_t sap_pre_cac_work; |
Nirav Shah | ffc6a09 | 2016-06-09 16:09:08 +0530 | [diff] [blame] | 1578 | bool hbw_requested; |
Kapil Gupta | 0ed58dc | 2016-04-22 15:35:26 +0530 | [diff] [blame] | 1579 | uint32_t last_nil_scan_bug_report_timestamp; |
Deepak Dhamdhere | 7e6016f | 2016-06-01 09:37:37 -0700 | [diff] [blame] | 1580 | #ifdef WLAN_FEATURE_NAN_DATAPATH |
| 1581 | bool nan_datapath_enabled; |
| 1582 | #endif |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1583 | /* Present state of driver cds modules */ |
| 1584 | enum driver_modules_status driver_status; |
| 1585 | /* MC timer interface change */ |
| 1586 | qdf_mc_timer_t iface_change_timer; |
| 1587 | /* Interface change lock */ |
| 1588 | struct mutex iface_change_lock; |
Nirav Shah | bd36b06 | 2016-07-18 11:12:59 +0530 | [diff] [blame] | 1589 | bool rps; |
| 1590 | bool enableRxThread; |
| 1591 | bool napi_enable; |
Arun Khandavalli | a172c3e | 2016-08-26 17:33:13 +0530 | [diff] [blame] | 1592 | bool stop_modules_in_progress; |
| 1593 | bool start_modules_in_progress; |
Yuanyuan Liu | 245a3e4 | 2016-09-14 12:15:16 -0700 | [diff] [blame] | 1594 | bool update_mac_addr_to_fw; |
Agrawal Ashish | 6563461 | 2016-08-18 13:24:32 +0530 | [diff] [blame] | 1595 | struct acs_dfs_policy acs_policy; |
Rajeev Kumar Sirasanagandla | 4787300 | 2016-09-09 13:46:09 +0530 | [diff] [blame] | 1596 | uint16_t wmi_max_len; |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 1597 | struct suspend_resume_stats suspend_resume_stats; |
Komal Seelam | 8634b77 | 2016-09-29 12:12:24 +0530 | [diff] [blame] | 1598 | struct hdd_runtime_pm_context runtime_context; |
Nitesh Shah | 61c10d9 | 2016-10-19 19:29:15 +0530 | [diff] [blame] | 1599 | bool roaming_in_progress; |
Kapil Gupta | 4f0c0c1 | 2017-02-07 15:21:15 +0530 | [diff] [blame] | 1600 | struct scan_chan_info *chan_info; |
| 1601 | struct mutex chan_info_lock; |
Nitesh Shah | 2b946fa | 2016-10-19 17:05:09 +0530 | [diff] [blame] | 1602 | /* bit map to set/reset TDLS by different sources */ |
| 1603 | unsigned long tdls_source_bitmap; |
Nitesh Shah | 61c10d9 | 2016-10-19 19:29:15 +0530 | [diff] [blame] | 1604 | /* tdls source timer to enable/disable TDLS on p2p listen */ |
| 1605 | qdf_mc_timer_t tdls_source_timer; |
Kabilan Kannan | 1c1c402 | 2017-04-06 22:49:26 -0700 | [diff] [blame] | 1606 | bool tdls_umac_comp_active; |
Kabilan Kannan | 256e318 | 2017-05-02 16:02:37 -0700 | [diff] [blame] | 1607 | bool tdls_nap_active; |
Padma, Santhosh Kumar | 31bac74 | 2017-01-16 19:34:45 +0530 | [diff] [blame] | 1608 | uint8_t beacon_probe_rsp_cnt_per_scan; |
Sreelakshmi Konamki | b53c629 | 2017-03-01 13:13:23 +0530 | [diff] [blame] | 1609 | uint8_t last_scan_reject_session_id; |
| 1610 | enum scan_reject_states last_scan_reject_reason; |
| 1611 | unsigned long last_scan_reject_timestamp; |
Arif Hussain | 759a023 | 2017-03-20 13:17:18 -0700 | [diff] [blame] | 1612 | bool dfs_cac_offload; |
Amar Singhal | 5cccafe | 2017-02-15 12:42:58 -0800 | [diff] [blame] | 1613 | bool reg_offload; |
Ajit Pal Singh | 2c7aecd | 2017-05-19 15:09:23 +0530 | [diff] [blame] | 1614 | #ifdef FEATURE_WLAN_CH_AVOID |
| 1615 | tHddAvoidFreqList coex_avoid_freq_list; |
| 1616 | tHddAvoidFreqList dnbs_avoid_freq_list; |
| 1617 | /* Lock to control access to dnbs and coex avoid freq list */ |
| 1618 | struct mutex avoid_freq_lock; |
| 1619 | #endif |
Yu Wang | f5d5b5f | 2017-05-25 22:38:32 +0800 | [diff] [blame^] | 1620 | #ifdef WLAN_FEATURE_TSF |
| 1621 | /* indicate whether tsf has been initialized */ |
| 1622 | qdf_atomic_t tsf_ready_flag; |
| 1623 | /* indicate whether it's now capturing tsf(updating tstamp-pair) */ |
| 1624 | qdf_atomic_t cap_tsf_flag; |
| 1625 | /* the context that is capturing tsf */ |
| 1626 | hdd_adapter_t *cap_tsf_context; |
| 1627 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1628 | }; |
| 1629 | |
Kapil Gupta | 086c620 | 2016-12-11 18:17:06 +0530 | [diff] [blame] | 1630 | /** |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 1631 | * struct hdd_vendor_acs_chan_params - vendor acs channel parameters |
| 1632 | * @channel_count: channel count |
| 1633 | * @channel_list: pointer to channel list |
Jayachandran Sreekumaran | 68c952c | 2017-04-24 12:42:03 +0530 | [diff] [blame] | 1634 | * @pcl_count: pcl list count |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 1635 | * @vendor_pcl_list: pointer to pcl list |
| 1636 | * @vendor_weight_list: pointer to pcl weight list |
| 1637 | */ |
| 1638 | struct hdd_vendor_acs_chan_params { |
| 1639 | uint32_t channel_count; |
| 1640 | uint8_t *channel_list; |
Jayachandran Sreekumaran | 68c952c | 2017-04-24 12:42:03 +0530 | [diff] [blame] | 1641 | uint32_t pcl_count; |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 1642 | uint8_t *vendor_pcl_list; |
| 1643 | uint8_t *vendor_weight_list; |
| 1644 | }; |
| 1645 | |
| 1646 | /** |
| 1647 | * struct hdd_external_acs_timer_context - acs timer context |
| 1648 | * @reason: reason for acs trigger |
| 1649 | * @adapter: hdd adapter for acs |
| 1650 | */ |
| 1651 | struct hdd_external_acs_timer_context { |
| 1652 | int8_t reason; |
| 1653 | hdd_adapter_t *adapter; |
| 1654 | }; |
| 1655 | |
| 1656 | /** |
| 1657 | * struct hdd_vendor_chan_info - vendor channel info |
Kapil Gupta | 63e7528 | 2017-05-18 20:55:10 +0530 | [diff] [blame] | 1658 | * @band: channel operating band |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 1659 | * @pri_ch: primary channel |
| 1660 | * @ht_sec_ch: secondary channel |
| 1661 | * @vht_seg0_center_ch: segment0 for vht |
| 1662 | * @vht_seg1_center_ch: vht segment 1 |
| 1663 | * @chan_width: channel width |
| 1664 | */ |
| 1665 | struct hdd_vendor_chan_info { |
Kapil Gupta | 63e7528 | 2017-05-18 20:55:10 +0530 | [diff] [blame] | 1666 | uint8_t band; |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 1667 | uint8_t pri_ch; |
| 1668 | uint8_t ht_sec_ch; |
| 1669 | uint8_t vht_seg0_center_ch; |
| 1670 | uint8_t vht_seg1_center_ch; |
| 1671 | uint8_t chan_width; |
| 1672 | }; |
| 1673 | |
| 1674 | /** |
Kapil Gupta | 086c620 | 2016-12-11 18:17:06 +0530 | [diff] [blame] | 1675 | * struct hdd_channel_info - standard channel info |
| 1676 | * @freq: Freq in Mhz |
| 1677 | * @flags: channel info flags |
| 1678 | * @flagext: extended channel info flags |
| 1679 | * @ieee_chan_number: channel number |
| 1680 | * @max_reg_power: max tx power according to regulatory |
| 1681 | * @max_radio_power: max radio power |
| 1682 | * @min_radio_power: min radio power |
| 1683 | * @reg_class_id: regulatory class |
| 1684 | * @max_antenna_gain: max antenna gain allowed on channel |
| 1685 | * @vht_center_freq_seg0: vht center freq segment 0 |
| 1686 | * @vht_center_freq_seg1: vht center freq segment 1 |
| 1687 | */ |
| 1688 | struct hdd_channel_info { |
| 1689 | u_int16_t freq; |
| 1690 | u_int32_t flags; |
| 1691 | u_int16_t flagext; |
| 1692 | u_int8_t ieee_chan_number; |
| 1693 | int8_t max_reg_power; |
| 1694 | int8_t max_radio_power; |
| 1695 | int8_t min_radio_power; |
| 1696 | u_int8_t reg_class_id; |
| 1697 | u_int8_t max_antenna_gain; |
| 1698 | u_int8_t vht_center_freq_seg0; |
| 1699 | u_int8_t vht_center_freq_seg1; |
| 1700 | }; |
| 1701 | |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 1702 | /* |
| 1703 | * Function declarations and documentation |
| 1704 | */ |
Chandrasekaran, Manishekar | 794a098 | 2016-01-12 19:42:20 +0530 | [diff] [blame] | 1705 | int hdd_validate_channel_and_bandwidth(hdd_adapter_t *adapter, |
| 1706 | uint32_t chan_number, |
Kiran Kumar Lokere | 1364467 | 2016-02-29 15:40:10 -0800 | [diff] [blame] | 1707 | enum phy_ch_width chan_bw); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1708 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
| 1709 | void wlan_hdd_check_sta_ap_concurrent_ch_intf(void *sta_pAdapter); |
| 1710 | #endif |
| 1711 | |
| 1712 | const char *hdd_device_mode_to_string(uint8_t device_mode); |
| 1713 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1714 | QDF_STATUS hdd_get_front_adapter(hdd_context_t *pHddCtx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1715 | hdd_adapter_list_node_t **ppAdapterNode); |
| 1716 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1717 | QDF_STATUS hdd_get_next_adapter(hdd_context_t *pHddCtx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1718 | hdd_adapter_list_node_t *pAdapterNode, |
| 1719 | hdd_adapter_list_node_t **pNextAdapterNode); |
| 1720 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1721 | QDF_STATUS hdd_remove_adapter(hdd_context_t *pHddCtx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1722 | hdd_adapter_list_node_t *pAdapterNode); |
| 1723 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1724 | QDF_STATUS hdd_remove_front_adapter(hdd_context_t *pHddCtx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1725 | hdd_adapter_list_node_t **ppAdapterNode); |
| 1726 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1727 | QDF_STATUS hdd_add_adapter_back(hdd_context_t *pHddCtx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1728 | hdd_adapter_list_node_t *pAdapterNode); |
| 1729 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1730 | QDF_STATUS hdd_add_adapter_front(hdd_context_t *pHddCtx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1731 | hdd_adapter_list_node_t *pAdapterNode); |
| 1732 | |
| 1733 | hdd_adapter_t *hdd_open_adapter(hdd_context_t *pHddCtx, uint8_t session_type, |
| 1734 | const char *name, tSirMacAddr macAddr, |
Ryan Hsu | 07495ea | 2016-01-21 15:25:39 -0800 | [diff] [blame] | 1735 | unsigned char name_assign_type, |
Prashanth Bhatta | 98f04d2 | 2016-01-08 16:46:21 -0800 | [diff] [blame] | 1736 | bool rtnl_held); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1737 | 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] | 1738 | bool rtnl_held); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1739 | QDF_STATUS hdd_close_all_adapters(hdd_context_t *pHddCtx, bool rtnl_held); |
| 1740 | QDF_STATUS hdd_stop_all_adapters(hdd_context_t *pHddCtx); |
Hanumanth Reddy Pothula | 9f4048f | 2016-09-30 15:06:57 +0530 | [diff] [blame] | 1741 | void hdd_deinit_all_adapters(hdd_context_t *hdd_ctx, bool rtnl_held); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1742 | QDF_STATUS hdd_reset_all_adapters(hdd_context_t *pHddCtx); |
| 1743 | QDF_STATUS hdd_start_all_adapters(hdd_context_t *pHddCtx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1744 | hdd_adapter_t *hdd_get_adapter_by_vdev(hdd_context_t *pHddCtx, |
| 1745 | uint32_t vdev_id); |
| 1746 | hdd_adapter_t *hdd_get_adapter_by_macaddr(hdd_context_t *pHddCtx, |
| 1747 | tSirMacAddr macAddr); |
Dustin Brown | d28772b | 2017-03-17 14:16:07 -0700 | [diff] [blame] | 1748 | |
| 1749 | int hdd_vdev_create(hdd_adapter_t *adapter); |
| 1750 | int hdd_vdev_destroy(hdd_adapter_t *adapter); |
| 1751 | int hdd_vdev_ready(hdd_adapter_t *adapter); |
| 1752 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1753 | QDF_STATUS hdd_init_station_mode(hdd_adapter_t *pAdapter); |
Krunal Soni | 276241e | 2016-03-10 12:58:11 -0800 | [diff] [blame] | 1754 | hdd_adapter_t *hdd_get_adapter(hdd_context_t *pHddCtx, |
| 1755 | enum tQDF_ADAPTER_MODE mode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1756 | void hdd_deinit_adapter(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, |
| 1757 | bool rtnl_held); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1758 | 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] | 1759 | const bool bCloseSession); |
| 1760 | void hdd_set_station_ops(struct net_device *pWlanDev); |
| 1761 | uint8_t *wlan_hdd_get_intf_addr(hdd_context_t *pHddCtx); |
| 1762 | 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] | 1763 | uint8_t hdd_get_operating_channel(hdd_context_t *pHddCtx, |
| 1764 | enum tQDF_ADAPTER_MODE mode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1765 | |
Prashanth Bhatta | 05aaf01 | 2015-12-10 17:34:24 -0800 | [diff] [blame] | 1766 | void hdd_set_conparam(uint32_t con_param); |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1767 | enum tQDF_GLOBAL_CON_MODE hdd_get_conparam(void); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1768 | |
| 1769 | void hdd_abort_mac_scan(hdd_context_t *pHddCtx, uint8_t sessionId, |
yeshwanth sriram guntuka | 310b3ac | 2016-11-15 23:25:26 +0530 | [diff] [blame] | 1770 | uint32_t scan_id, eCsrAbortReason reason); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1771 | void hdd_cleanup_actionframe(hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter); |
| 1772 | |
| 1773 | void crda_regulatory_entry_default(uint8_t *countryCode, int domain_id); |
| 1774 | void wlan_hdd_reset_prob_rspies(hdd_adapter_t *pHostapdAdapter); |
| 1775 | void hdd_prevent_suspend(uint32_t reason); |
| 1776 | void hdd_allow_suspend(uint32_t reason); |
| 1777 | void hdd_prevent_suspend_timeout(uint32_t timeout, uint32_t reason); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1778 | |
| 1779 | void wlan_hdd_cfg80211_update_wiphy_caps(struct wiphy *wiphy); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1780 | QDF_STATUS hdd_set_ibss_power_save_params(hdd_adapter_t *pAdapter); |
| 1781 | QDF_STATUS wlan_hdd_restart_driver(hdd_context_t *pHddCtx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1782 | void hdd_exchange_version_and_caps(hdd_context_t *pHddCtx); |
| 1783 | int wlan_hdd_validate_context(hdd_context_t *pHddCtx); |
Dustin Brown | f13b8c3 | 2017-05-19 17:23:08 -0700 | [diff] [blame] | 1784 | |
| 1785 | /** |
| 1786 | * hdd_validate_adapter() - Validate the given adapter |
| 1787 | * @adapter: the adapter to validate |
| 1788 | * |
| 1789 | * This function validates the given adapter, and ensures that it is open. |
| 1790 | * |
| 1791 | * Return: Errno |
| 1792 | */ |
| 1793 | int hdd_validate_adapter(hdd_adapter_t *adapter); |
| 1794 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1795 | bool hdd_is_valid_mac_address(const uint8_t *pMacAddr); |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1796 | QDF_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *pHddCtx); |
Arun Khandavalli | ca892f6 | 2017-05-26 14:25:50 +0530 | [diff] [blame] | 1797 | bool wlan_hdd_validate_modules_state(hdd_context_t *hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1798 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 1799 | struct qdf_mac_addr * |
| 1800 | hdd_wlan_get_ibss_mac_addr_from_staid(hdd_adapter_t *pAdapter, |
| 1801 | uint8_t staIdx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1802 | void hdd_checkandupdate_phymode(hdd_context_t *pHddCtx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1803 | #ifdef MSM_PLATFORM |
Dustin Brown | 5ec6b55 | 2017-03-31 12:11:40 -0700 | [diff] [blame] | 1804 | /** |
| 1805 | * hdd_bus_bw_compute_timer_start() - start the bandwidth timer |
| 1806 | * @hdd_ctx: the global hdd context |
| 1807 | * |
| 1808 | * Return: None |
| 1809 | */ |
| 1810 | void hdd_bus_bw_compute_timer_start(hdd_context_t *hdd_ctx); |
| 1811 | |
| 1812 | /** |
| 1813 | * hdd_bus_bw_compute_timer_try_start() - try to start the bandwidth timer |
| 1814 | * @hdd_ctx: the global hdd context |
| 1815 | * |
| 1816 | * This function ensures there is at least one adapter in the associated state |
| 1817 | * before starting the bandwidth timer. |
| 1818 | * |
| 1819 | * Return: None |
| 1820 | */ |
| 1821 | void hdd_bus_bw_compute_timer_try_start(hdd_context_t *hdd_ctx); |
| 1822 | |
| 1823 | /** |
| 1824 | * hdd_bus_bw_compute_timer_stop() - stop the bandwidth timer |
| 1825 | * @hdd_ctx: the global hdd context |
| 1826 | * |
| 1827 | * Return: None |
| 1828 | */ |
| 1829 | void hdd_bus_bw_compute_timer_stop(hdd_context_t *hdd_ctx); |
| 1830 | |
| 1831 | /** |
| 1832 | * hdd_bus_bw_compute_timer_try_stop() - try to stop the bandwidth timer |
| 1833 | * @hdd_ctx: the global hdd context |
| 1834 | * |
| 1835 | * This function ensures there are no adapters in the associated state before |
| 1836 | * stopping the bandwidth timer. |
| 1837 | * |
| 1838 | * Return: None |
| 1839 | */ |
| 1840 | void hdd_bus_bw_compute_timer_try_stop(hdd_context_t *hdd_ctx); |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 1841 | |
| 1842 | /** |
| 1843 | * hdd_bus_bandwidth_init() - Initialize bus bandwidth data structures. |
| 1844 | * hdd_ctx: HDD context |
| 1845 | * |
| 1846 | * Initialize bus bandwidth related data structures like spinlock and timer. |
| 1847 | * |
| 1848 | * Return: None. |
| 1849 | */ |
| 1850 | int hdd_bus_bandwidth_init(hdd_context_t *hdd_ctx); |
| 1851 | |
| 1852 | /** |
| 1853 | * hdd_bus_bandwidth_destroy() - Destroy bus bandwidth data structures. |
| 1854 | * hdd_ctx: HDD context |
| 1855 | * |
| 1856 | * Destroy bus bandwidth related data structures like timer. |
| 1857 | * |
| 1858 | * Return: None. |
| 1859 | */ |
| 1860 | void hdd_bus_bandwidth_destroy(hdd_context_t *hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1861 | #else |
Dustin Brown | 5ec6b55 | 2017-03-31 12:11:40 -0700 | [diff] [blame] | 1862 | |
| 1863 | static inline void hdd_bus_bw_compute_timer_start(hdd_context_t *hdd_ctx) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1864 | { |
Dustin Brown | 5ec6b55 | 2017-03-31 12:11:40 -0700 | [diff] [blame] | 1865 | } |
| 1866 | |
| 1867 | static inline void hdd_bus_bw_compute_timer_try_start(hdd_context_t *hdd_ctx) |
| 1868 | { |
| 1869 | } |
| 1870 | |
| 1871 | static inline void hdd_bus_bw_compute_timer_stop(hdd_context_t *hdd_ctx) |
| 1872 | { |
| 1873 | } |
| 1874 | |
| 1875 | static inline void hdd_bus_bw_compute_timer_try_stop(hdd_context_t *hdd_ctx) |
| 1876 | { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1877 | } |
| 1878 | |
| 1879 | static inline void hdd_stop_bus_bw_computer_timer(hdd_adapter_t *pAdapter) |
| 1880 | { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1881 | } |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 1882 | |
Leo Chang | fdb45c3 | 2016-10-28 11:09:23 -0700 | [diff] [blame] | 1883 | static inline int hdd_bus_bandwidth_init(hdd_context_t *hdd_ctx) |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 1884 | { |
| 1885 | return 0; |
| 1886 | } |
| 1887 | |
Leo Chang | fdb45c3 | 2016-10-28 11:09:23 -0700 | [diff] [blame] | 1888 | static inline void hdd_bus_bandwidth_destroy(hdd_context_t *hdd_ctx) |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 1889 | { |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 1890 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1891 | #endif |
| 1892 | |
Ashish Kumar Dhanotiya | 53c2f69 | 2017-02-08 00:25:11 +0530 | [diff] [blame] | 1893 | int hdd_qdf_trace_enable(QDF_MODULE_ID module_id, uint32_t bitmask); |
| 1894 | |
Prashanth Bhatta | 5da711e | 2015-11-30 14:28:52 -0800 | [diff] [blame] | 1895 | int hdd_init(void); |
| 1896 | void hdd_deinit(void); |
| 1897 | |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1898 | int hdd_wlan_startup(struct device *dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1899 | void __hdd_wlan_exit(void); |
| 1900 | int hdd_wlan_notify_modem_power_state(int state); |
| 1901 | #ifdef QCA_HT_2040_COEX |
| 1902 | 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] | 1903 | struct qdf_mac_addr macAddrSTA, int width); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1904 | #endif |
| 1905 | |
Kondabattini, Ganesh | 96ac37b | 2016-09-02 23:12:15 +0530 | [diff] [blame] | 1906 | 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] | 1907 | #ifdef FEATURE_WLAN_AUTO_SHUTDOWN |
| 1908 | void wlan_hdd_auto_shutdown_enable(hdd_context_t *hdd_ctx, bool enable); |
| 1909 | #endif |
| 1910 | |
| 1911 | hdd_adapter_t *hdd_get_con_sap_adapter(hdd_adapter_t *this_sap_adapter, |
| 1912 | bool check_start_bss); |
| 1913 | |
| 1914 | bool hdd_is_5g_supported(hdd_context_t *pHddCtx); |
| 1915 | |
| 1916 | int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter); |
| 1917 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1918 | void hdd_get_fw_version(hdd_context_t *hdd_ctx, |
| 1919 | uint32_t *major_spid, uint32_t *minor_spid, |
| 1920 | uint32_t *siid, uint32_t *crmid); |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 1921 | /** |
| 1922 | * hdd_acs_response_timeout_handler() - timeout handler for acs_timer |
| 1923 | * @context : timeout handler context |
| 1924 | * |
| 1925 | * Return: None |
| 1926 | */ |
| 1927 | void hdd_acs_response_timeout_handler(void *context); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1928 | |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 1929 | /** |
| 1930 | * wlan_hdd_cfg80211_start_acs(): Start ACS Procedure for SAP |
| 1931 | * @adapter: pointer to SAP adapter struct |
| 1932 | * |
| 1933 | * This function starts the ACS procedure if there are no |
| 1934 | * constraints like MBSSID DFS restrictions. |
| 1935 | * |
| 1936 | * Return: Status of ACS Start procedure |
| 1937 | */ |
| 1938 | int wlan_hdd_cfg80211_start_acs(hdd_adapter_t *adapter); |
| 1939 | |
| 1940 | /** |
| 1941 | * hdd_cfg80211_update_acs_config() - update acs config to application |
| 1942 | * @adapter: hdd adapter |
| 1943 | * @reason: channel change reason |
| 1944 | * |
| 1945 | * Return: none |
| 1946 | */ |
| 1947 | void hdd_cfg80211_update_acs_config(hdd_adapter_t *adapter, |
| 1948 | uint8_t reason); |
| 1949 | /** |
| 1950 | * hdd_update_acs_timer_reason() - update acs timer start reason |
| 1951 | * @adapter: hdd adapter |
| 1952 | * @reason: channel change reason |
| 1953 | * |
| 1954 | * Return: 0 for success |
| 1955 | */ |
| 1956 | int hdd_update_acs_timer_reason(hdd_adapter_t *adapter, uint8_t reason); |
| 1957 | |
| 1958 | /** |
Tushnim Bhattacharyya | 9e81b4c | 2017-02-15 17:11:14 -0800 | [diff] [blame] | 1959 | * hdd_switch_sap_channel() - Move SAP to the given channel |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 1960 | * @adapter: AP adapter |
| 1961 | * @channel: Channel |
| 1962 | * |
Tushnim Bhattacharyya | 9e81b4c | 2017-02-15 17:11:14 -0800 | [diff] [blame] | 1963 | * Moves the SAP interface by invoking the function which |
| 1964 | * executes the callback to perform channel switch using (E)CSA. |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 1965 | * |
| 1966 | * Return: None |
| 1967 | */ |
Tushnim Bhattacharyya | 9e81b4c | 2017-02-15 17:11:14 -0800 | [diff] [blame] | 1968 | void hdd_switch_sap_channel(hdd_adapter_t *adapter, uint8_t channel); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1969 | #ifdef WLAN_FEATURE_MEMDUMP |
| 1970 | /** |
| 1971 | * hdd_is_memdump_supported() - to check if memdump feature support |
| 1972 | * |
| 1973 | * This function is used to check if memdump feature is supported in |
| 1974 | * the host driver |
| 1975 | * |
| 1976 | * Return: true if supported and false otherwise |
| 1977 | */ |
| 1978 | static inline bool hdd_is_memdump_supported(void) |
| 1979 | { |
| 1980 | return true; |
| 1981 | } |
| 1982 | #else |
| 1983 | static inline bool hdd_is_memdump_supported(void) |
| 1984 | { |
| 1985 | return false; |
| 1986 | } |
| 1987 | #endif /* WLAN_FEATURE_MEMDUMP */ |
| 1988 | |
| 1989 | void hdd_update_macaddr(struct hdd_config *config, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1990 | struct qdf_mac_addr hw_macaddr); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1991 | void wlan_hdd_disable_roaming(hdd_adapter_t *pAdapter); |
| 1992 | void wlan_hdd_enable_roaming(hdd_adapter_t *pAdapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1993 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1994 | QDF_STATUS hdd_post_cds_enable_config(hdd_context_t *pHddCtx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1995 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1996 | 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] | 1997 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 1998 | 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] | 1999 | hdd_adapter_t *ap_adapter, |
| 2000 | tCsrRoamProfile *roam_profile, |
| 2001 | tScanResultHandle *scan_cache, |
| 2002 | bool *concurrent_chnl_same); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2003 | void wlan_hdd_stop_sap(hdd_adapter_t *ap_adapter); |
Arun Khandavalli | cc544b3 | 2017-01-30 19:52:16 +0530 | [diff] [blame] | 2004 | void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter, bool reinit); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2005 | |
Archana Ramachandran | d41c3ed | 2016-02-10 15:48:06 -0800 | [diff] [blame] | 2006 | void wlan_hdd_soc_set_antenna_mode_cb(enum set_antenna_mode_status status); |
| 2007 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2008 | #ifdef QCA_CONFIG_SMP |
| 2009 | int wlan_hdd_get_cpu(void); |
| 2010 | #else |
| 2011 | static inline int wlan_hdd_get_cpu(void) |
| 2012 | { |
| 2013 | return 0; |
| 2014 | } |
| 2015 | #endif |
| 2016 | |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 2017 | void wlan_hdd_sap_pre_cac_failure(void *data); |
| 2018 | void hdd_clean_up_pre_cac_interface(hdd_context_t *hdd_ctx); |
| 2019 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2020 | void wlan_hdd_txrx_pause_cb(uint8_t vdev_id, |
| 2021 | enum netif_action_type action, enum netif_reason_type reason); |
| 2022 | |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 2023 | int hdd_wlan_dump_stats(hdd_adapter_t *adapter, int value); |
Nirav Shah | ed34b21 | 2016-04-25 10:59:16 +0530 | [diff] [blame] | 2024 | void wlan_hdd_deinit_tx_rx_histogram(hdd_context_t *hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2025 | void wlan_hdd_display_tx_rx_histogram(hdd_context_t *pHddCtx); |
| 2026 | void wlan_hdd_clear_tx_rx_histogram(hdd_context_t *pHddCtx); |
| 2027 | void wlan_hdd_display_netif_queue_history(hdd_context_t *hdd_ctx); |
| 2028 | void wlan_hdd_clear_netif_queue_history(hdd_context_t *hdd_ctx); |
| 2029 | const char *hdd_get_fwpath(void); |
Abhishek Singh | 7996eb7 | 2015-12-30 17:24:02 +0530 | [diff] [blame] | 2030 | void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind); |
| 2031 | hdd_adapter_t *hdd_get_adapter_by_sme_session_id(hdd_context_t *hdd_ctx, |
| 2032 | uint32_t sme_session_id); |
Naveen Rawat | 4edb682 | 2017-04-12 10:09:17 -0700 | [diff] [blame] | 2033 | /** |
| 2034 | * hdd_get_adapter_by_iface_name() - Return adapter with given interface name |
| 2035 | * @hdd_ctx: hdd context. |
| 2036 | * @iface_name: interface name |
| 2037 | * |
| 2038 | * This function is used to get the adapter with given interface name |
| 2039 | * |
| 2040 | * Return: adapter pointer if found, NULL otherwise |
| 2041 | * |
| 2042 | */ |
| 2043 | hdd_adapter_t *hdd_get_adapter_by_iface_name(hdd_context_t *hdd_ctx, |
| 2044 | const char *iface_name); |
Kiran Kumar Lokere | 1364467 | 2016-02-29 15:40:10 -0800 | [diff] [blame] | 2045 | 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] | 2046 | uint8_t wlan_hdd_find_opclass(tHalHandle hal, uint8_t channel, |
| 2047 | uint8_t bw_offset); |
Arun Khandavalli | c811dcc | 2016-06-26 07:37:21 +0530 | [diff] [blame] | 2048 | int hdd_update_config(hdd_context_t *hdd_ctx); |
Dhanashri Atre | 83d373d | 2015-07-28 16:45:59 -0700 | [diff] [blame] | 2049 | |
Mukul Sharma | 9d797a0 | 2017-01-05 20:26:03 +0530 | [diff] [blame] | 2050 | /** |
| 2051 | * hdd_update_components_config() - Initialize driver per module ini parameters |
| 2052 | * @hdd_ctx: HDD Context |
| 2053 | * |
| 2054 | * API is used to initialize components configuration parameters |
| 2055 | * Return: 0 for success, errno for failure |
| 2056 | */ |
| 2057 | int hdd_update_components_config(hdd_context_t *hdd_ctx); |
| 2058 | |
Manishekar Chandrasekaran | cb05217 | 2016-04-22 12:19:04 +0530 | [diff] [blame] | 2059 | QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *adapter, |
Manishekar Chandrasekaran | ec26759 | 2016-05-26 19:10:04 +0530 | [diff] [blame] | 2060 | struct net_device *dev, |
| 2061 | struct hdd_chan_change_params chan_change); |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 2062 | int wlan_hdd_set_channel(struct wiphy *wiphy, |
| 2063 | struct net_device *dev, |
| 2064 | struct cfg80211_chan_def *chandef, |
| 2065 | enum nl80211_channel_type channel_type); |
| 2066 | int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, |
| 2067 | struct cfg80211_beacon_data *params, |
| 2068 | const u8 *ssid, size_t ssid_len, |
| 2069 | enum nl80211_hidden_ssid hidden_ssid, |
Archana Ramachandran | 1a5b604 | 2016-11-08 16:36:50 -0800 | [diff] [blame] | 2070 | bool check_for_concurrency, |
| 2071 | bool update_beacon); |
Chandrasekaran Manishekar | cde33d7 | 2016-04-14 19:03:39 +0530 | [diff] [blame] | 2072 | |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 2073 | #if !defined(REMOVE_PKT_LOG) |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 2074 | int hdd_process_pktlog_command(hdd_context_t *hdd_ctx, uint32_t set_value, |
| 2075 | int set_value2); |
| 2076 | int hdd_pktlog_enable_disable(hdd_context_t *hdd_ctx, bool enable, |
| 2077 | uint8_t user_triggered, int size); |
| 2078 | |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 2079 | #else |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 2080 | static inline int hdd_pktlog_enable_disable(hdd_context_t *hdd_ctx, bool enable, |
| 2081 | uint8_t user_triggered, int size) |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 2082 | { |
| 2083 | return 0; |
| 2084 | } |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 2085 | static inline int hdd_process_pktlog_command(hdd_context_t *hdd_ctx, |
| 2086 | uint32_t set_value, int set_value2) |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 2087 | { |
| 2088 | return 0; |
| 2089 | } |
| 2090 | #endif /* REMOVE_PKT_LOG */ |
| 2091 | |
Dhanashri Atre | 83d373d | 2015-07-28 16:45:59 -0700 | [diff] [blame] | 2092 | #ifdef FEATURE_TSO |
| 2093 | /** |
| 2094 | * hdd_set_tso_flags() - enable TSO flags in the network device |
| 2095 | * @hdd_ctx: HDD context |
| 2096 | * @wlan_dev: network device structure |
| 2097 | * |
| 2098 | * This function enables the TSO related feature flags in the |
| 2099 | * given network device. |
| 2100 | * |
| 2101 | * Return: none |
| 2102 | */ |
| 2103 | static inline void hdd_set_tso_flags(hdd_context_t *hdd_ctx, |
| 2104 | struct net_device *wlan_dev) |
| 2105 | { |
Mohit Khanna | 816e653 | 2016-12-09 15:28:21 -0800 | [diff] [blame] | 2106 | if (hdd_ctx->config->tso_enable && |
| 2107 | hdd_ctx->config->enable_ip_tcp_udp_checksum_offload) { |
| 2108 | /* |
| 2109 | * We want to enable TSO only if IP/UDP/TCP TX checksum flag is |
| 2110 | * enabled. |
| 2111 | */ |
Dhanashri Atre | 83d373d | 2015-07-28 16:45:59 -0700 | [diff] [blame] | 2112 | hdd_info("TSO Enabled"); |
| 2113 | wlan_dev->features |= |
| 2114 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
| 2115 | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG; |
| 2116 | } |
| 2117 | } |
| 2118 | #else |
| 2119 | static inline void hdd_set_tso_flags(hdd_context_t *hdd_ctx, |
| 2120 | struct net_device *wlan_dev){} |
| 2121 | #endif /* FEATURE_TSO */ |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 2122 | |
Agrawal Ashish | c9ddbab | 2016-05-25 12:04:47 +0530 | [diff] [blame] | 2123 | #if defined(FEATURE_WLAN_MCC_TO_SCC_SWITCH) || \ |
| 2124 | defined(FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE) |
| 2125 | void wlan_hdd_restart_sap(hdd_adapter_t *ap_adapter); |
| 2126 | #else |
| 2127 | static inline void wlan_hdd_restart_sap(hdd_adapter_t *ap_adapter) |
| 2128 | { |
| 2129 | } |
| 2130 | #endif |
| 2131 | |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 2132 | #ifdef WLAN_FEATURE_ROAM_OFFLOAD |
Varun Reddy Yeturu | d351a6c | 2016-03-16 14:01:00 -0700 | [diff] [blame] | 2133 | static inline bool roaming_offload_enabled(hdd_context_t *hdd_ctx) |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 2134 | { |
| 2135 | return hdd_ctx->config->isRoamOffloadEnabled; |
| 2136 | } |
| 2137 | #else |
Varun Reddy Yeturu | d351a6c | 2016-03-16 14:01:00 -0700 | [diff] [blame] | 2138 | static inline bool roaming_offload_enabled(hdd_context_t *hdd_ctx) |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 2139 | { |
| 2140 | return false; |
| 2141 | } |
| 2142 | #endif |
| 2143 | |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 2144 | void hdd_get_ibss_peer_info_cb(void *pUserData, |
| 2145 | tSirPeerInfoRspParams *pPeerInfo); |
| 2146 | |
Ryan Hsu | ceddceb | 2016-04-28 10:20:14 -0700 | [diff] [blame] | 2147 | #ifdef CONFIG_CNSS_LOGGER |
| 2148 | /** |
| 2149 | * wlan_hdd_nl_init() - wrapper function to CNSS_LOGGER case |
| 2150 | * @hdd_ctx: the hdd context pointer |
| 2151 | * |
| 2152 | * The nl_srv_init() will call to cnss_logger_device_register() and |
| 2153 | * expect to get a radio_index from cnss_logger module and assign to |
| 2154 | * hdd_ctx->radio_index, then to maintain the consistency to original |
| 2155 | * design, adding the radio_index check here, then return the error |
| 2156 | * code if radio_index is not assigned correctly, which means the nl_init |
| 2157 | * from cnss_logger is failed. |
| 2158 | * |
| 2159 | * Return: 0 if successfully, otherwise error code |
| 2160 | */ |
| 2161 | static inline int wlan_hdd_nl_init(hdd_context_t *hdd_ctx) |
| 2162 | { |
| 2163 | hdd_ctx->radio_index = nl_srv_init(hdd_ctx->wiphy); |
| 2164 | |
| 2165 | /* radio_index is assigned from 0, so only >=0 will be valid index */ |
| 2166 | if (hdd_ctx->radio_index >= 0) |
| 2167 | return 0; |
| 2168 | else |
| 2169 | return -EINVAL; |
| 2170 | } |
| 2171 | #else |
| 2172 | /** |
| 2173 | * wlan_hdd_nl_init() - wrapper function to non CNSS_LOGGER case |
| 2174 | * @hdd_ctx: the hdd context pointer |
| 2175 | * |
| 2176 | * In case of non CNSS_LOGGER case, the nl_srv_init() will initialize |
| 2177 | * the netlink socket and return the success or not. |
| 2178 | * |
| 2179 | * Return: the return value from nl_srv_init() |
| 2180 | */ |
| 2181 | static inline int wlan_hdd_nl_init(hdd_context_t *hdd_ctx) |
| 2182 | { |
| 2183 | return nl_srv_init(hdd_ctx->wiphy); |
| 2184 | } |
| 2185 | #endif |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 2186 | QDF_STATUS hdd_sme_close_session_callback(void *pContext); |
| 2187 | |
Varun Reddy Yeturu | 3e91dad | 2016-07-18 15:58:47 -0700 | [diff] [blame] | 2188 | int hdd_reassoc(hdd_adapter_t *adapter, const uint8_t *bssid, |
Deepak Dhamdhere | 5a36a4a | 2016-11-12 15:08:22 -0800 | [diff] [blame] | 2189 | uint8_t channel, const handoff_src src); |
Komal Seelam | 78ff65a | 2016-08-18 15:25:24 +0530 | [diff] [blame] | 2190 | void hdd_svc_fw_shutdown_ind(struct device *dev); |
Arun Khandavalli | 4b55da7 | 2016-07-19 19:55:01 +0530 | [diff] [blame] | 2191 | int hdd_register_cb(hdd_context_t *hdd_ctx); |
| 2192 | void hdd_deregister_cb(hdd_context_t *hdd_ctx); |
Arun Khandavalli | 7e857c3 | 2016-06-26 12:07:16 +0530 | [diff] [blame] | 2193 | int hdd_start_station_adapter(hdd_adapter_t *adapter); |
| 2194 | int hdd_start_ap_adapter(hdd_adapter_t *adapter); |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 2195 | 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] | 2196 | int hdd_start_ftm_adapter(hdd_adapter_t *adapter); |
Arun Khandavalli | 2358d52 | 2016-05-16 18:05:37 +0530 | [diff] [blame] | 2197 | int hdd_set_fw_params(hdd_adapter_t *adapter); |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 2198 | int hdd_wlan_start_modules(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, |
| 2199 | bool reinit); |
Rajeev Kumar | 3fef4e8 | 2017-03-31 20:25:23 -0700 | [diff] [blame] | 2200 | int hdd_wlan_stop_modules(hdd_context_t *hdd_ctx, bool ftm_mode); |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 2201 | int hdd_start_adapter(hdd_adapter_t *adapter); |
Abhishek Singh | b5e38ef | 2017-01-02 12:09:34 +0530 | [diff] [blame] | 2202 | |
| 2203 | /** |
| 2204 | * hdd_get_bss_entry() - Get the bss entry matching the chan, bssid and ssid |
| 2205 | * @wiphy: wiphy |
| 2206 | * @channel: channel of the BSS to find |
| 2207 | * @bssid: bssid of the BSS to find |
| 2208 | * @ssid: ssid of the BSS to find |
| 2209 | * @ssid_len: ssid len of of the BSS to find |
| 2210 | * |
| 2211 | * The API is a wrapper to get bss from kernel matching the chan, |
| 2212 | * bssid and ssid |
| 2213 | * |
| 2214 | * Return: bss structure if found else NULL |
| 2215 | */ |
| 2216 | struct cfg80211_bss *hdd_cfg80211_get_bss(struct wiphy *wiphy, |
| 2217 | struct ieee80211_channel *channel, |
| 2218 | const u8 *bssid, |
| 2219 | const u8 *ssid, size_t ssid_len); |
| 2220 | |
Anurag Chouhan | c409292 | 2016-09-08 15:56:11 +0530 | [diff] [blame] | 2221 | void hdd_connect_result(struct net_device *dev, const u8 *bssid, |
| 2222 | tCsrRoamInfo *roam_info, const u8 *req_ie, |
| 2223 | size_t req_ie_len, const u8 *resp_ie, |
Abhishek Singh | a84d395 | 2016-09-13 13:45:05 +0530 | [diff] [blame] | 2224 | size_t resp_ie_len, u16 status, gfp_t gfp, |
yeshwanth sriram guntuka | af7b73f | 2017-02-22 17:35:32 +0530 | [diff] [blame] | 2225 | bool connect_timeout, |
| 2226 | tSirResultCodes timeout_reason); |
Anurag Chouhan | c409292 | 2016-09-08 15:56:11 +0530 | [diff] [blame] | 2227 | |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 2228 | #ifdef WLAN_FEATURE_FASTPATH |
| 2229 | void hdd_enable_fastpath(struct hdd_config *hdd_cfg, |
| 2230 | void *context); |
| 2231 | #else |
| 2232 | static inline void hdd_enable_fastpath(struct hdd_config *hdd_cfg, |
| 2233 | void *context) |
| 2234 | { |
| 2235 | } |
| 2236 | #endif |
| 2237 | void hdd_wlan_update_target_info(hdd_context_t *hdd_ctx, void *context); |
Agrawal Ashish | 6563461 | 2016-08-18 13:24:32 +0530 | [diff] [blame] | 2238 | enum sap_acs_dfs_mode wlan_hdd_get_dfs_mode(enum dfs_mode mode); |
Agrawal Ashish | 467dde4 | 2016-09-08 18:44:22 +0530 | [diff] [blame] | 2239 | void hdd_ch_avoid_cb(void *hdd_context, void *indi_param); |
| 2240 | void hdd_unsafe_channel_restart_sap(hdd_context_t *hdd_ctx); |
Selvaraj, Sridhar | ebda0f2 | 2016-08-29 16:05:23 +0530 | [diff] [blame] | 2241 | int hdd_enable_disable_ca_event(hdd_context_t *hddctx, |
| 2242 | uint8_t set_value); |
Liangwei Dong | 8baf7c8 | 2016-10-11 01:26:59 -0400 | [diff] [blame] | 2243 | void wlan_hdd_undo_acs(hdd_adapter_t *adapter); |
Dustin Brown | bb7e2f5 | 2016-10-17 12:16:35 -0700 | [diff] [blame] | 2244 | |
| 2245 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)) |
| 2246 | static inline int |
| 2247 | hdd_wlan_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) |
| 2248 | { |
| 2249 | return nla_put_u64(skb, attrtype, value); |
| 2250 | } |
| 2251 | #else |
| 2252 | static inline int |
| 2253 | hdd_wlan_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) |
| 2254 | { |
| 2255 | return nla_put_u64_64bit(skb, attrtype, value, NL80211_ATTR_PAD); |
| 2256 | } |
| 2257 | #endif |
| 2258 | |
Hanumanth Reddy Pothula | d9491f4 | 2016-10-24 19:08:38 +0530 | [diff] [blame] | 2259 | static inline int wlan_hdd_validate_session_id(u8 session_id) |
| 2260 | { |
| 2261 | if (session_id != HDD_SESSION_ID_INVALID) |
| 2262 | return 0; |
| 2263 | |
| 2264 | return -EINVAL; |
| 2265 | } |
| 2266 | |
Varun Reddy Yeturu | a578414 | 2017-03-10 12:11:44 -0800 | [diff] [blame] | 2267 | bool hdd_is_roaming_in_progress(hdd_adapter_t *adapter); |
Varun Reddy Yeturu | dce1c56 | 2016-11-18 10:00:45 -0800 | [diff] [blame] | 2268 | void hdd_set_roaming_in_progress(bool value); |
Tushnim Bhattacharyya | 9e81b4c | 2017-02-15 17:11:14 -0800 | [diff] [blame] | 2269 | bool hdd_is_connection_in_progress(uint8_t *session_id, |
| 2270 | enum scan_reject_states *reason); |
| 2271 | void hdd_restart_sap(hdd_adapter_t *ap_adapter); |
| 2272 | void hdd_check_and_restart_sap_with_non_dfs_acs(void); |
| 2273 | bool hdd_set_connection_in_progress(bool value); |
Varun Reddy Yeturu | dce1c56 | 2016-11-18 10:00:45 -0800 | [diff] [blame] | 2274 | |
Kapil Gupta | 94ca6f6 | 2016-12-11 18:43:12 +0530 | [diff] [blame] | 2275 | /** |
| 2276 | * wlan_hdd_sap_get_valid_channellist() - Get SAPs valid channel list |
| 2277 | * @ap_adapter: adapter |
| 2278 | * @channel_count: valid channel count |
| 2279 | * @channel_list: valid channel list |
Jayachandran Sreekumaran | 68c952c | 2017-04-24 12:42:03 +0530 | [diff] [blame] | 2280 | * @band: frequency band |
Kapil Gupta | 94ca6f6 | 2016-12-11 18:43:12 +0530 | [diff] [blame] | 2281 | * |
| 2282 | * This API returns valid channel list for SAP after removing nol and |
| 2283 | * channel which lies outside of configuration. |
| 2284 | * |
| 2285 | * Return: Zero on success, non-zero on failure |
| 2286 | */ |
| 2287 | int wlan_hdd_sap_get_valid_channellist(hdd_adapter_t *adapter, |
| 2288 | uint32_t *channel_count, |
Jayachandran Sreekumaran | 68c952c | 2017-04-24 12:42:03 +0530 | [diff] [blame] | 2289 | uint8_t *channel_list, |
| 2290 | eCsrBand band); |
Kapil Gupta | 4f0c0c1 | 2017-02-07 15:21:15 +0530 | [diff] [blame] | 2291 | /** |
| 2292 | * wlan_hdd_init_chan_info() - initialize channel info variables |
| 2293 | * @hdd_ctx: hdd ctx |
| 2294 | * |
| 2295 | * This API initialize channel info variables |
| 2296 | * |
| 2297 | * Return: None |
| 2298 | */ |
| 2299 | void wlan_hdd_init_chan_info(hdd_context_t *hdd_ctx); |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 2300 | |
Kapil Gupta | 4f0c0c1 | 2017-02-07 15:21:15 +0530 | [diff] [blame] | 2301 | /** |
| 2302 | * wlan_hdd_deinit_chan_info() - deinitialize channel info variables |
| 2303 | * @hdd_ctx: hdd ctx |
| 2304 | * |
| 2305 | * This API deinitialize channel info variables |
| 2306 | * |
| 2307 | * Return: None |
| 2308 | */ |
| 2309 | void wlan_hdd_deinit_chan_info(hdd_context_t *hdd_ctx); |
Arun Khandavalli | cc544b3 | 2017-01-30 19:52:16 +0530 | [diff] [blame] | 2310 | void wlan_hdd_start_sap(hdd_adapter_t *ap_adapter, bool reinit); |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2311 | |
Ashish Kumar Dhanotiya | 486c13a | 2017-03-03 12:57:56 +0530 | [diff] [blame] | 2312 | /** |
| 2313 | * hdd_check_for_opened_interfaces()- Check for interface up |
| 2314 | * @hdd_ctx: HDD context |
| 2315 | * |
| 2316 | * check if there are any wlan interfaces before starting the timer |
| 2317 | * to close the modules |
| 2318 | * |
| 2319 | * Return: 0 if interface was opened else false |
| 2320 | */ |
| 2321 | bool hdd_check_for_opened_interfaces(hdd_context_t *hdd_ctx); |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2322 | |
| 2323 | #ifdef WIFI_POS_CONVERGED |
| 2324 | /** |
| 2325 | * hdd_send_peer_status_ind_to_app() - wrapper to call legacy or new wifi_pos |
| 2326 | * function to send peer status to a registered application |
| 2327 | * @peer_mac: MAC address of peer |
| 2328 | * @peer_status: ePeerConnected or ePeerDisconnected |
| 2329 | * @peer_timing_meas_cap: 0: RTT/RTT2, 1: RTT3. Default is 0 |
| 2330 | * @sessionId: SME session id, i.e. vdev_id |
| 2331 | * @chan_info: operating channel information |
| 2332 | * @dev_mode: dev mode for which indication is sent |
| 2333 | * |
| 2334 | * Return: none |
| 2335 | */ |
| 2336 | static inline void hdd_send_peer_status_ind_to_app( |
| 2337 | struct qdf_mac_addr *peer_mac, |
| 2338 | uint8_t peer_status, |
| 2339 | uint8_t peer_timing_meas_cap, |
| 2340 | uint8_t sessionId, |
| 2341 | tSirSmeChanInfo *chan_info, |
| 2342 | enum tQDF_ADAPTER_MODE dev_mode) |
| 2343 | { |
| 2344 | struct wifi_pos_ch_info ch_info; |
| 2345 | |
Naveen Rawat | 6877a24 | 2017-03-23 17:15:38 -0700 | [diff] [blame] | 2346 | if (!chan_info) { |
| 2347 | os_if_wifi_pos_send_peer_status(peer_mac, peer_status, |
| 2348 | peer_timing_meas_cap, sessionId, |
| 2349 | NULL, dev_mode); |
| 2350 | return; |
| 2351 | } |
| 2352 | |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 2353 | ch_info.chan_id = chan_info->chan_id; |
| 2354 | ch_info.mhz = chan_info->mhz; |
| 2355 | ch_info.band_center_freq1 = chan_info->band_center_freq1; |
| 2356 | ch_info.band_center_freq2 = chan_info->band_center_freq2; |
| 2357 | ch_info.info = chan_info->info; |
| 2358 | ch_info.reg_info_1 = chan_info->reg_info_1; |
| 2359 | ch_info.reg_info_2 = chan_info->reg_info_2; |
| 2360 | ch_info.nss = chan_info->nss; |
| 2361 | ch_info.rate_flags = chan_info->rate_flags; |
| 2362 | ch_info.sec_ch_offset = chan_info->sec_ch_offset; |
| 2363 | ch_info.ch_width = chan_info->ch_width; |
| 2364 | os_if_wifi_pos_send_peer_status(peer_mac, peer_status, |
| 2365 | peer_timing_meas_cap, sessionId, |
| 2366 | &ch_info, dev_mode); |
| 2367 | } |
| 2368 | #else |
| 2369 | static inline void hdd_send_peer_status_ind_to_app( |
| 2370 | struct qdf_mac_addr *peer_mac, |
| 2371 | uint8_t peer_status, |
| 2372 | uint8_t peer_timing_meas_cap, |
| 2373 | uint8_t sessionId, |
| 2374 | tSirSmeChanInfo *chan_info, |
| 2375 | enum tQDF_ADAPTER_MODE dev_mode) |
| 2376 | { |
| 2377 | hdd_send_peer_status_ind_to_oem_app(peer_mac, peer_status, |
| 2378 | peer_timing_meas_cap, sessionId, chan_info, dev_mode); |
| 2379 | } |
| 2380 | #endif /* WIFI_POS_CONVERGENCE */ |
| 2381 | |
Archana Ramachandran | b8c04f9 | 2017-03-17 20:05:47 -0700 | [diff] [blame] | 2382 | /** |
| 2383 | * wlan_hdd_send_p2p_quota()- Send P2P Quota value to FW |
| 2384 | * @adapter: Adapter data |
| 2385 | * @sval: P2P quota value |
| 2386 | * |
| 2387 | * Send P2P quota value to FW |
| 2388 | * |
| 2389 | * Return: 0 sucess else failure |
| 2390 | */ |
| 2391 | int wlan_hdd_send_p2p_quota(hdd_adapter_t *adapter, int sval); |
Archana Ramachandran | ea34c4f | 2017-03-19 18:56:18 -0700 | [diff] [blame] | 2392 | |
Archana Ramachandran | b8c04f9 | 2017-03-17 20:05:47 -0700 | [diff] [blame] | 2393 | /** |
| 2394 | * wlan_hdd_send_p2p_quota()- Send MCC latency to FW |
| 2395 | * @adapter: Adapter data |
| 2396 | * @sval: MCC latency value |
| 2397 | * |
| 2398 | * Send MCC latency value to FW |
| 2399 | * |
| 2400 | * Return: 0 sucess else failure |
| 2401 | */ |
| 2402 | int wlan_hdd_send_mcc_latency(hdd_adapter_t *adapter, int sval); |
Archana Ramachandran | ea34c4f | 2017-03-19 18:56:18 -0700 | [diff] [blame] | 2403 | |
| 2404 | /** |
| 2405 | * wlan_hdd_get_adapter_from_vdev()- Get adapter from vdev id |
| 2406 | * and PSOC object data |
| 2407 | * @psoc: Psoc object data |
| 2408 | * @vdev_id: vdev id |
| 2409 | * |
| 2410 | * Get adapter from vdev id and PSOC object data |
| 2411 | * |
| 2412 | * Return: adapter pointer |
| 2413 | */ |
| 2414 | hdd_adapter_t *wlan_hdd_get_adapter_from_vdev(struct wlan_objmgr_psoc |
| 2415 | *psoc, uint8_t vdev_id); |
Ashish Kumar Dhanotiya | aa2b17c | 2017-03-29 00:41:32 +0530 | [diff] [blame] | 2416 | /** |
| 2417 | * hdd_unregister_notifiers()- unregister kernel notifiers |
| 2418 | * @hdd_ctx: Hdd Context |
| 2419 | * |
| 2420 | * Unregister netdev notifiers like Netdevice,IPv4 and IPv6. |
| 2421 | * |
| 2422 | */ |
| 2423 | void hdd_unregister_notifiers(hdd_context_t *hdd_ctx); |
Sachin Ahuja | dddd263 | 2017-03-07 19:07:24 +0530 | [diff] [blame] | 2424 | |
| 2425 | /** |
Nitesh Shah | f9a09ff | 2017-05-22 15:46:25 +0530 | [diff] [blame] | 2426 | * hdd_dbs_scan_selection_init() - initialization for DBS scan selection config |
| 2427 | * @hdd_ctx: HDD context |
| 2428 | * |
| 2429 | * This function sends the DBS scan selection config configuration to the |
| 2430 | * firmware via WMA |
| 2431 | * |
| 2432 | * Return: 0 - success, < 0 - failure |
| 2433 | */ |
| 2434 | int hdd_dbs_scan_selection_init(hdd_context_t *hdd_ctx); |
| 2435 | |
| 2436 | /** |
Sachin Ahuja | dddd263 | 2017-03-07 19:07:24 +0530 | [diff] [blame] | 2437 | * hdd_start_complete()- complete the start event |
| 2438 | * @ret: return value for complete event. |
| 2439 | * |
| 2440 | * complete the startup event and set the return in |
| 2441 | * global variable |
| 2442 | * |
| 2443 | * Return: void |
| 2444 | */ |
| 2445 | |
| 2446 | void hdd_start_complete(int ret); |
Ravi Kumar Bokka | 05c14e5 | 2017-03-27 14:48:23 +0530 | [diff] [blame] | 2447 | |
| 2448 | /** |
| 2449 | * hdd_chip_pwr_save_fail_detected_cb() - chip power save failure detected |
| 2450 | * callback |
| 2451 | * @hddctx: HDD context |
| 2452 | * @data: chip power save failure detected data |
| 2453 | * |
| 2454 | * This function reads the chip power save failure detected data and fill in |
| 2455 | * the skb with NL attributes and send up the NL event. |
| 2456 | * This callback execute in atomic context and must not invoke any |
| 2457 | * blocking calls. |
| 2458 | * |
| 2459 | * Return: none |
| 2460 | */ |
| 2461 | |
| 2462 | void hdd_chip_pwr_save_fail_detected_cb(void *hddctx, |
| 2463 | struct chip_pwr_save_fail_detected_params |
| 2464 | *data); |
| 2465 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2466 | #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ |