Jeff Johnson | 153f026 | 2018-02-28 12:51:58 -0800 | [diff] [blame] | 1 | /* |
Dustin Brown | db2a8be | 2017-12-20 11:49:56 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 4 | * Permission to use, copy, modify, and/or distribute this software for |
| 5 | * any purpose with or without fee is hereby granted, provided that the |
| 6 | * above copyright notice and this permission notice appear in all |
| 7 | * copies. |
| 8 | * |
| 9 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 10 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 11 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 12 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 13 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 14 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 15 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 16 | * PERFORMANCE OF THIS SOFTWARE. |
| 17 | */ |
| 18 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 19 | #if !defined(WLAN_HDD_MAIN_H) |
| 20 | #define WLAN_HDD_MAIN_H |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 21 | /** |
| 22 | * DOC: wlan_hdd_main.h |
| 23 | * |
| 24 | * Linux HDD Adapter Type |
| 25 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 26 | |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 27 | /* |
Jeff Johnson | f8d455c | 2017-09-28 08:59:06 -0700 | [diff] [blame] | 28 | * The following terms were in use in prior versions of the driver but |
| 29 | * have now been replaced with terms that are aligned with the Linux |
| 30 | * Coding style. Macros are defined to hopefully prevent new instances |
| 31 | * from being introduced, primarily by code propagation. |
| 32 | */ |
| 33 | #define pHddCtx |
Jeff Johnson | 7b92c0f | 2017-10-02 13:31:35 -0700 | [diff] [blame] | 34 | #define pAdapter |
Jeff Johnson | 9c4f93d | 2017-10-04 08:56:22 -0700 | [diff] [blame] | 35 | #define pHostapdAdapter |
Jeff Johnson | 9bf2497 | 2017-10-04 09:26:58 -0700 | [diff] [blame] | 36 | #define pHddApCtx |
Jeff Johnson | d377dce | 2017-10-04 10:32:42 -0700 | [diff] [blame] | 37 | #define pHddStaCtx |
Jeff Johnson | 5c19ade | 2017-10-04 09:52:12 -0700 | [diff] [blame] | 38 | #define pHostapdState |
Jeff Johnson | fd06085 | 2017-10-04 10:50:51 -0700 | [diff] [blame] | 39 | #define pRoamInfo |
Jeff Johnson | 5287de5 | 2017-10-28 12:23:06 -0700 | [diff] [blame] | 40 | #define pScanInfo |
Jeff Johnson | 04e0008 | 2017-10-04 12:15:58 -0700 | [diff] [blame] | 41 | #define pBeaconIes |
Jeff Johnson | f8d455c | 2017-09-28 08:59:06 -0700 | [diff] [blame] | 42 | |
| 43 | /* |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 44 | * Include files |
| 45 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 46 | |
| 47 | #include <linux/netdevice.h> |
| 48 | #include <linux/skbuff.h> |
| 49 | #include <net/cfg80211.h> |
Ashish Kumar Dhanotiya | 443d31f | 2017-10-13 12:41:19 +0530 | [diff] [blame] | 50 | #include <linux/ieee80211.h> |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 51 | #include <qdf_list.h> |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 52 | #include <qdf_types.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 53 | #include "sir_mac_prot_def.h" |
| 54 | #include "csr_api.h" |
| 55 | #include <wlan_hdd_assoc.h> |
| 56 | #include <wlan_hdd_wmm.h> |
| 57 | #include <wlan_hdd_cfg.h> |
| 58 | #include <linux/spinlock.h> |
| 59 | #if defined(WLAN_OPEN_SOURCE) && defined(CONFIG_HAS_WAKELOCK) |
| 60 | #include <linux/wakelock.h> |
| 61 | #endif |
| 62 | #include <wlan_hdd_ftm.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 63 | #include "wlan_hdd_tdls.h" |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 64 | #include "wlan_hdd_tsf.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 65 | #include "wlan_hdd_cfg80211.h" |
Rajeev Kumar Sirasanagandla | 197d417 | 2018-02-15 19:03:29 +0530 | [diff] [blame] | 66 | #include "wlan_hdd_debugfs.h" |
Anurag Chouhan | 42958bb | 2016-02-19 15:43:11 +0530 | [diff] [blame] | 67 | #include <qdf_defer.h> |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 68 | #include "sap_api.h" |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 69 | #include <wlan_hdd_lro.h> |
Dhanashri Atre | b08959a | 2016-03-01 17:28:03 -0800 | [diff] [blame] | 70 | #include "cdp_txrx_flow_ctrl_legacy.h" |
Manjunathappa Prakash | 3454fd6 | 2016-04-01 08:52:06 -0700 | [diff] [blame] | 71 | #include <cdp_txrx_peer_ops.h> |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 72 | #include "wlan_hdd_nan_datapath.h" |
hqu | 6153382 | 2017-06-20 15:04:05 +0800 | [diff] [blame] | 73 | #if defined(CONFIG_HL_SUPPORT) |
| 74 | #include "wlan_tgt_def_config_hl.h" |
| 75 | #else |
Dustin Brown | 6126946 | 2016-09-19 13:25:45 -0700 | [diff] [blame] | 76 | #include "wlan_tgt_def_config.h" |
hqu | 6153382 | 2017-06-20 15:04:05 +0800 | [diff] [blame] | 77 | #endif |
Selvaraj, Sridhar | 0672a12 | 2016-12-29 16:11:48 +0530 | [diff] [blame] | 78 | #include <wlan_objmgr_cmn.h> |
| 79 | #include <wlan_objmgr_global_obj.h> |
| 80 | #include <wlan_objmgr_psoc_obj.h> |
| 81 | #include <wlan_objmgr_pdev_obj.h> |
| 82 | #include <wlan_objmgr_vdev_obj.h> |
| 83 | #include <wlan_objmgr_peer_obj.h> |
Mukul Sharma | 9d797a0 | 2017-01-05 20:26:03 +0530 | [diff] [blame] | 84 | #include "wlan_pmo_ucfg_api.h" |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 85 | #ifdef WIFI_POS_CONVERGED |
| 86 | #include "os_if_wifi_pos.h" |
| 87 | #include "wifi_pos_api.h" |
| 88 | #else |
| 89 | #include "wlan_hdd_oemdata.h" |
| 90 | #endif |
Krishna Kumaar Natarajan | 4f1d772 | 2017-03-03 21:12:51 -0800 | [diff] [blame] | 91 | #include "wlan_hdd_he.h" |
| 92 | |
Alok Kumar | b64650c | 2018-03-23 17:05:11 +0530 | [diff] [blame] | 93 | #include <net/neighbour.h> |
| 94 | #include <net/netevent.h> |
| 95 | #include "wlan_hdd_nud_tracking.h" |
Varun Reddy Yeturu | 3c9f89c | 2018-04-18 19:10:34 -0700 | [diff] [blame] | 96 | #include "wlan_hdd_twt.h" |
Jeff Johnson | f917638 | 2018-07-17 19:15:58 -0700 | [diff] [blame] | 97 | #include "wma_sar_public_structs.h" |
Wu Gao | ca416ff | 2018-09-17 11:05:07 +0800 | [diff] [blame] | 98 | #include "wlan_mlme_ucfg_api.h" |
Alok Kumar | b64650c | 2018-03-23 17:05:11 +0530 | [diff] [blame] | 99 | |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 100 | /* |
| 101 | * Preprocessor definitions and constants |
| 102 | */ |
| 103 | |
Nachiket Kukade | 5f0ce4f | 2018-06-15 19:47:37 +0530 | [diff] [blame] | 104 | #ifdef FEATURE_WLAN_APF |
| 105 | /** |
| 106 | * struct hdd_apf_context - hdd Context for apf |
| 107 | * @magic: magic number |
| 108 | * @qdf_apf_event: Completion variable for APF get operations |
| 109 | * @capability_response: capabilities response received from fw |
| 110 | * @apf_enabled: True: APF Interpreter enabled, False: Disabled |
| 111 | * @cmd_in_progress: Flag that indicates an APF command is in progress |
| 112 | * @buf: Buffer to accumulate read memory chunks |
| 113 | * @buf_len: Length of the read memory requested |
| 114 | * @offset: APF work memory offset to fetch from |
| 115 | * @lock: APF Context lock |
| 116 | */ |
| 117 | struct hdd_apf_context { |
| 118 | unsigned int magic; |
| 119 | qdf_event_t qdf_apf_event; |
| 120 | bool apf_enabled; |
| 121 | bool cmd_in_progress; |
| 122 | uint8_t *buf; |
| 123 | uint32_t buf_len; |
| 124 | uint32_t offset; |
| 125 | qdf_spinlock_t lock; |
| 126 | }; |
| 127 | #endif /* FEATURE_WLAN_APF */ |
| 128 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 129 | /** Number of Tx Queues */ |
Ajit Pal Singh | 5d26961 | 2018-04-19 16:29:12 +0530 | [diff] [blame] | 130 | #if defined(QCA_LL_TX_FLOW_CONTROL_V2) || defined(QCA_HL_NETDEV_FLOW_CONTROL) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 131 | #define NUM_TX_QUEUES 5 |
| 132 | #else |
| 133 | #define NUM_TX_QUEUES 4 |
| 134 | #endif |
Mohit Khanna | ee9e80f | 2015-11-10 11:32:49 -0800 | [diff] [blame] | 135 | |
Mahesh Kumar Kalikot Veetil | 885a77b | 2018-03-26 14:46:59 -0700 | [diff] [blame] | 136 | /* |
| 137 | * API in_compat_syscall() is introduced in 4.6 kernel to check whether we're |
| 138 | * in a compat syscall or not. It is a new way to query the syscall type, which |
| 139 | * works properly on all architectures. |
| 140 | * |
| 141 | */ |
| 142 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)) |
| 143 | static inline bool in_compat_syscall(void) { return is_compat_task(); } |
| 144 | #endif |
| 145 | |
Srinivas Girigowda | 5da651b | 2017-08-04 11:22:54 -0700 | [diff] [blame] | 146 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)) || \ |
| 147 | defined(CFG80211_REMOVE_IEEE80211_BACKPORT) |
Srinivas Girigowda | 38f1ded | 2017-06-12 23:00:38 -0700 | [diff] [blame] | 148 | #define HDD_NL80211_BAND_2GHZ NL80211_BAND_2GHZ |
| 149 | #define HDD_NL80211_BAND_5GHZ NL80211_BAND_5GHZ |
Srinivas Girigowda | 5da651b | 2017-08-04 11:22:54 -0700 | [diff] [blame] | 150 | #define HDD_NUM_NL80211_BANDS NUM_NL80211_BANDS |
Srinivas Girigowda | 38f1ded | 2017-06-12 23:00:38 -0700 | [diff] [blame] | 151 | #else |
| 152 | #define HDD_NL80211_BAND_2GHZ IEEE80211_BAND_2GHZ |
| 153 | #define HDD_NL80211_BAND_5GHZ IEEE80211_BAND_5GHZ |
Srinivas Girigowda | 5da651b | 2017-08-04 11:22:54 -0700 | [diff] [blame] | 154 | #define HDD_NUM_NL80211_BANDS ((enum nl80211_band)IEEE80211_NUM_BANDS) |
Srinivas Girigowda | 38f1ded | 2017-06-12 23:00:38 -0700 | [diff] [blame] | 155 | #endif |
| 156 | |
Sourav Mohapatra | 0f3b857 | 2018-09-12 10:03:51 +0530 | [diff] [blame] | 157 | #define TSF_GPIO_PIN_INVALID 255 |
| 158 | |
Mohit Khanna | ee9e80f | 2015-11-10 11:32:49 -0800 | [diff] [blame] | 159 | /** Length of the TX queue for the netdev */ |
| 160 | #define HDD_NETDEV_TX_QUEUE_LEN (3000) |
| 161 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 162 | /** Hdd Tx Time out value */ |
| 163 | #ifdef LIBRA_LINUX_PC |
| 164 | #define HDD_TX_TIMEOUT (8000) |
| 165 | #else |
| 166 | #define HDD_TX_TIMEOUT msecs_to_jiffies(5000) |
| 167 | #endif |
Sravan Kumar Kairam | 3a69831 | 2017-10-16 14:16:16 +0530 | [diff] [blame] | 168 | |
| 169 | #define HDD_TX_STALL_THRESHOLD 4 |
| 170 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 171 | /** Hdd Default MTU */ |
| 172 | #define HDD_DEFAULT_MTU (1500) |
| 173 | |
| 174 | #ifdef QCA_CONFIG_SMP |
| 175 | #define NUM_CPUS NR_CPUS |
| 176 | #else |
| 177 | #define NUM_CPUS 1 |
| 178 | #endif |
| 179 | |
Dustin Brown | 20f9fc4 | 2018-08-30 15:19:12 -0700 | [diff] [blame] | 180 | /** |
| 181 | * enum hdd_adapter_flags - event bitmap flags registered net device |
| 182 | * @NET_DEVICE_REGISTERED: Adapter is registered with the kernel |
| 183 | * @SME_SESSION_OPENED: Firmware vdev has been created |
| 184 | * @INIT_TX_RX_SUCCESS: Adapter datapath is initialized |
| 185 | * @WMM_INIT_DONE: Adapter is initialized |
| 186 | * @SOFTAP_BSS_STARTED: Software Access Point (SAP) is running |
| 187 | * @DEVICE_IFACE_OPENED: Adapter has been "opened" via the kernel |
| 188 | * @ACS_PENDING: Auto Channel Selection (ACS) is pending |
| 189 | * @SOFTAP_INIT_DONE: Software Access Point (SAP) is initialized |
| 190 | * @VENDOR_ACS_RESPONSE_PENDING: Waiting for event for vendor acs |
Arunk Khandavalli | 987c8d5 | 2018-06-21 17:40:31 +0530 | [diff] [blame] | 191 | * @DOWN_DURING_SSR: Mark interface is down during SSR |
Dustin Brown | 20f9fc4 | 2018-08-30 15:19:12 -0700 | [diff] [blame] | 192 | */ |
| 193 | enum hdd_adapter_flags { |
| 194 | NET_DEVICE_REGISTERED, |
| 195 | SME_SESSION_OPENED, |
| 196 | INIT_TX_RX_SUCCESS, |
| 197 | WMM_INIT_DONE, |
| 198 | SOFTAP_BSS_STARTED, |
| 199 | DEVICE_IFACE_OPENED, |
| 200 | ACS_PENDING, |
| 201 | SOFTAP_INIT_DONE, |
| 202 | VENDOR_ACS_RESPONSE_PENDING, |
Arunk Khandavalli | 987c8d5 | 2018-06-21 17:40:31 +0530 | [diff] [blame] | 203 | DOWN_DURING_SSR, |
Dustin Brown | 20f9fc4 | 2018-08-30 15:19:12 -0700 | [diff] [blame] | 204 | }; |
Manikandan Mohan | 0a0ac95 | 2017-02-16 15:49:31 -0800 | [diff] [blame] | 205 | |
Dustin Brown | 20f9fc4 | 2018-08-30 15:19:12 -0700 | [diff] [blame] | 206 | /** |
| 207 | * enum hdd_driver_flags - HDD global event bitmap flags |
| 208 | * @ACS_IN_PROGRESS: Auto Channel Selection (ACS) in progress |
| 209 | */ |
| 210 | enum hdd_driver_flags { |
| 211 | ACS_IN_PROGRESS, |
| 212 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 213 | |
| 214 | /** Maximum time(ms)to wait for disconnect to complete **/ |
Jiachao Wu | 7bf72b4 | 2018-03-22 19:15:10 +0800 | [diff] [blame] | 215 | /* This value should be larger than the timeout used by WMA to wait for |
| 216 | * stop vdev response from FW |
| 217 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 218 | #ifdef QCA_WIFI_3_0_EMU |
Jiachao Wu | 7bf72b4 | 2018-03-22 19:15:10 +0800 | [diff] [blame] | 219 | #define WLAN_WAIT_TIME_DISCONNECT 7000 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 220 | #else |
Jiachao Wu | 7bf72b4 | 2018-03-22 19:15:10 +0800 | [diff] [blame] | 221 | #define WLAN_WAIT_TIME_DISCONNECT 7000 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 222 | #endif |
Abhishek Singh | e9706cc | 2017-10-12 17:25:06 +0530 | [diff] [blame] | 223 | #define WLAN_WAIT_DISCONNECT_ALREADY_IN_PROGRESS 1000 |
Abhishek Singh | 533c9da | 2017-05-04 10:23:34 +0530 | [diff] [blame] | 224 | #define WLAN_WAIT_TIME_STOP_ROAM 4000 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 225 | #define WLAN_WAIT_TIME_STATS 800 |
| 226 | #define WLAN_WAIT_TIME_POWER 800 |
| 227 | #define WLAN_WAIT_TIME_COUNTRY 1000 |
| 228 | #define WLAN_WAIT_TIME_LINK_STATUS 800 |
Sridhar Selvaraj | dc400d2 | 2016-10-18 17:18:03 +0530 | [diff] [blame] | 229 | #define WLAN_WAIT_TIME_POWER_STATS 800 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 230 | /* Amount of time to wait for sme close session callback. |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 231 | * 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] | 232 | * a response from WCNSS |
| 233 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 234 | #define WLAN_WAIT_TIME_SESSIONOPENCLOSE 15000 |
| 235 | #define WLAN_WAIT_TIME_ABORTSCAN 2000 |
| 236 | |
| 237 | /** Maximum time(ms) to wait for mc thread suspend **/ |
| 238 | #define WLAN_WAIT_TIME_MCTHREAD_SUSPEND 1200 |
| 239 | |
| 240 | /** Maximum time(ms) to wait for target to be ready for suspend **/ |
| 241 | #define WLAN_WAIT_TIME_READY_TO_SUSPEND 2000 |
| 242 | |
| 243 | /** Maximum time(ms) to wait for tdls add sta to complete **/ |
| 244 | #define WAIT_TIME_TDLS_ADD_STA 1500 |
| 245 | |
| 246 | /** Maximum time(ms) to wait for tdls del sta to complete **/ |
| 247 | #define WAIT_TIME_TDLS_DEL_STA 1500 |
| 248 | |
| 249 | /** Maximum time(ms) to wait for Link Establish Req to complete **/ |
| 250 | #define WAIT_TIME_TDLS_LINK_ESTABLISH_REQ 1500 |
| 251 | |
| 252 | /** Maximum time(ms) to wait for tdls mgmt to complete **/ |
| 253 | #define WAIT_TIME_TDLS_MGMT 11000 |
| 254 | |
| 255 | /* Scan Req Timeout */ |
| 256 | #define WLAN_WAIT_TIME_SCAN_REQ 100 |
| 257 | |
Archana Ramachandran | d41c3ed | 2016-02-10 15:48:06 -0800 | [diff] [blame] | 258 | #define WLAN_WAIT_TIME_ANTENNA_MODE_REQ 3000 |
| 259 | #define WLAN_WAIT_TIME_SET_DUAL_MAC_CFG 1500 |
| 260 | |
Nachiket Kukade | e547a48 | 2018-05-22 16:43:30 +0530 | [diff] [blame] | 261 | #define WLAN_WAIT_TIME_APF 1000 |
Arun Khandavalli | 2476ef5 | 2016-04-26 20:19:43 +0530 | [diff] [blame] | 262 | |
Rajeev Kumar Sirasanagandla | 197d417 | 2018-02-15 19:03:29 +0530 | [diff] [blame] | 263 | #define WLAN_WAIT_TIME_FW_ROAM_STATS 1000 |
| 264 | |
Sreelakshmi Konamki | 88a2a41 | 2017-04-14 15:11:55 +0530 | [diff] [blame] | 265 | /* Maximum time(ms) to wait for RSO CMD status event */ |
| 266 | #define WAIT_TIME_RSO_CMD_STATUS 2000 |
| 267 | |
Rajeev Kumar Sirasanagandla | 996e529 | 2016-11-22 21:20:33 +0530 | [diff] [blame] | 268 | /* rcpi request timeout in milli seconds */ |
| 269 | #define WLAN_WAIT_TIME_RCPI 500 |
| 270 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 271 | #define MAX_CFG_STRING_LEN 255 |
| 272 | |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 273 | /* Maximum time(ms) to wait for external acs response */ |
| 274 | #define WLAN_VENDOR_ACS_WAIT_TIME 1000 |
| 275 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 276 | #define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] |
| 277 | /** Mac Address string **/ |
| 278 | #define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x" |
| 279 | #define MAC_ADDRESS_STR_LEN 18 /* Including null terminator */ |
Rajeev Kumar | 67f5b87 | 2017-06-06 13:26:57 -0700 | [diff] [blame] | 280 | /* Max and min IEs length in bytes */ |
| 281 | #define MAX_GENIE_LEN (512) |
| 282 | #define MIN_GENIE_LEN (2) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 283 | |
Jeff Johnson | fc8c353 | 2018-04-18 14:12:23 -0700 | [diff] [blame] | 284 | /** Maximum Length of WPA/RSN IE */ |
| 285 | #define MAX_WPA_RSN_IE_LEN 255 |
| 286 | |
| 287 | #define WPS_OUI_TYPE "\x00\x50\xf2\x04" |
| 288 | #define WPS_OUI_TYPE_SIZE 4 |
| 289 | |
| 290 | #define SS_OUI_TYPE "\x00\x16\x32" |
| 291 | #define SS_OUI_TYPE_SIZE 3 |
| 292 | |
| 293 | #define P2P_OUI_TYPE "\x50\x6f\x9a\x09" |
| 294 | #define P2P_OUI_TYPE_SIZE 4 |
| 295 | |
| 296 | #define HS20_OUI_TYPE "\x50\x6f\x9a\x10" |
| 297 | #define HS20_OUI_TYPE_SIZE 4 |
| 298 | |
| 299 | #define OSEN_OUI_TYPE "\x50\x6f\x9a\x12" |
| 300 | #define OSEN_OUI_TYPE_SIZE 4 |
| 301 | |
| 302 | #ifdef WLAN_FEATURE_WFD |
| 303 | #define WFD_OUI_TYPE "\x50\x6f\x9a\x0a" |
| 304 | #define WFD_OUI_TYPE_SIZE 4 |
| 305 | #endif |
| 306 | |
| 307 | #define MBO_OUI_TYPE "\x50\x6f\x9a\x16" |
| 308 | #define MBO_OUI_TYPE_SIZE 4 |
| 309 | |
| 310 | #define QCN_OUI_TYPE "\x8c\xfd\xf0\x01" |
| 311 | #define QCN_OUI_TYPE_SIZE 4 |
| 312 | |
| 313 | #define wlan_hdd_get_wps_ie_ptr(ie, ie_len) \ |
| 314 | wlan_get_vendor_ie_ptr_from_oui(WPS_OUI_TYPE, WPS_OUI_TYPE_SIZE, \ |
| 315 | ie, ie_len) |
| 316 | |
| 317 | #define wlan_hdd_get_p2p_ie_ptr(ie, ie_len) \ |
| 318 | wlan_get_vendor_ie_ptr_from_oui(P2P_OUI_TYPE, P2P_OUI_TYPE_SIZE, \ |
| 319 | ie, ie_len) |
| 320 | |
| 321 | #ifdef WLAN_FEATURE_WFD |
| 322 | #define wlan_hdd_get_wfd_ie_ptr(ie, ie_len) \ |
| 323 | wlan_get_vendor_ie_ptr_from_oui(WFD_OUI_TYPE, WFD_OUI_TYPE_SIZE, \ |
| 324 | ie, ie_len) |
| 325 | #endif |
| 326 | |
| 327 | #define wlan_hdd_get_mbo_ie_ptr(ie, ie_len) \ |
| 328 | wlan_get_vendor_ie_ptr_from_oui(MBO_OUI_TYPE, MBO_OUI_TYPE_SIZE, \ |
| 329 | ie, ie_len) |
| 330 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 331 | #define WLAN_CHIP_VERSION "WCNSS" |
| 332 | |
Dustin Brown | 632af71 | 2018-03-14 15:03:55 -0700 | [diff] [blame] | 333 | #define hdd_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_HDD, params) |
| 334 | #define hdd_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_HDD, params) |
| 335 | #define hdd_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_HDD, params) |
| 336 | #define hdd_info(params...) QDF_TRACE_INFO(QDF_MODULE_ID_HDD, params) |
| 337 | #define hdd_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_HDD, params) |
| 338 | |
Nirav Shah | 790d943 | 2018-07-12 19:42:48 +0530 | [diff] [blame] | 339 | #define hdd_nofl_alert(params...) \ |
| 340 | QDF_TRACE_FATAL_NO_FL(QDF_MODULE_ID_HDD, params) |
| 341 | #define hdd_nofl_err(params...) \ |
| 342 | QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_HDD, params) |
| 343 | #define hdd_nofl_warn(params...) \ |
| 344 | QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_HDD, params) |
| 345 | #define hdd_nofl_info(params...) \ |
| 346 | QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_HDD, params) |
| 347 | #define hdd_nofl_debug(params...) \ |
| 348 | QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_HDD, params) |
| 349 | |
Dustin Brown | 500ae3d | 2018-03-19 12:47:33 -0700 | [diff] [blame] | 350 | #define hdd_alert_rl(params...) QDF_TRACE_FATAL_RL(QDF_MODULE_ID_HDD, params) |
| 351 | #define hdd_err_rl(params...) QDF_TRACE_ERROR_RL(QDF_MODULE_ID_HDD, params) |
| 352 | #define hdd_warn_rl(params...) QDF_TRACE_WARN_RL(QDF_MODULE_ID_HDD, params) |
| 353 | #define hdd_info_rl(params...) QDF_TRACE_INFO_RL(QDF_MODULE_ID_HDD, params) |
| 354 | #define hdd_debug_rl(params...) QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_HDD, params) |
Rajeev Kumar | 5cb007f | 2017-07-27 16:19:31 -0700 | [diff] [blame] | 355 | |
Nirav Shah | d6fa0f8 | 2018-07-06 15:52:25 +0530 | [diff] [blame] | 356 | #define hdd_enter() QDF_TRACE_ENTER(QDF_MODULE_ID_HDD, "enter") |
| 357 | #define hdd_enter_dev(dev) \ |
| 358 | QDF_TRACE_ENTER(QDF_MODULE_ID_HDD, "enter(%s)", (dev)->name) |
| 359 | #define hdd_exit() QDF_TRACE_EXIT(QDF_MODULE_ID_HDD, "exit") |
Dustin Brown | 32a6118 | 2018-03-14 12:14:00 -0700 | [diff] [blame] | 360 | |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 361 | #define WLAN_HDD_GET_PRIV_PTR(__dev__) \ |
| 362 | (struct hdd_adapter *)(netdev_priv((__dev__))) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 363 | |
| 364 | #define MAX_NO_OF_2_4_CHANNELS 14 |
| 365 | |
| 366 | #define WLAN_HDD_PUBLIC_ACTION_FRAME 4 |
| 367 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET 24 |
| 368 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET 24 |
| 369 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET 30 |
| 370 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_CATEGORY_OFFSET 0 |
| 371 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_ACTION_OFFSET 1 |
| 372 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_OFFSET 2 |
| 373 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_TYPE_OFFSET 5 |
| 374 | #define WLAN_HDD_VENDOR_SPECIFIC_ACTION 0x09 |
| 375 | #define WLAN_HDD_WFA_OUI 0x506F9A |
| 376 | #define WLAN_HDD_WFA_P2P_OUI_TYPE 0x09 |
| 377 | #define WLAN_HDD_P2P_SOCIAL_CHANNELS 3 |
| 378 | #define WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN 1 |
| 379 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_SUB_TYPE_OFFSET 6 |
| 380 | |
| 381 | #define WLAN_HDD_IS_SOCIAL_CHANNEL(center_freq) \ |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 382 | (((center_freq) == 2412) || ((center_freq) == 2437) || \ |
| 383 | ((center_freq) == 2462)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 384 | |
| 385 | #define WLAN_HDD_CHANNEL_IN_UNII_1_BAND(center_freq) \ |
| 386 | (((center_freq) == 5180) || ((center_freq) == 5200) \ |
| 387 | || ((center_freq) == 5220) || ((center_freq) == 5240)) |
| 388 | |
| 389 | #ifdef WLAN_FEATURE_11W |
| 390 | #define WLAN_HDD_SA_QUERY_ACTION_FRAME 8 |
| 391 | #endif |
| 392 | |
| 393 | #define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14 |
| 394 | #define WLAN_HDD_TDLS_ACTION_FRAME 12 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 395 | |
| 396 | #define WLAN_HDD_QOS_ACTION_FRAME 1 |
| 397 | #define WLAN_HDD_QOS_MAP_CONFIGURE 4 |
Dustin Brown | d0a7656 | 2017-10-13 14:48:37 -0700 | [diff] [blame] | 398 | #define HDD_SAP_WAKE_LOCK_DURATION WAKELOCK_DURATION_RECOMMENDED |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 399 | |
Rajeev Kumar | f98a5cc | 2017-07-28 08:42:46 -0700 | [diff] [blame] | 400 | /* SAP client disconnect wake lock duration in milli seconds */ |
Dustin Brown | d0a7656 | 2017-10-13 14:48:37 -0700 | [diff] [blame] | 401 | #define HDD_SAP_CLIENT_DISCONNECT_WAKE_LOCK_DURATION \ |
| 402 | WAKELOCK_DURATION_RECOMMENDED |
Rajeev Kumar | f98a5cc | 2017-07-28 08:42:46 -0700 | [diff] [blame] | 403 | |
Mukul Sharma | 974ca65 | 2016-09-03 16:24:48 +0530 | [diff] [blame] | 404 | #if defined(CONFIG_HL_SUPPORT) |
| 405 | #define HDD_MOD_EXIT_SSR_MAX_RETRIES 200 |
| 406 | #else |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 407 | #define HDD_MOD_EXIT_SSR_MAX_RETRIES 75 |
Mukul Sharma | 974ca65 | 2016-09-03 16:24:48 +0530 | [diff] [blame] | 408 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 409 | |
Paul Zhang | 8bbbcdf | 2018-06-01 11:14:57 +0800 | [diff] [blame] | 410 | #define HDD_CFG_REQUEST_FIRMWARE_RETRIES (3) |
| 411 | #define HDD_CFG_REQUEST_FIRMWARE_DELAY (20) |
| 412 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 413 | #define MAX_USER_COMMAND_SIZE 4096 |
Poddar, Siddarth | 31797fa | 2018-01-22 17:24:15 +0530 | [diff] [blame] | 414 | #define DNS_DOMAIN_NAME_MAX_LEN 255 |
| 415 | #define ICMPv6_ADDR_LEN 16 |
| 416 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 417 | |
| 418 | #define HDD_MIN_TX_POWER (-100) /* minimum tx power */ |
| 419 | #define HDD_MAX_TX_POWER (+100) /* maximum tx power */ |
| 420 | |
Dundi Raviteja | bb06d02 | 2018-05-31 15:54:15 +0530 | [diff] [blame] | 421 | #define HDD_ENABLE_SIFS_BURST_DEFAULT (1) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 422 | /* If IPA UC data path is enabled, target should reserve extra tx descriptors |
| 423 | * for IPA data path. |
| 424 | * Then host data path should allow less TX packet pumping in case |
| 425 | * IPA data path enabled |
| 426 | */ |
| 427 | #define WLAN_TFC_IPAUC_TX_DESC_RESERVE 100 |
| 428 | |
Ryan Hsu | 07495ea | 2016-01-21 15:25:39 -0800 | [diff] [blame] | 429 | /* |
| 430 | * NET_NAME_UNKNOWN is only introduced after Kernel 3.17, to have a macro |
| 431 | * here if the Kernel version is less than 3.17 to avoid the interleave |
| 432 | * conditional compilation. |
| 433 | */ |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 434 | #if !((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)) ||\ |
| 435 | defined(WITH_BACKPORTS)) |
Ryan Hsu | 07495ea | 2016-01-21 15:25:39 -0800 | [diff] [blame] | 436 | #define NET_NAME_UNKNOWN 0 |
| 437 | #endif |
| 438 | |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 439 | #define PRE_CAC_SSID "pre_cac_ssid" |
Arun Khandavalli | b2f6c26 | 2016-08-18 19:07:19 +0530 | [diff] [blame] | 440 | |
| 441 | /* session ID invalid */ |
| 442 | #define HDD_SESSION_ID_INVALID 0xFF |
| 443 | |
Sreelakshmi Konamki | b53c629 | 2017-03-01 13:13:23 +0530 | [diff] [blame] | 444 | #define SCAN_REJECT_THRESHOLD_TIME 300000 /* Time is in msec, equal to 5 mins */ |
Abhishek Singh | 0013068 | 2017-07-14 10:46:17 +0530 | [diff] [blame] | 445 | #define SCAN_REJECT_THRESHOLD 15 |
Sreelakshmi Konamki | b53c629 | 2017-03-01 13:13:23 +0530 | [diff] [blame] | 446 | |
Selvaraj, Sridhar | 0672a12 | 2016-12-29 16:11:48 +0530 | [diff] [blame] | 447 | /* Default Psoc id */ |
| 448 | #define DEFAULT_PSOC_ID 1 |
| 449 | |
Anurag Chouhan | 3920c0f | 2017-09-11 17:10:56 +0530 | [diff] [blame] | 450 | /* wait time for nud stats in milliseconds */ |
| 451 | #define WLAN_WAIT_TIME_NUD_STATS 800 |
| 452 | /* nud stats skb max length */ |
| 453 | #define WLAN_NUD_STATS_LEN 800 |
| 454 | /* ARP packet type for NUD debug stats */ |
| 455 | #define WLAN_NUD_STATS_ARP_PKT_TYPE 1 |
Hanumanth Reddy Pothula | 07e5f99 | 2017-11-08 19:35:19 +0530 | [diff] [blame] | 456 | /* Assigned size of driver memory dump is 4096 bytes */ |
| 457 | #define DRIVER_MEM_DUMP_SIZE 4096 |
Anurag Chouhan | 3920c0f | 2017-09-11 17:10:56 +0530 | [diff] [blame] | 458 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 459 | /* |
| 460 | * Generic asynchronous request/response support |
| 461 | * |
| 462 | * Many of the APIs supported by HDD require a call to SME to |
| 463 | * perform an action or to retrieve some data. In most cases SME |
| 464 | * performs the operation asynchronously, and will execute a provided |
| 465 | * callback function when the request has completed. In order to |
| 466 | * synchronize this the HDD API allocates a context which is then |
| 467 | * passed to SME, and which is then, in turn, passed back to the |
| 468 | * callback function when the operation completes. The callback |
| 469 | * function then sets a completion variable inside the context which |
| 470 | * the HDD API is waiting on. In an ideal world the HDD API would |
| 471 | * wait forever (or at least for a long time) for the response to be |
| 472 | * received and for the completion variable to be set. However in |
| 473 | * most cases these HDD APIs are being invoked in the context of a |
| 474 | * user space thread which has invoked either a cfg80211 API or a |
| 475 | * wireless extensions ioctl and which has taken the kernel rtnl_lock. |
| 476 | * Since this lock is used to synchronize many of the kernel tasks, we |
| 477 | * do not want to hold it for a long time. In addition we do not want |
| 478 | * to block user space threads (such as the wpa supplicant's main |
| 479 | * thread) for an extended time. Therefore we only block for a short |
| 480 | * time waiting for the response before we timeout. This means that |
| 481 | * it is possible for the HDD API to timeout, and for the callback to |
| 482 | * be invoked afterwards. In order for the callback function to |
| 483 | * determine if the HDD API is still waiting, a magic value is also |
| 484 | * stored in the shared context. Only if the context has a valid |
| 485 | * magic will the callback routine do any work. In order to further |
| 486 | * synchronize these activities a spinlock is used so that if any HDD |
| 487 | * API timeout coincides with its callback, the operations of the two |
| 488 | * threads will be serialized. |
| 489 | */ |
| 490 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 491 | extern spinlock_t hdd_context_lock; |
Arunk Khandavalli | 16d8425 | 2017-06-21 15:26:29 +0530 | [diff] [blame] | 492 | extern struct mutex hdd_init_deinit_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 493 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 494 | /* MAX OS Q block time value in msec |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 495 | * Prevent from permanent stall, resume OS Q if timer expired |
| 496 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 497 | #define WLAN_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME 1000 |
| 498 | #define WLAN_SAP_HDD_TX_FLOW_CONTROL_OS_Q_BLOCK_TIME 100 |
| 499 | #define WLAN_HDD_TX_FLOW_CONTROL_MAX_24BAND_CH 14 |
| 500 | |
Nirav Shah | 997e083 | 2018-06-06 17:49:12 +0530 | [diff] [blame] | 501 | #ifndef NUM_TX_RX_HISTOGRAM |
Mohit Khanna | 3e2115b | 2016-10-11 13:18:29 -0700 | [diff] [blame] | 502 | #define NUM_TX_RX_HISTOGRAM 128 |
Nirav Shah | 997e083 | 2018-06-06 17:49:12 +0530 | [diff] [blame] | 503 | #endif |
| 504 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 505 | #define NUM_TX_RX_HISTOGRAM_MASK (NUM_TX_RX_HISTOGRAM - 1) |
| 506 | |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 507 | /** |
Jeff Johnson | 37ecea4 | 2018-03-18 17:54:40 -0700 | [diff] [blame] | 508 | * enum hdd_auth_key_mgmt - auth key mgmt protocols |
| 509 | * @HDD_AUTH_KEY_MGMT_802_1X: 802.1x |
| 510 | * @HDD_AUTH_KEY_MGMT_PSK: PSK |
| 511 | * @HDD_AUTH_KEY_MGMT_CCKM: CCKM |
| 512 | */ |
| 513 | enum hdd_auth_key_mgmt { |
| 514 | HDD_AUTH_KEY_MGMT_802_1X = BIT(0), |
| 515 | HDD_AUTH_KEY_MGMT_PSK = BIT(1), |
| 516 | HDD_AUTH_KEY_MGMT_CCKM = BIT(2) |
| 517 | }; |
| 518 | |
| 519 | /** |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 520 | * struct hdd_tx_rx_histogram - structure to keep track of tx and rx packets |
| 521 | * received over 100ms intervals |
| 522 | * @interval_rx: # of rx packets received in the last 100ms interval |
| 523 | * @interval_tx: # of tx packets received in the last 100ms interval |
Yuanyuan Liu | 1373850 | 2016-04-06 17:41:37 -0700 | [diff] [blame] | 524 | * @next_vote_level: pld_bus_width_type voting level (high or low) |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 525 | * determined on the basis of total tx and rx packets |
| 526 | * received in the last 100ms interval |
Yuanyuan Liu | 1373850 | 2016-04-06 17:41:37 -0700 | [diff] [blame] | 527 | * @next_rx_level: pld_bus_width_type voting level (high or low) |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 528 | * determined on the basis of rx packets received in the |
| 529 | * last 100ms interval |
Yuanyuan Liu | 1373850 | 2016-04-06 17:41:37 -0700 | [diff] [blame] | 530 | * @next_tx_level: pld_bus_width_type voting level (high or low) |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 531 | * determined on the basis of tx packets received in the |
| 532 | * last 100ms interval |
Mohit Khanna | afff9fb | 2016-11-16 20:22:03 -0800 | [diff] [blame] | 533 | * @qtime timestamp when the record is added |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 534 | * |
Mohit Khanna | afff9fb | 2016-11-16 20:22:03 -0800 | [diff] [blame] | 535 | * The structure keeps track of throughput requirements of wlan driver. |
| 536 | * An entry is added if either of next_vote_level, next_rx_level or |
| 537 | * 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] | 538 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 539 | struct hdd_tx_rx_histogram { |
| 540 | uint64_t interval_rx; |
| 541 | uint64_t interval_tx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 542 | uint32_t next_vote_level; |
| 543 | uint32_t next_rx_level; |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 544 | uint32_t next_tx_level; |
Mohit Khanna | afff9fb | 2016-11-16 20:22:03 -0800 | [diff] [blame] | 545 | uint64_t qtime; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 546 | }; |
| 547 | |
Jeff Johnson | ba1d0ca | 2017-09-30 16:24:31 -0700 | [diff] [blame] | 548 | struct hdd_tx_rx_stats { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 549 | /* start_xmit stats */ |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 550 | __u32 tx_called; |
| 551 | __u32 tx_dropped; |
| 552 | __u32 tx_orphaned; |
| 553 | __u32 tx_classified_ac[NUM_TX_QUEUES]; |
| 554 | __u32 tx_dropped_ac[NUM_TX_QUEUES]; |
Mohit Khanna | d0b63f5 | 2017-02-18 18:05:52 -0800 | [diff] [blame] | 555 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 556 | /* rx stats */ |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 557 | __u32 rx_packets[NUM_CPUS]; |
| 558 | __u32 rx_dropped[NUM_CPUS]; |
| 559 | __u32 rx_delivered[NUM_CPUS]; |
| 560 | __u32 rx_refused[NUM_CPUS]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 561 | |
| 562 | /* txflow stats */ |
| 563 | bool is_txflow_paused; |
| 564 | __u32 txflow_pause_cnt; |
| 565 | __u32 txflow_unpause_cnt; |
| 566 | __u32 txflow_timer_cnt; |
Sravan Kumar Kairam | 3a69831 | 2017-10-16 14:16:16 +0530 | [diff] [blame] | 567 | |
| 568 | /*tx timeout stats*/ |
| 569 | __u32 tx_timeout_cnt; |
| 570 | __u32 cont_txtimeout_cnt; |
| 571 | u64 jiffies_last_txtimeout; |
Jeff Johnson | ba1d0ca | 2017-09-30 16:24:31 -0700 | [diff] [blame] | 572 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 573 | |
| 574 | #ifdef WLAN_FEATURE_11W |
Jeff Johnson | a49c0ac | 2017-08-15 13:52:08 -0700 | [diff] [blame] | 575 | /** |
| 576 | * struct hdd_pmf_stats - Protected Management Frame statistics |
Jeff Johnson | dc179f4 | 2017-10-21 11:27:26 -0700 | [diff] [blame] | 577 | * @num_unprot_deauth_rx: Number of unprotected deauth frames received |
| 578 | * @num_unprot_disassoc_rx: Number of unprotected disassoc frames received |
Jeff Johnson | a49c0ac | 2017-08-15 13:52:08 -0700 | [diff] [blame] | 579 | */ |
| 580 | struct hdd_pmf_stats { |
Jeff Johnson | dc179f4 | 2017-10-21 11:27:26 -0700 | [diff] [blame] | 581 | uint8_t num_unprot_deauth_rx; |
| 582 | uint8_t num_unprot_disassoc_rx; |
Jeff Johnson | a49c0ac | 2017-08-15 13:52:08 -0700 | [diff] [blame] | 583 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 584 | #endif |
| 585 | |
Poddar, Siddarth | 31797fa | 2018-01-22 17:24:15 +0530 | [diff] [blame] | 586 | /** |
| 587 | * struct hdd_arp_stats_s - arp debug stats count |
| 588 | * @tx_arp_req_count: no. of arp req received from network stack |
| 589 | * @rx_arp_rsp_count: no. of arp res received from FW |
| 590 | * @tx_dropped: no. of arp req dropped at hdd layer |
| 591 | * @rx_dropped: no. of arp res dropped |
| 592 | * @rx_delivered: no. of arp res delivered to network stack |
| 593 | * @rx_refused: no of arp rsp refused (not delivered) to network stack |
| 594 | * @tx_host_fw_sent: no of arp req sent by FW OTA |
| 595 | * @rx_host_drop_reorder: no of arp res dropped by host |
| 596 | * @rx_fw_cnt: no of arp res received by FW |
| 597 | * @tx_ack_cnt: no of arp req acked by FW |
| 598 | */ |
Anurag Chouhan | 3920c0f | 2017-09-11 17:10:56 +0530 | [diff] [blame] | 599 | struct hdd_arp_stats_s { |
Sravan Kumar Kairam | c1ae71c | 2017-02-24 12:27:27 +0530 | [diff] [blame] | 600 | uint16_t tx_arp_req_count; |
| 601 | uint16_t rx_arp_rsp_count; |
Anurag Chouhan | 3920c0f | 2017-09-11 17:10:56 +0530 | [diff] [blame] | 602 | uint16_t tx_dropped; |
| 603 | uint16_t rx_dropped; |
| 604 | uint16_t rx_delivered; |
| 605 | uint16_t rx_refused; |
| 606 | uint16_t tx_host_fw_sent; |
| 607 | uint16_t rx_host_drop_reorder; |
Anurag Chouhan | 3920c0f | 2017-09-11 17:10:56 +0530 | [diff] [blame] | 608 | uint16_t rx_fw_cnt; |
| 609 | uint16_t tx_ack_cnt; |
| 610 | }; |
| 611 | |
Jeff Johnson | 07f9474 | 2017-08-14 15:55:40 -0700 | [diff] [blame] | 612 | /** |
Poddar, Siddarth | 31797fa | 2018-01-22 17:24:15 +0530 | [diff] [blame] | 613 | * struct hdd_dns_stats_s - dns debug stats count |
| 614 | * @tx_dns_req_count: no. of dns query received from network stack |
| 615 | * @rx_dns_rsp_count: no. of dns res received from FW |
| 616 | * @tx_dropped: no. of dns query dropped at hdd layer |
| 617 | * @rx_delivered: no. of dns res delivered to network stack |
| 618 | * @rx_refused: no of dns res refused (not delivered) to network stack |
| 619 | * @tx_host_fw_sent: no of dns query sent by FW OTA |
| 620 | * @rx_host_drop: no of dns res dropped by host |
| 621 | * @tx_ack_cnt: no of dns req acked by FW |
Jeff Johnson | 07f9474 | 2017-08-14 15:55:40 -0700 | [diff] [blame] | 622 | */ |
Poddar, Siddarth | 31797fa | 2018-01-22 17:24:15 +0530 | [diff] [blame] | 623 | struct hdd_dns_stats_s { |
| 624 | uint16_t tx_dns_req_count; |
| 625 | uint16_t rx_dns_rsp_count; |
| 626 | uint16_t tx_dropped; |
| 627 | uint16_t rx_delivered; |
| 628 | uint16_t rx_refused; |
| 629 | uint16_t tx_host_fw_sent; |
| 630 | uint16_t rx_host_drop; |
| 631 | uint16_t tx_ack_cnt; |
| 632 | }; |
| 633 | |
| 634 | /** |
| 635 | * struct hdd_tcp_stats_s - tcp debug stats count |
| 636 | * @tx_tcp_syn_count: no. of tcp syn received from network stack |
| 637 | * @@tx_tcp_ack_count: no. of tcp ack received from network stack |
| 638 | * @rx_tcp_syn_ack_count: no. of tcp syn ack received from FW |
| 639 | * @tx_tcp_syn_dropped: no. of tcp syn dropped at hdd layer |
| 640 | * @tx_tcp_ack_dropped: no. of tcp ack dropped at hdd layer |
| 641 | * @rx_delivered: no. of tcp syn ack delivered to network stack |
| 642 | * @rx_refused: no of tcp syn ack refused (not delivered) to network stack |
| 643 | * @tx_tcp_syn_host_fw_sent: no of tcp syn sent by FW OTA |
| 644 | * @@tx_tcp_ack_host_fw_sent: no of tcp ack sent by FW OTA |
| 645 | * @rx_host_drop: no of tcp syn ack dropped by host |
| 646 | * @tx_tcp_syn_ack_cnt: no of tcp syn acked by FW |
| 647 | * @tx_tcp_syn_ack_cnt: no of tcp ack acked by FW |
| 648 | * @is_tcp_syn_ack_rcv: flag to check tcp syn ack received or not |
| 649 | * @is_tcp_ack_sent: flag to check tcp ack sent or not |
| 650 | */ |
| 651 | struct hdd_tcp_stats_s { |
| 652 | uint16_t tx_tcp_syn_count; |
| 653 | uint16_t tx_tcp_ack_count; |
| 654 | uint16_t rx_tcp_syn_ack_count; |
| 655 | uint16_t tx_tcp_syn_dropped; |
| 656 | uint16_t tx_tcp_ack_dropped; |
| 657 | uint16_t rx_delivered; |
| 658 | uint16_t rx_refused; |
| 659 | uint16_t tx_tcp_syn_host_fw_sent; |
| 660 | uint16_t tx_tcp_ack_host_fw_sent; |
| 661 | uint16_t rx_host_drop; |
| 662 | uint16_t rx_fw_cnt; |
| 663 | uint16_t tx_tcp_syn_ack_cnt; |
| 664 | uint16_t tx_tcp_ack_ack_cnt; |
| 665 | bool is_tcp_syn_ack_rcv; |
| 666 | bool is_tcp_ack_sent; |
| 667 | |
| 668 | }; |
| 669 | |
| 670 | /** |
| 671 | * struct hdd_icmpv4_stats_s - icmpv4 debug stats count |
| 672 | * @tx_icmpv4_req_count: no. of icmpv4 req received from network stack |
| 673 | * @rx_icmpv4_rsp_count: no. of icmpv4 res received from FW |
| 674 | * @tx_dropped: no. of icmpv4 req dropped at hdd layer |
| 675 | * @rx_delivered: no. of icmpv4 res delivered to network stack |
| 676 | * @rx_refused: no of icmpv4 res refused (not delivered) to network stack |
| 677 | * @tx_host_fw_sent: no of icmpv4 req sent by FW OTA |
| 678 | * @rx_host_drop: no of icmpv4 res dropped by host |
| 679 | * @rx_fw_cnt: no of icmpv4 res received by FW |
| 680 | * @tx_ack_cnt: no of icmpv4 req acked by FW |
| 681 | */ |
| 682 | struct hdd_icmpv4_stats_s { |
| 683 | uint16_t tx_icmpv4_req_count; |
| 684 | uint16_t rx_icmpv4_rsp_count; |
| 685 | uint16_t tx_dropped; |
| 686 | uint16_t rx_delivered; |
| 687 | uint16_t rx_refused; |
| 688 | uint16_t tx_host_fw_sent; |
| 689 | uint16_t rx_host_drop; |
| 690 | uint16_t rx_fw_cnt; |
| 691 | uint16_t tx_ack_cnt; |
| 692 | }; |
| 693 | |
Jeff Johnson | 07f9474 | 2017-08-14 15:55:40 -0700 | [diff] [blame] | 694 | struct hdd_stats { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 695 | tCsrSummaryStatsInfo summary_stat; |
Jeff Johnson | 861dd4f | 2017-10-24 10:10:40 -0700 | [diff] [blame] | 696 | tCsrGlobalClassAStatsInfo class_a_stat; |
Jeff Johnson | f8cadec | 2017-10-24 10:21:25 -0700 | [diff] [blame] | 697 | tCsrGlobalClassDStatsInfo class_d_stat; |
Himanshu Agarwal | 37e4241 | 2016-07-21 14:35:09 +0530 | [diff] [blame] | 698 | struct csr_per_chain_rssi_stats_info per_chain_rssi_stats; |
Jeff Johnson | 6ced42c | 2017-10-20 12:48:11 -0700 | [diff] [blame] | 699 | struct hdd_tx_rx_stats tx_rx_stats; |
Anurag Chouhan | 3920c0f | 2017-09-11 17:10:56 +0530 | [diff] [blame] | 700 | struct hdd_arp_stats_s hdd_arp_stats; |
Poddar, Siddarth | 31797fa | 2018-01-22 17:24:15 +0530 | [diff] [blame] | 701 | struct hdd_dns_stats_s hdd_dns_stats; |
| 702 | struct hdd_tcp_stats_s hdd_tcp_stats; |
| 703 | struct hdd_icmpv4_stats_s hdd_icmpv4_stats; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 704 | #ifdef WLAN_FEATURE_11W |
Jeff Johnson | dc179f4 | 2017-10-21 11:27:26 -0700 | [diff] [blame] | 705 | struct hdd_pmf_stats hdd_pmf_stats; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 706 | #endif |
Jeff Johnson | 07f9474 | 2017-08-14 15:55:40 -0700 | [diff] [blame] | 707 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 708 | |
Jeff Johnson | 41a6496 | 2017-08-14 15:29:42 -0700 | [diff] [blame] | 709 | /** |
| 710 | * struct hdd_roaming_info - HDD Internal Roaming Information |
Jeff Johnson | 41a6496 | 2017-08-14 15:29:42 -0700 | [diff] [blame] | 711 | * @bssid: BSSID to which we are connected |
Jeff Johnson | af2ae4b | 2017-11-01 11:38:50 -0700 | [diff] [blame] | 712 | * @peer_mac: Peer MAC address for IBSS connection |
| 713 | * @roam_id: Unique identifier for a roaming instance |
| 714 | * @roam_status: Current roam command status |
| 715 | * @defer_key_complete: Should key complete be deferred? |
Jeff Johnson | 41a6496 | 2017-08-14 15:29:42 -0700 | [diff] [blame] | 716 | * |
| 717 | */ |
| 718 | struct hdd_roaming_info { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 719 | tSirMacAddr bssid; |
Jeff Johnson | af2ae4b | 2017-11-01 11:38:50 -0700 | [diff] [blame] | 720 | tSirMacAddr peer_mac; |
| 721 | uint32_t roam_id; |
| 722 | eRoamCmdStatus roam_status; |
| 723 | bool defer_key_complete; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 724 | |
Jeff Johnson | 41a6496 | 2017-08-14 15:29:42 -0700 | [diff] [blame] | 725 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 726 | |
| 727 | #ifdef FEATURE_WLAN_WAPI |
| 728 | /* Define WAPI macros for Length, BKID count etc*/ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 729 | #define MAC_ADDR_LEN 6 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 730 | #define MAX_NUM_AKM_SUITES 16 |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 731 | |
| 732 | /** WAPI AUTH mode definition */ |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 733 | enum wapi_auth_mode { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 734 | WAPI_AUTH_MODE_OPEN = 0, |
| 735 | WAPI_AUTH_MODE_PSK = 1, |
| 736 | WAPI_AUTH_MODE_CERT |
| 737 | } __packed; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 738 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 739 | #define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) |
| 740 | #define WPA_GET_BE24(a) ((u32) ((a[0] << 16) | (a[1] << 8) | a[2])) |
| 741 | #define WLAN_EID_WAPI 68 |
| 742 | #define WAPI_PSK_AKM_SUITE 0x02721400 |
| 743 | #define WAPI_CERT_AKM_SUITE 0x01721400 |
| 744 | |
Jeff Johnson | 89798aa | 2017-08-16 11:00:56 -0700 | [diff] [blame] | 745 | /** |
| 746 | * struct hdd_wapi_info - WAPI Information structure definition |
Jeff Johnson | 7d2f4c6 | 2017-11-02 09:25:45 -0700 | [diff] [blame] | 747 | * @wapi_mode: Is WAPI enabled on this adapter? |
| 748 | * @is_wapi_sta: Is the STA associated with WAPI? |
| 749 | * @wapi_auth_mode: WAPI authentication mode used by this adapter |
Jeff Johnson | 89798aa | 2017-08-16 11:00:56 -0700 | [diff] [blame] | 750 | */ |
| 751 | struct hdd_wapi_info { |
Jeff Johnson | 7d2f4c6 | 2017-11-02 09:25:45 -0700 | [diff] [blame] | 752 | bool wapi_mode; |
| 753 | bool is_wapi_sta; |
| 754 | enum wapi_auth_mode wapi_auth_mode; |
Jeff Johnson | 89798aa | 2017-08-16 11:00:56 -0700 | [diff] [blame] | 755 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 756 | #endif /* FEATURE_WLAN_WAPI */ |
| 757 | |
Jeff Johnson | 44e5217 | 2017-09-30 16:39:16 -0700 | [diff] [blame] | 758 | struct hdd_beacon_data { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 759 | u8 *head; |
| 760 | u8 *tail; |
| 761 | u8 *proberesp_ies; |
| 762 | u8 *assocresp_ies; |
| 763 | int head_len; |
| 764 | int tail_len; |
| 765 | int proberesp_ies_len; |
| 766 | int assocresp_ies_len; |
| 767 | int dtim_period; |
Jeff Johnson | 44e5217 | 2017-09-30 16:39:16 -0700 | [diff] [blame] | 768 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 769 | |
Jeff Johnson | c945f56 | 2017-09-29 16:15:58 -0700 | [diff] [blame] | 770 | struct action_pkt_buffer { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 771 | uint8_t *frame_ptr; |
| 772 | uint32_t frame_length; |
| 773 | uint16_t freq; |
Jeff Johnson | c945f56 | 2017-09-29 16:15:58 -0700 | [diff] [blame] | 774 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 775 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 776 | /** |
| 777 | * struct hdd_scan_req - Scan Request entry |
| 778 | * @node : List entry element |
| 779 | * @adapter: Adapter address |
| 780 | * @scan_request: scan request holder |
| 781 | * @scan_id: scan identifier used across host layers which is generated at WMI |
| 782 | * @cookie: scan request identifier sent to userspace |
| 783 | * @source: scan request originator (NL/Vendor scan) |
| 784 | * @timestamp: scan request timestamp |
| 785 | * |
| 786 | * Scan request linked list element |
| 787 | */ |
| 788 | struct hdd_scan_req { |
Anurag Chouhan | ffb2154 | 2016-02-17 14:33:03 +0530 | [diff] [blame] | 789 | qdf_list_node_t node; |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 790 | struct hdd_adapter *adapter; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 791 | struct cfg80211_scan_request *scan_request; |
| 792 | uint32_t scan_id; |
| 793 | uint8_t source; |
| 794 | uint32_t timestamp; |
Nachiket Kukade | c34d4a3 | 2017-07-12 16:20:27 +0530 | [diff] [blame] | 795 | qdf_timer_t hdd_scan_inactivity_timer; |
| 796 | uint32_t scan_req_flags; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 797 | }; |
| 798 | |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 799 | /** |
| 800 | * struct hdd_mon_set_ch_info - Holds monitor mode channel switch params |
| 801 | * @channel: Channel number. |
| 802 | * @cb_mode: Channel bonding |
| 803 | * @channel_width: Channel width 0/1/2 for 20/40/80MHz respectively. |
| 804 | * @phy_mode: PHY mode |
| 805 | */ |
| 806 | struct hdd_mon_set_ch_info { |
| 807 | uint8_t channel; |
| 808 | uint8_t cb_mode; |
| 809 | uint32_t channel_width; |
| 810 | eCsrPhyMode phy_mode; |
| 811 | }; |
| 812 | |
Jeff Johnson | ce4a834 | 2017-10-14 13:12:22 -0700 | [diff] [blame] | 813 | /** |
| 814 | * struct hdd_station_ctx -- STA-specific information |
Jeff Johnson | fd9928a | 2018-03-19 15:17:29 -0700 | [diff] [blame] | 815 | * @roam_profile: current roaming profile |
| 816 | * @security_ie: WPA or RSN IE used by the @roam_profile |
| 817 | * @assoc_additional_ie: association additional IE used by the @roam_profile |
Jeff Johnson | ce4a834 | 2017-10-14 13:12:22 -0700 | [diff] [blame] | 818 | * @wpa_versions: bitmap of supported WPA versions |
Jeff Johnson | 37ecea4 | 2018-03-18 17:54:40 -0700 | [diff] [blame] | 819 | * @auth_key_mgmt: bitmap of supported auth key mgmt protocols |
Jeff Johnson | 731bc32 | 2017-10-14 19:53:44 -0700 | [diff] [blame] | 820 | * @requested_bssid: Specific BSSID to which to connect |
Jeff Johnson | ce4a834 | 2017-10-14 13:12:22 -0700 | [diff] [blame] | 821 | * @conn_info: current connection information |
| 822 | * @roam_info: current roaming information |
| 823 | * @ft_carrier_on: is carrier on |
| 824 | * @ibss_sta_generation: current ibss generation. Incremented whenever |
| 825 | * ibss New peer joins and departs the network |
| 826 | * @ibss_enc_key_installed: is the ibss wep/wpa-none encryptions key |
| 827 | * installed? |
| 828 | * @ibss_enc_key: current ibss wep/wpa-none encryption key (if |
| 829 | * @ibss_enc_key_installed is %true) |
| 830 | * @ibss_peer_info: information about the ibss peer |
Jeff Johnson | 690fe95 | 2017-10-25 11:48:39 -0700 | [diff] [blame] | 831 | * @hdd_reassoc_scenario: is station in the middle of reassociation? |
Jeff Johnson | 8380f23 | 2017-10-25 12:39:44 -0700 | [diff] [blame] | 832 | * @sta_debug_state: STA context debug variable |
Jeff Johnson | ce4a834 | 2017-10-14 13:12:22 -0700 | [diff] [blame] | 833 | * @broadcast_staid: STA ID assigned for broadcast frames |
| 834 | * @ch_info: monitor mode channel information |
| 835 | * @ndp_ctx: NAN data path context |
| 836 | * @ap_supports_immediate_power_save: Does the current AP allow our STA |
| 837 | * to immediately go into power save? |
| 838 | */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 839 | struct hdd_station_ctx { |
Jeff Johnson | fd9928a | 2018-03-19 15:17:29 -0700 | [diff] [blame] | 840 | struct csr_roam_profile roam_profile; |
| 841 | uint8_t security_ie[MAX_WPA_RSN_IE_LEN]; |
| 842 | tSirAddie assoc_additional_ie; |
Jeff Johnson | ce4a834 | 2017-10-14 13:12:22 -0700 | [diff] [blame] | 843 | enum nl80211_wpa_versions wpa_versions; |
Jeff Johnson | 37ecea4 | 2018-03-18 17:54:40 -0700 | [diff] [blame] | 844 | enum hdd_auth_key_mgmt auth_key_mgmt; |
Jeff Johnson | 731bc32 | 2017-10-14 19:53:44 -0700 | [diff] [blame] | 845 | struct qdf_mac_addr requested_bssid; |
Jeff Johnson | e4bad25 | 2017-08-14 14:09:28 -0700 | [diff] [blame] | 846 | struct hdd_connection_info conn_info; |
Ashish Kumar Dhanotiya | 36d19b0 | 2018-02-22 00:59:49 +0530 | [diff] [blame] | 847 | struct hdd_connection_info cache_conn_info; |
Jeff Johnson | 41a6496 | 2017-08-14 15:29:42 -0700 | [diff] [blame] | 848 | struct hdd_roaming_info roam_info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 849 | int ft_carrier_on; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 850 | int ibss_sta_generation; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 851 | bool ibss_enc_key_installed; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 852 | tCsrRoamSetKey ibss_enc_key; |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 853 | tSirPeerInfoRspParams ibss_peer_info; |
Jeff Johnson | 690fe95 | 2017-10-25 11:48:39 -0700 | [diff] [blame] | 854 | bool hdd_reassoc_scenario; |
Jeff Johnson | 8380f23 | 2017-10-25 12:39:44 -0700 | [diff] [blame] | 855 | int sta_debug_state; |
Rakesh Sunki | cf1c9ab | 2016-08-25 14:11:25 -0700 | [diff] [blame] | 856 | uint8_t broadcast_staid; |
Manjunathappa Prakash | 59f861d | 2016-04-21 10:33:31 -0700 | [diff] [blame] | 857 | struct hdd_mon_set_ch_info ch_info; |
Krunal Soni | 364e087 | 2017-05-10 21:24:34 -0700 | [diff] [blame] | 858 | bool ap_supports_immediate_power_save; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 859 | }; |
| 860 | |
Jeff Johnson | 0f9f87b | 2017-10-28 09:21:06 -0700 | [diff] [blame] | 861 | /** |
| 862 | * enum bss_state - current state of the BSS |
| 863 | * @BSS_STOP: BSS is stopped |
| 864 | * @BSS_START: BSS is started |
| 865 | */ |
| 866 | enum bss_state { |
| 867 | BSS_STOP, |
| 868 | BSS_START, |
| 869 | }; |
| 870 | |
| 871 | /** |
| 872 | * struct hdd_hostapd_state - hostapd-related state information |
| 873 | * @bss_state: Current state of the BSS |
| 874 | * @qdf_event: Event to synchronize actions between hostapd thread and |
| 875 | * internal callback threads |
| 876 | * @qdf_stop_bss_event: Event to synchronize Stop BSS. When Stop BSS |
| 877 | * is issued userspace thread can wait on this event. The event will |
| 878 | * be set when the Stop BSS processing in UMAC has completed. |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 879 | * @qdf_sta_disassoc_event: Event to synchronize STA Disassociation. |
| 880 | * When a STA is disassociated userspace thread can wait on this |
| 881 | * event. The event will be set when the STA Disassociation |
| 882 | * processing in UMAC has completed. |
Jeff Johnson | 0f9f87b | 2017-10-28 09:21:06 -0700 | [diff] [blame] | 883 | * @qdf_status: Used to communicate state from other threads to the |
| 884 | * userspace thread. |
| 885 | */ |
Jeff Johnson | ca2530c | 2017-09-30 18:25:40 -0700 | [diff] [blame] | 886 | struct hdd_hostapd_state { |
Jeff Johnson | 0f9f87b | 2017-10-28 09:21:06 -0700 | [diff] [blame] | 887 | enum bss_state bss_state; |
Anurag Chouhan | f04e84f | 2016-03-03 10:12:12 +0530 | [diff] [blame] | 888 | qdf_event_t qdf_event; |
| 889 | qdf_event_t qdf_stop_bss_event; |
Wei Song | 2f76f64 | 2016-11-18 16:32:53 +0800 | [diff] [blame] | 890 | qdf_event_t qdf_sta_disassoc_event; |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 891 | QDF_STATUS qdf_status; |
Jeff Johnson | ca2530c | 2017-09-30 18:25:40 -0700 | [diff] [blame] | 892 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 893 | |
wadesong | 9b81907 | 2017-02-07 16:42:09 +0800 | [diff] [blame] | 894 | /** |
| 895 | * enum bss_stop_reason - reasons why a BSS is stopped. |
| 896 | * @BSS_STOP_REASON_INVALID: no reason specified explicitly. |
| 897 | * @BSS_STOP_DUE_TO_MCC_SCC_SWITCH: BSS stopped due to host |
| 898 | * driver is trying to switch AP role to a different channel |
| 899 | * to maintain SCC mode with the STA role on the same card. |
| 900 | * this usually happens when STA is connected to an external |
| 901 | * AP that runs on a different channel |
hqu | 73bccf2 | 2017-10-28 15:34:17 +0800 | [diff] [blame] | 902 | * @BSS_STOP_DUE_TO_VENDOR_CONFIG_CHAN: BSS stopped due to |
| 903 | * vendor subcmd set sap config channel |
wadesong | 9b81907 | 2017-02-07 16:42:09 +0800 | [diff] [blame] | 904 | */ |
| 905 | enum bss_stop_reason { |
| 906 | BSS_STOP_REASON_INVALID = 0, |
| 907 | BSS_STOP_DUE_TO_MCC_SCC_SWITCH = 1, |
hqu | 73bccf2 | 2017-10-28 15:34:17 +0800 | [diff] [blame] | 908 | BSS_STOP_DUE_TO_VENDOR_CONFIG_CHAN = 2, |
wadesong | 9b81907 | 2017-02-07 16:42:09 +0800 | [diff] [blame] | 909 | }; |
| 910 | |
Will Huang | 496b36c | 2017-07-11 16:38:50 +0800 | [diff] [blame] | 911 | /** |
| 912 | * struct hdd_rate_info - rate_info in HDD |
| 913 | * @rate: tx/rx rate (kbps) |
| 914 | * @mode: 0->11abg legacy, 1->HT, 2->VHT (refer to sir_sme_phy_mode) |
| 915 | * @nss: number of streams |
| 916 | * @mcs: mcs index for HT/VHT mode |
| 917 | * @rate_flags: rate flags for last tx/rx |
| 918 | * |
| 919 | * rate info in HDD |
| 920 | */ |
| 921 | struct hdd_rate_info { |
| 922 | uint32_t rate; |
| 923 | uint8_t mode; |
| 924 | uint8_t nss; |
| 925 | uint8_t mcs; |
| 926 | uint8_t rate_flags; |
| 927 | }; |
| 928 | |
| 929 | /** |
| 930 | * struct hdd_fw_txrx_stats - fw txrx status in HDD |
| 931 | * (refer to station_info struct in Kernel) |
| 932 | * @tx_packets: packets transmitted to this station |
| 933 | * @tx_bytes: bytes transmitted to this station |
| 934 | * @rx_packets: packets received from this station |
| 935 | * @rx_bytes: bytes received from this station |
| 936 | * @rx_retries: cumulative retry counts |
| 937 | * @tx_failed: number of failed transmissions |
| 938 | * @rssi: The signal strength (dbm) |
| 939 | * @tx_rate: last used tx rate info |
| 940 | * @rx_rate: last used rx rate info |
| 941 | * |
| 942 | * fw txrx status in HDD |
| 943 | */ |
| 944 | struct hdd_fw_txrx_stats { |
| 945 | uint32_t tx_packets; |
| 946 | uint64_t tx_bytes; |
| 947 | uint32_t rx_packets; |
| 948 | uint64_t rx_bytes; |
| 949 | uint32_t tx_retries; |
| 950 | uint32_t tx_failed; |
| 951 | int8_t rssi; |
| 952 | struct hdd_rate_info tx_rate; |
| 953 | struct hdd_rate_info rx_rate; |
| 954 | }; |
| 955 | |
| 956 | /** |
Yun Park | c3e3556 | 2018-03-08 12:05:52 -0800 | [diff] [blame] | 957 | * struct dhcp_phase - Per Peer DHCP Phases |
| 958 | * @DHCP_PHASE_ACK: upon receiving DHCP_ACK/NAK message in REQUEST phase or |
| 959 | * DHCP_DELINE message in OFFER phase |
| 960 | * @DHCP_PHASE_DISCOVER: upon receiving DHCP_DISCOVER message in ACK phase |
| 961 | * @DHCP_PHASE_OFFER: upon receiving DHCP_OFFER message in DISCOVER phase |
| 962 | * @DHCP_PHASE_REQUEST: upon receiving DHCP_REQUEST message in OFFER phase or |
| 963 | * ACK phase (Renewal process) |
| 964 | */ |
| 965 | enum dhcp_phase { |
| 966 | DHCP_PHASE_ACK, |
| 967 | DHCP_PHASE_DISCOVER, |
| 968 | DHCP_PHASE_OFFER, |
| 969 | DHCP_PHASE_REQUEST |
| 970 | }; |
| 971 | |
| 972 | /** |
| 973 | * struct dhcp_nego_status - Per Peer DHCP Negotiation Status |
| 974 | * @DHCP_NEGO_STOP: when the peer is in ACK phase or client disassociated |
| 975 | * @DHCP_NEGO_IN_PROGRESS: when the peer is in DISCOVER or REQUEST |
| 976 | * (Renewal process) phase |
| 977 | */ |
| 978 | enum dhcp_nego_status { |
| 979 | DHCP_NEGO_STOP, |
| 980 | DHCP_NEGO_IN_PROGRESS |
| 981 | }; |
| 982 | |
| 983 | /** |
Jeff Johnson | 8215592 | 2017-09-30 16:54:14 -0700 | [diff] [blame] | 984 | * struct hdd_station_info - Per station structure kept in HDD for |
Will Huang | 496b36c | 2017-07-11 16:38:50 +0800 | [diff] [blame] | 985 | * multiple station support for SoftAP |
Jeff Johnson | b105d05 | 2017-10-21 12:07:29 -0700 | [diff] [blame] | 986 | * @in_use: Is the station entry in use? |
Jeff Johnson | 4c0ab7b | 2017-10-21 16:13:09 -0700 | [diff] [blame] | 987 | * @sta_id: Station ID reported back from HAL (through SAP). |
Will Huang | 496b36c | 2017-07-11 16:38:50 +0800 | [diff] [blame] | 988 | * Broadcast uses station ID zero by default. |
Jeff Johnson | e7cc44c | 2017-10-21 16:27:41 -0700 | [diff] [blame] | 989 | * @sta_type: Type of station i.e. p2p client or infrastructure station |
Jeff Johnson | f235651 | 2017-10-21 16:04:12 -0700 | [diff] [blame] | 990 | * @sta_mac: MAC address of the station |
Jeff Johnson | 9a5863f | 2017-10-21 13:39:57 -0700 | [diff] [blame] | 991 | * @peer_state: Current Station state so HDD knows how to deal with packet |
Will Huang | 496b36c | 2017-07-11 16:38:50 +0800 | [diff] [blame] | 992 | * queue. Most recent states used to change TLSHIM STA state. |
Jeff Johnson | 65fda11 | 2017-10-21 13:46:10 -0700 | [diff] [blame] | 993 | * @is_qos_enabled: Track QoS status of station |
Jeff Johnson | e4f5d93 | 2017-10-21 13:21:15 -0700 | [diff] [blame] | 994 | * @is_deauth_in_progress: The station entry for which Deauth is in progress |
Will Huang | 496b36c | 2017-07-11 16:38:50 +0800 | [diff] [blame] | 995 | * @nss: Number of spatial streams supported |
| 996 | * @rate_flags: Rate Flags for this connection |
| 997 | * @ecsa_capable: Extended CSA capabilities |
| 998 | * @max_phy_rate: Calcuated maximum phy rate based on mode, nss, mcs etc. |
| 999 | * @tx_packets: Packets send to current station |
| 1000 | * @tx_bytes: Bytes send to current station |
| 1001 | * @rx_packets: Packets received from current station |
| 1002 | * @rx_bytes: Bytes received from current station |
| 1003 | * @last_tx_rx_ts: Last tx/rx timestamp with current station |
| 1004 | * @assoc_ts: Current station association timestamp |
| 1005 | * @tx_rate: Tx rate with current station reported from F/W |
| 1006 | * @rx_rate: Rx rate with current station reported from F/W |
| 1007 | * @ampdu: Ampdu enable or not of the station |
| 1008 | * @sgi_enable: Short GI enable or not of the station |
| 1009 | * @tx_stbc: Tx Space-time block coding enable/disable |
| 1010 | * @rx_stbc: Rx Space-time block coding enable/disable |
| 1011 | * @ch_width: Channel Width of the connection |
| 1012 | * @mode: Mode of the connection |
| 1013 | * @max_supp_idx: Max supported rate index of the station |
| 1014 | * @max_ext_idx: Max extended supported rate index of the station |
| 1015 | * @max_mcs_idx: Max supported mcs index of the station |
| 1016 | * @rx_mcs_map: VHT Rx mcs map |
| 1017 | * @tx_mcs_map: VHT Tx mcs map |
Ashish Kumar Dhanotiya | d523f0d | 2017-10-26 14:15:48 +0530 | [diff] [blame] | 1018 | * @freq : Frequency of the current station |
| 1019 | * @dot11_mode: 802.11 Mode of the connection |
| 1020 | * @ht_present: HT caps present or not in the current station |
| 1021 | * @vht_present: VHT caps present or not in the current station |
| 1022 | * @ht_caps: HT capabilities of current station |
| 1023 | * @vht_caps: VHT capabilities of current station |
| 1024 | * @reason_code: Disconnection reason code for current station |
| 1025 | * @rssi: RSSI of the current station reported from F/W |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1026 | */ |
Jeff Johnson | 8215592 | 2017-09-30 16:54:14 -0700 | [diff] [blame] | 1027 | struct hdd_station_info { |
Jeff Johnson | b105d05 | 2017-10-21 12:07:29 -0700 | [diff] [blame] | 1028 | bool in_use; |
Jeff Johnson | 4c0ab7b | 2017-10-21 16:13:09 -0700 | [diff] [blame] | 1029 | uint8_t sta_id; |
Jeff Johnson | e7cc44c | 2017-10-21 16:27:41 -0700 | [diff] [blame] | 1030 | eStationType sta_type; |
Jeff Johnson | f235651 | 2017-10-21 16:04:12 -0700 | [diff] [blame] | 1031 | struct qdf_mac_addr sta_mac; |
Jeff Johnson | 9a5863f | 2017-10-21 13:39:57 -0700 | [diff] [blame] | 1032 | enum ol_txrx_peer_state peer_state; |
Jeff Johnson | 65fda11 | 2017-10-21 13:46:10 -0700 | [diff] [blame] | 1033 | bool is_qos_enabled; |
Jeff Johnson | e4f5d93 | 2017-10-21 13:21:15 -0700 | [diff] [blame] | 1034 | bool is_deauth_in_progress; |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 1035 | uint8_t nss; |
Kanchanapally, Vidyullatha | e306281 | 2015-05-22 17:28:57 +0530 | [diff] [blame] | 1036 | uint32_t rate_flags; |
gaolez | 7bb1e74 | 2017-03-21 16:37:38 +0800 | [diff] [blame] | 1037 | uint8_t ecsa_capable; |
Will Huang | 496b36c | 2017-07-11 16:38:50 +0800 | [diff] [blame] | 1038 | uint32_t max_phy_rate; |
| 1039 | uint32_t tx_packets; |
| 1040 | uint64_t tx_bytes; |
| 1041 | uint32_t rx_packets; |
| 1042 | uint64_t rx_bytes; |
| 1043 | qdf_time_t last_tx_rx_ts; |
| 1044 | qdf_time_t assoc_ts; |
| 1045 | uint32_t tx_rate; |
| 1046 | uint32_t rx_rate; |
| 1047 | bool ampdu; |
| 1048 | bool sgi_enable; |
| 1049 | bool tx_stbc; |
| 1050 | bool rx_stbc; |
Hanumanth Reddy Pothula | f79fbdf | 2017-10-23 20:10:46 +0530 | [diff] [blame] | 1051 | tSirMacHTChannelWidth ch_width; |
Will Huang | 496b36c | 2017-07-11 16:38:50 +0800 | [diff] [blame] | 1052 | uint8_t mode; |
| 1053 | uint8_t max_supp_idx; |
| 1054 | uint8_t max_ext_idx; |
| 1055 | uint8_t max_mcs_idx; |
| 1056 | uint8_t rx_mcs_map; |
| 1057 | uint8_t tx_mcs_map; |
Ashish Kumar Dhanotiya | 443d31f | 2017-10-13 12:41:19 +0530 | [diff] [blame] | 1058 | uint32_t freq; |
Ashish Kumar Dhanotiya | d523f0d | 2017-10-26 14:15:48 +0530 | [diff] [blame] | 1059 | uint8_t dot11_mode; |
Ashish Kumar Dhanotiya | 443d31f | 2017-10-13 12:41:19 +0530 | [diff] [blame] | 1060 | bool ht_present; |
| 1061 | bool vht_present; |
| 1062 | struct ieee80211_ht_cap ht_caps; |
| 1063 | struct ieee80211_vht_cap vht_caps; |
| 1064 | uint32_t reason_code; |
| 1065 | int8_t rssi; |
Yun Park | c3e3556 | 2018-03-08 12:05:52 -0800 | [diff] [blame] | 1066 | enum dhcp_phase dhcp_phase; |
| 1067 | enum dhcp_nego_status dhcp_nego_status; |
Jeff Johnson | 8215592 | 2017-09-30 16:54:14 -0700 | [diff] [blame] | 1068 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1069 | |
Jeff Johnson | f283c97 | 2017-10-26 12:30:49 -0700 | [diff] [blame] | 1070 | /** |
| 1071 | * struct hdd_ap_ctx - SAP/P2PGO specific information |
| 1072 | * @hostapd_state: state control information |
Jeff Johnson | 0120686 | 2017-10-27 20:55:59 -0700 | [diff] [blame] | 1073 | * @dfs_cac_block_tx: Is data tramsmission blocked due to DFS CAC? |
Jeff Johnson | 136c51b | 2017-10-27 20:02:41 -0700 | [diff] [blame] | 1074 | * @ap_active: Are any stations active? |
Jeff Johnson | 82ceb08 | 2017-10-27 14:52:42 -0700 | [diff] [blame] | 1075 | * @disable_intrabss_fwd: Prevent forwarding between stations |
Jeff Johnson | 42518cf | 2017-10-26 13:33:29 -0700 | [diff] [blame] | 1076 | * @broadcast_sta_id: Station ID assigned after BSS starts |
Jeff Johnson | c8d94a1 | 2017-10-27 14:02:53 -0700 | [diff] [blame] | 1077 | * @privacy: The privacy bits of configuration |
Jeff Johnson | a8e686b | 2017-10-27 15:05:18 -0700 | [diff] [blame] | 1078 | * @encryption_type: The encryption being used |
Jeff Johnson | 413c15f | 2017-10-27 18:56:35 -0700 | [diff] [blame] | 1079 | * @group_key: Group Encryption Key |
Jeff Johnson | 3d73136 | 2017-10-27 19:06:41 -0700 | [diff] [blame] | 1080 | * @wep_key: WEP key array |
| 1081 | * @wep_def_key_idx: WEP default key index |
Jeff Johnson | 0bbe66f | 2017-10-27 19:23:49 -0700 | [diff] [blame] | 1082 | * @sap_context: Pointer to context maintained by SAP (opaque to HDD) |
Jeff Johnson | 91df29d | 2017-10-27 19:29:50 -0700 | [diff] [blame] | 1083 | * @sap_config: SAP configuration |
Jeff Johnson | 0120686 | 2017-10-27 20:55:59 -0700 | [diff] [blame] | 1084 | * @operating_channel: channel upon which the SAP is operating |
| 1085 | * @beacon: Beacon information |
| 1086 | * @vendor_acs_timer: Timer for ACS |
| 1087 | * @vendor_acs_timer_initialized: Is @vendor_acs_timer initialized? |
| 1088 | * @bss_stop_reason: Reason why the BSS was stopped |
| 1089 | * @txrx_stats: TX RX statistics from firmware |
Abhinav Kumar | b638b5d | 2018-03-26 12:25:41 +0530 | [diff] [blame] | 1090 | * @acs_in_progress: In progress acs flag for an adapter |
Jeff Johnson | f283c97 | 2017-10-26 12:30:49 -0700 | [diff] [blame] | 1091 | */ |
Jeff Johnson | e962b19 | 2017-08-11 15:37:08 -0700 | [diff] [blame] | 1092 | struct hdd_ap_ctx { |
Jeff Johnson | f283c97 | 2017-10-26 12:30:49 -0700 | [diff] [blame] | 1093 | struct hdd_hostapd_state hostapd_state; |
Jeff Johnson | 0120686 | 2017-10-27 20:55:59 -0700 | [diff] [blame] | 1094 | bool dfs_cac_block_tx; |
Jeff Johnson | 136c51b | 2017-10-27 20:02:41 -0700 | [diff] [blame] | 1095 | bool ap_active; |
Jeff Johnson | 82ceb08 | 2017-10-27 14:52:42 -0700 | [diff] [blame] | 1096 | bool disable_intrabss_fwd; |
Jeff Johnson | 42518cf | 2017-10-26 13:33:29 -0700 | [diff] [blame] | 1097 | uint8_t broadcast_sta_id; |
Jeff Johnson | c8d94a1 | 2017-10-27 14:02:53 -0700 | [diff] [blame] | 1098 | uint8_t privacy; |
Jeff Johnson | a8e686b | 2017-10-27 15:05:18 -0700 | [diff] [blame] | 1099 | eCsrEncryptionType encryption_type; |
Jeff Johnson | 413c15f | 2017-10-27 18:56:35 -0700 | [diff] [blame] | 1100 | tCsrRoamSetKey group_key; |
Jeff Johnson | 3d73136 | 2017-10-27 19:06:41 -0700 | [diff] [blame] | 1101 | tCsrRoamSetKey wep_key[CSR_MAX_NUM_KEY]; |
| 1102 | uint8_t wep_def_key_idx; |
Jeff Johnson | 0bbe66f | 2017-10-27 19:23:49 -0700 | [diff] [blame] | 1103 | struct sap_context *sap_context; |
Jeff Johnson | e4c11db | 2018-05-05 23:22:32 -0700 | [diff] [blame] | 1104 | tsap_config_t sap_config; |
Jeff Johnson | 0120686 | 2017-10-27 20:55:59 -0700 | [diff] [blame] | 1105 | uint8_t operating_channel; |
| 1106 | struct hdd_beacon_data *beacon; |
| 1107 | qdf_mc_timer_t vendor_acs_timer; |
| 1108 | bool vendor_acs_timer_initialized; |
| 1109 | enum bss_stop_reason bss_stop_reason; |
| 1110 | struct hdd_fw_txrx_stats txrx_stats; |
Abhinav Kumar | b638b5d | 2018-03-26 12:25:41 +0530 | [diff] [blame] | 1111 | qdf_atomic_t acs_in_progress; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1112 | }; |
| 1113 | |
Jeff Johnson | 3758894 | 2017-08-15 16:11:41 -0700 | [diff] [blame] | 1114 | /** |
| 1115 | * struct hdd_scan_info - Per-adapter scan information |
Jeff Johnson | 37fa040 | 2017-10-28 12:42:29 -0700 | [diff] [blame] | 1116 | * @scan_add_ie: Additional IE for scan |
Jeff Johnson | 3758894 | 2017-08-15 16:11:41 -0700 | [diff] [blame] | 1117 | * @default_scan_ies: Default scan IEs |
| 1118 | * @default_scan_ies_len: Length of @default_scan_ies |
| 1119 | * @scan_mode: Scan mode |
Jeff Johnson | 3758894 | 2017-08-15 16:11:41 -0700 | [diff] [blame] | 1120 | */ |
| 1121 | struct hdd_scan_info { |
Jeff Johnson | 37fa040 | 2017-10-28 12:42:29 -0700 | [diff] [blame] | 1122 | tSirAddie scan_add_ie; |
Selvaraj, Sridhar | 4ea106e | 2016-08-05 20:34:46 +0530 | [diff] [blame] | 1123 | uint8_t *default_scan_ies; |
Selvaraj, Sridhar | 021ee0a | 2017-04-07 16:53:31 +0530 | [diff] [blame] | 1124 | uint16_t default_scan_ies_len; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1125 | tSirScanType scan_mode; |
Jeff Johnson | 3758894 | 2017-08-15 16:11:41 -0700 | [diff] [blame] | 1126 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1127 | |
Dustin Brown | 6126946 | 2016-09-19 13:25:45 -0700 | [diff] [blame] | 1128 | #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] | 1129 | |
| 1130 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Jeff Johnson | 673fd5b | 2017-09-30 16:44:56 -0700 | [diff] [blame] | 1131 | struct hdd_multicast_addr_list { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1132 | uint8_t mc_cnt; |
| 1133 | uint8_t addr[WLAN_HDD_MAX_MC_ADDR_LIST][ETH_ALEN]; |
Jeff Johnson | 673fd5b | 2017-09-30 16:44:56 -0700 | [diff] [blame] | 1134 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1135 | #endif |
| 1136 | |
| 1137 | #define WLAN_HDD_MAX_HISTORY_ENTRY 10 |
| 1138 | |
| 1139 | /** |
| 1140 | * struct hdd_netif_queue_stats - netif queue operation statistics |
| 1141 | * @pause_count - pause counter |
| 1142 | * @unpause_count - unpause counter |
| 1143 | */ |
| 1144 | struct hdd_netif_queue_stats { |
Mohit Khanna | ca4173b | 2017-09-12 21:52:19 -0700 | [diff] [blame] | 1145 | u32 pause_count; |
| 1146 | u32 unpause_count; |
Nirav Shah | da00834 | 2016-05-17 18:50:40 +0530 | [diff] [blame] | 1147 | qdf_time_t total_pause_time; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1148 | }; |
| 1149 | |
| 1150 | /** |
| 1151 | * struct hdd_netif_queue_history - netif queue operation history |
| 1152 | * @time: timestamp |
| 1153 | * @netif_action: action type |
| 1154 | * @netif_reason: reason type |
| 1155 | * @pause_map: pause map |
| 1156 | */ |
| 1157 | struct hdd_netif_queue_history { |
Anurag Chouhan | 50220ce | 2016-02-18 20:11:33 +0530 | [diff] [blame] | 1158 | qdf_time_t time; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1159 | uint16_t netif_action; |
| 1160 | uint16_t netif_reason; |
| 1161 | uint32_t pause_map; |
| 1162 | }; |
| 1163 | |
Manishekar Chandrasekaran | ec26759 | 2016-05-26 19:10:04 +0530 | [diff] [blame] | 1164 | /** |
| 1165 | * struct hdd_chan_change_params - channel related information |
| 1166 | * @chan: operating channel |
| 1167 | * @chan_params: channel parameters |
| 1168 | */ |
| 1169 | struct hdd_chan_change_params { |
| 1170 | uint8_t chan; |
Amar Singhal | 5cccafe | 2017-02-15 12:42:58 -0800 | [diff] [blame] | 1171 | struct ch_params chan_params; |
Manishekar Chandrasekaran | ec26759 | 2016-05-26 19:10:04 +0530 | [diff] [blame] | 1172 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1173 | |
Komal Seelam | a89be8d | 2016-09-29 11:09:26 +0530 | [diff] [blame] | 1174 | /** |
Komal Seelam | 8634b77 | 2016-09-29 12:12:24 +0530 | [diff] [blame] | 1175 | * struct hdd_runtime_pm_context - context to prevent/allow runtime pm |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 1176 | * @dfs: dfs context to prevent/allow runtime pm |
Jingxiang Ge | b49aa30 | 2018-01-17 20:54:15 +0800 | [diff] [blame] | 1177 | * @connect: connect context to prevent/allow runtime pm |
Komal Seelam | 8634b77 | 2016-09-29 12:12:24 +0530 | [diff] [blame] | 1178 | * |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 1179 | * Runtime PM control for underlying activities |
Komal Seelam | 8634b77 | 2016-09-29 12:12:24 +0530 | [diff] [blame] | 1180 | */ |
| 1181 | struct hdd_runtime_pm_context { |
Komal Seelam | 81cb166 | 2016-09-29 12:39:08 +0530 | [diff] [blame] | 1182 | qdf_runtime_lock_t dfs; |
Jingxiang Ge | b49aa30 | 2018-01-17 20:54:15 +0800 | [diff] [blame] | 1183 | qdf_runtime_lock_t connect; |
Komal Seelam | 8634b77 | 2016-09-29 12:12:24 +0530 | [diff] [blame] | 1184 | }; |
| 1185 | |
| 1186 | /** |
Komal Seelam | a89be8d | 2016-09-29 11:09:26 +0530 | [diff] [blame] | 1187 | * struct hdd_connect_pm_context - Runtime PM connect context per adapter |
| 1188 | * @connect: Runtime Connect Context |
| 1189 | * |
| 1190 | * Structure to hold runtime pm connect context for each adapter. |
| 1191 | */ |
| 1192 | struct hdd_connect_pm_context { |
| 1193 | qdf_runtime_lock_t connect; |
| 1194 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1195 | |
Samuel Ahn | c9c48ca | 2016-09-19 15:46:36 +0530 | [diff] [blame] | 1196 | /* |
| 1197 | * WLAN_HDD_ADAPTER_MAGIC is a magic number used to identify net devices |
| 1198 | * belonging to this driver from net devices belonging to other devices. |
| 1199 | * Therefore, the magic number must be unique relative to the numbers for |
| 1200 | * other drivers in the system. If WLAN_HDD_ADAPTER_MAGIC is already defined |
| 1201 | * (e.g. by compiler argument), then use that. If it's not already defined, |
| 1202 | * then use the first 4 characters of MULTI_IF_NAME to construct the magic |
| 1203 | * number. If MULTI_IF_NAME is not defined, then use a default magic number. |
| 1204 | */ |
| 1205 | #ifndef WLAN_HDD_ADAPTER_MAGIC |
| 1206 | #ifdef MULTI_IF_NAME |
| 1207 | #define WLAN_HDD_ADAPTER_MAGIC \ |
| 1208 | (MULTI_IF_NAME[0] == 0 ? 0x574c414e : \ |
| 1209 | (MULTI_IF_NAME[1] == 0 ? (MULTI_IF_NAME[0] << 24) : \ |
| 1210 | (MULTI_IF_NAME[2] == 0 ? (MULTI_IF_NAME[0] << 24) | \ |
| 1211 | (MULTI_IF_NAME[1] << 16) : \ |
| 1212 | (MULTI_IF_NAME[0] << 24) | (MULTI_IF_NAME[1] << 16) | \ |
| 1213 | (MULTI_IF_NAME[2] << 8) | MULTI_IF_NAME[3]))) |
| 1214 | #else |
Komal Seelam | a89be8d | 2016-09-29 11:09:26 +0530 | [diff] [blame] | 1215 | #define WLAN_HDD_ADAPTER_MAGIC 0x574c414e /* ASCII "WLAN" */ |
Samuel Ahn | c9c48ca | 2016-09-19 15:46:36 +0530 | [diff] [blame] | 1216 | #endif |
| 1217 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1218 | |
Rajeev Kumar Sirasanagandla | 996e529 | 2016-11-22 21:20:33 +0530 | [diff] [blame] | 1219 | /** |
| 1220 | * struct rcpi_info - rcpi info |
| 1221 | * @rcpi: computed value in dB |
| 1222 | * @mac_addr: peer mac addr for which rcpi is computed |
| 1223 | */ |
| 1224 | struct rcpi_info { |
| 1225 | int32_t rcpi; |
| 1226 | struct qdf_mac_addr mac_addr; |
| 1227 | }; |
| 1228 | |
Jeff Johnson | dba0db6 | 2017-08-30 11:12:39 -0700 | [diff] [blame] | 1229 | struct hdd_context; |
| 1230 | |
Dustin Brown | 20f9fc4 | 2018-08-30 15:19:12 -0700 | [diff] [blame] | 1231 | /** |
| 1232 | * struct hdd_adapter - hdd vdev/net_device context |
Dustin Brown | 89fa06e | 2018-09-07 10:47:27 -0700 | [diff] [blame] | 1233 | * @vdev: object manager vdev context |
Dustin Brown | 20f9fc4 | 2018-08-30 15:19:12 -0700 | [diff] [blame] | 1234 | * @event_flags: a bitmap of hdd_adapter_flags |
| 1235 | */ |
Jeff Johnson | 85b5c11 | 2017-08-11 15:15:23 -0700 | [diff] [blame] | 1236 | struct hdd_adapter { |
Jeff Johnson | d399e90 | 2015-12-17 15:17:02 -0800 | [diff] [blame] | 1237 | /* Magic cookie for adapter sanity verification. Note that this |
| 1238 | * needs to be at the beginning of the private data structure so |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 1239 | * that it will exist at the beginning of dev->priv and hence |
Jeff Johnson | d399e90 | 2015-12-17 15:17:02 -0800 | [diff] [blame] | 1240 | * will always be in mapped memory |
| 1241 | */ |
| 1242 | uint32_t magic; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1243 | |
Dustin Brown | 920397d | 2017-12-13 16:27:50 -0800 | [diff] [blame] | 1244 | /* list node for membership in the adapter list */ |
| 1245 | qdf_list_node_t node; |
| 1246 | |
Jeff Johnson | dba0db6 | 2017-08-30 11:12:39 -0700 | [diff] [blame] | 1247 | struct hdd_context *hdd_ctx; |
Dustin Brown | 89fa06e | 2018-09-07 10:47:27 -0700 | [diff] [blame] | 1248 | struct wlan_objmgr_vdev *vdev; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1249 | |
Leo Chang | fdb45c3 | 2016-10-28 11:09:23 -0700 | [diff] [blame] | 1250 | void *txrx_vdev; |
| 1251 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1252 | /** Handle to the network device */ |
| 1253 | struct net_device *dev; |
| 1254 | |
Jeff Johnson | c1e6278 | 2017-11-09 09:50:17 -0800 | [diff] [blame] | 1255 | enum QDF_OPMODE device_mode; |
Jeff Johnson | d399e90 | 2015-12-17 15:17:02 -0800 | [diff] [blame] | 1256 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1257 | /** IPv4 notifier callback for handling ARP offload on change in IP */ |
Jeff Johnson | b527ebe | 2017-10-28 13:14:03 -0700 | [diff] [blame] | 1258 | struct work_struct ipv4_notifier_work; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1259 | #ifdef WLAN_NS_OFFLOAD |
| 1260 | /** IPv6 notifier callback for handling NS offload on change in IP */ |
Jeff Johnson | b527ebe | 2017-10-28 13:14:03 -0700 | [diff] [blame] | 1261 | struct work_struct ipv6_notifier_work; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1262 | #endif |
| 1263 | |
| 1264 | /* TODO Move this to sta Ctx */ |
| 1265 | struct wireless_dev wdev; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1266 | |
| 1267 | /** ops checks if Opportunistic Power Save is Enable or Not |
| 1268 | * ctw stores ctWindow value once we receive Opps command from |
| 1269 | * wpa_supplicant then using ctWindow value we need to Enable |
| 1270 | * Opportunistic Power Save |
| 1271 | */ |
| 1272 | uint8_t ops; |
| 1273 | uint32_t ctw; |
| 1274 | |
| 1275 | /** Current MAC Address for the adapter */ |
Jeff Johnson | 1e851a1 | 2017-10-28 14:36:12 -0700 | [diff] [blame] | 1276 | struct qdf_mac_addr mac_addr; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1277 | |
Alok Kumar | b64650c | 2018-03-23 17:05:11 +0530 | [diff] [blame] | 1278 | #ifdef WLAN_NUD_TRACKING |
| 1279 | struct hdd_nud_tracking_info nud_tracking; |
| 1280 | #endif |
| 1281 | bool disconnection_in_progress; |
| 1282 | qdf_mutex_t disconnection_status_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1283 | unsigned long event_flags; |
| 1284 | |
| 1285 | /**Device TX/RX statistics*/ |
| 1286 | struct net_device_stats stats; |
| 1287 | /** HDD statistics*/ |
Jeff Johnson | 07f9474 | 2017-08-14 15:55:40 -0700 | [diff] [blame] | 1288 | struct hdd_stats hdd_stats; |
Jeff Johnson | e50427c | 2017-01-26 10:54:49 -0800 | [diff] [blame] | 1289 | |
| 1290 | /* estimated link speed */ |
| 1291 | uint32_t estimated_linkspeed; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1292 | |
Jeff Johnson | 1b780e4 | 2017-10-31 14:11:45 -0700 | [diff] [blame] | 1293 | uint8_t session_id; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1294 | |
Nachiket Kukade | 08b9f29 | 2017-11-17 18:27:37 +0530 | [diff] [blame] | 1295 | /* QDF event for session close */ |
| 1296 | qdf_event_t qdf_session_close_event; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1297 | |
Nachiket Kukade | 08b9f29 | 2017-11-17 18:27:37 +0530 | [diff] [blame] | 1298 | /* QDF event for session open */ |
| 1299 | qdf_event_t qdf_session_open_event; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1300 | |
| 1301 | /* TODO: move these to sta ctx. These may not be used in AP */ |
| 1302 | /** completion variable for disconnect callback */ |
| 1303 | struct completion disconnect_comp_var; |
| 1304 | |
Abhishek Singh | 533c9da | 2017-05-04 10:23:34 +0530 | [diff] [blame] | 1305 | struct completion roaming_comp_var; |
| 1306 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1307 | /* completion variable for Linkup Event */ |
| 1308 | struct completion linkup_event_var; |
| 1309 | |
| 1310 | /* completion variable for cancel remain on channel Event */ |
| 1311 | struct completion cancel_rem_on_chan_var; |
| 1312 | |
| 1313 | /* completion variable for off channel remain on channel Event */ |
| 1314 | struct completion offchannel_tx_event; |
| 1315 | /* Completion variable for action frame */ |
| 1316 | struct completion tx_action_cnf_event; |
| 1317 | /* Completion variable for remain on channel ready */ |
| 1318 | struct completion rem_on_chan_ready_event; |
| 1319 | |
| 1320 | struct completion sta_authorized_event; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1321 | |
Rajeev Kumar | 8e3e283 | 2015-11-06 16:02:54 -0800 | [diff] [blame] | 1322 | struct completion ibss_peer_info_comp; |
| 1323 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1324 | /* Track whether the linkup handling is needed */ |
Jeff Johnson | c72c573 | 2017-10-28 12:49:37 -0700 | [diff] [blame] | 1325 | bool is_link_up_service_needed; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1326 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1327 | /* WMM Status */ |
Jeff Johnson | 02d14ce | 2017-10-31 09:08:30 -0700 | [diff] [blame] | 1328 | struct hdd_wmm_status hdd_wmm_status; |
Jeff Johnson | 18e8662 | 2017-10-28 12:55:36 -0700 | [diff] [blame] | 1329 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1330 | /** Multiple station supports */ |
| 1331 | /** Per-station structure */ |
Jeff Johnson | bb8b56a | 2017-10-23 07:02:36 -0700 | [diff] [blame] | 1332 | spinlock_t sta_info_lock; /* To protect access to station Info */ |
| 1333 | struct hdd_station_info sta_info[WLAN_MAX_STA_COUNT]; |
Ashish Kumar Dhanotiya | 443d31f | 2017-10-13 12:41:19 +0530 | [diff] [blame] | 1334 | struct hdd_station_info cache_sta_info[WLAN_MAX_STA_COUNT]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1335 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1336 | |
| 1337 | #ifdef FEATURE_WLAN_WAPI |
Jeff Johnson | 89798aa | 2017-08-16 11:00:56 -0700 | [diff] [blame] | 1338 | struct hdd_wapi_info wapi_info; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1339 | #endif |
| 1340 | |
| 1341 | int8_t rssi; |
Sreelakshmi Konamki | 58c7243 | 2016-11-09 17:06:44 +0530 | [diff] [blame] | 1342 | int32_t rssi_on_disconnect; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1343 | #ifdef WLAN_FEATURE_LPSS |
| 1344 | bool rssi_send; |
| 1345 | #endif |
| 1346 | |
| 1347 | uint8_t snr; |
| 1348 | |
Krunal Soni | 2220839 | 2017-09-29 18:10:34 -0700 | [diff] [blame] | 1349 | struct work_struct sap_stop_bss_work; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1350 | |
| 1351 | union { |
Jeff Johnson | 40dae4e | 2017-08-29 14:00:25 -0700 | [diff] [blame] | 1352 | struct hdd_station_ctx station; |
Jeff Johnson | 8725103 | 2017-08-29 13:31:11 -0700 | [diff] [blame] | 1353 | struct hdd_ap_ctx ap; |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 1354 | } session; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1355 | |
Min Liu | 2fef579 | 2018-01-19 17:59:42 +0800 | [diff] [blame] | 1356 | qdf_atomic_t dfs_radar_found; |
| 1357 | |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 1358 | #ifdef WLAN_FEATURE_TSF |
| 1359 | /* tsf value received from firmware */ |
Yu Wang | f5d5b5f | 2017-05-25 22:38:32 +0800 | [diff] [blame] | 1360 | uint64_t cur_target_time; |
Manikandan Mohan | 5356c2b | 2016-04-03 15:51:35 -0700 | [diff] [blame] | 1361 | uint64_t tsf_sync_soc_timer; |
yuanl | 2746f07 | 2018-09-21 19:19:16 +0800 | [diff] [blame] | 1362 | qdf_mc_timer_t host_capture_req_timer; |
Yu Wang | 000dc2f | 2017-05-26 17:38:48 +0800 | [diff] [blame] | 1363 | #ifdef WLAN_FEATURE_TSF_PLUS |
| 1364 | /* spin lock for read/write timestamps */ |
| 1365 | qdf_spinlock_t host_target_sync_lock; |
| 1366 | qdf_mc_timer_t host_target_sync_timer; |
| 1367 | uint64_t cur_host_time; |
| 1368 | uint64_t last_host_time; |
| 1369 | uint64_t last_target_time; |
| 1370 | /* to store the count of continuous invalid tstamp-pair */ |
| 1371 | int continuous_error_count; |
| 1372 | /* to indicate whether tsf_sync has been initialized */ |
| 1373 | qdf_atomic_t tsf_sync_ready_flag; |
| 1374 | #endif /* WLAN_FEATURE_TSF_PLUS */ |
Manikandan Mohan | dcc21ba | 2016-03-15 14:31:56 -0700 | [diff] [blame] | 1375 | #endif |
| 1376 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1377 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Jeff Johnson | 673fd5b | 2017-09-30 16:44:56 -0700 | [diff] [blame] | 1378 | struct hdd_multicast_addr_list mc_addr_list; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1379 | #endif |
| 1380 | uint8_t addr_filter_pattern; |
| 1381 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1382 | bool survey_idx; |
| 1383 | |
Jeff Johnson | 3758894 | 2017-08-15 16:11:41 -0700 | [diff] [blame] | 1384 | struct hdd_scan_info scan_info; |
Jeff Johnson | c13bdf1 | 2017-01-25 16:28:19 -0800 | [diff] [blame] | 1385 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1386 | /* Flag to ensure PSB is configured through framework */ |
Jeff Johnson | 137c8ee | 2017-10-28 13:06:48 -0700 | [diff] [blame] | 1387 | uint8_t psb_changed; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1388 | /* UAPSD psb value configured through framework */ |
Jeff Johnson | 137c8ee | 2017-10-28 13:06:48 -0700 | [diff] [blame] | 1389 | uint8_t configured_psb; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1390 | #ifdef IPA_OFFLOAD |
| 1391 | void *ipa_context; |
| 1392 | #endif |
| 1393 | /* Use delayed work for Sec AP ACS as Pri AP Startup need to complete |
| 1394 | * since CSR (PMAC Struct) Config is same for both AP |
| 1395 | */ |
| 1396 | struct delayed_work acs_pending_work; |
| 1397 | |
| 1398 | struct work_struct scan_block_work; |
Min Liu | 9be5d4a | 2018-05-17 11:51:53 +0800 | [diff] [blame] | 1399 | qdf_list_t blocked_scan_request_q; |
| 1400 | qdf_mutex_t blocked_scan_request_q_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1401 | #ifdef MSM_PLATFORM |
| 1402 | unsigned long prev_rx_packets; |
| 1403 | unsigned long prev_tx_packets; |
Himanshu Agarwal | a6cedee | 2016-06-08 14:50:00 +0530 | [diff] [blame] | 1404 | uint64_t prev_fwd_tx_packets; |
| 1405 | uint64_t prev_fwd_rx_packets; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1406 | int connection; |
| 1407 | #endif |
Ajit Pal Singh | 106c141 | 2018-04-18 18:08:49 +0530 | [diff] [blame] | 1408 | #if defined(QCA_LL_LEGACY_TX_FLOW_CONTROL) || \ |
| 1409 | defined(QCA_HL_NETDEV_FLOW_CONTROL) |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 1410 | qdf_mc_timer_t tx_flow_control_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1411 | bool tx_flow_timer_initialized; |
Ajit Pal Singh | 106c141 | 2018-04-18 18:08:49 +0530 | [diff] [blame] | 1412 | #endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL || QCA_HL_NETDEV_FLOW_CONTROL */ |
| 1413 | #ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1414 | unsigned int tx_flow_low_watermark; |
jitiphil | 869b9f7 | 2018-09-25 17:14:01 +0530 | [diff] [blame] | 1415 | unsigned int tx_flow_hi_watermark_offset; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1416 | #endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */ |
Ajit Pal Singh | 106c141 | 2018-04-18 18:08:49 +0530 | [diff] [blame] | 1417 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1418 | bool offloads_configured; |
| 1419 | |
| 1420 | /* DSCP to UP QoS Mapping */ |
Jeff Johnson | 6b51b6a | 2017-11-02 20:31:25 -0700 | [diff] [blame] | 1421 | enum sme_qos_wmmuptype dscp_to_up_map[WLAN_HDD_MAX_DSCP + 1]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1422 | |
| 1423 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
Jeff Johnson | d30ee4b | 2017-10-28 15:38:32 -0700 | [diff] [blame] | 1424 | bool is_link_layer_stats_set; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1425 | #endif |
Jeff Johnson | bd4c4f0 | 2017-10-30 20:33:01 -0700 | [diff] [blame] | 1426 | uint8_t link_status; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1427 | |
| 1428 | /* variable for temperature in Celsius */ |
| 1429 | int temperature; |
| 1430 | |
Agrawal Ashish | b141b09 | 2016-09-02 19:59:26 +0530 | [diff] [blame] | 1431 | #ifdef WLAN_FEATURE_DSRC |
Jeff Johnson | 7af334b | 2017-02-01 13:03:43 -0800 | [diff] [blame] | 1432 | /* MAC addresses used for OCB interfaces */ |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1433 | struct qdf_mac_addr ocb_mac_address[QDF_MAX_CONCURRENCY_PERSONA]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1434 | int ocb_mac_addr_count; |
Agrawal Ashish | b141b09 | 2016-09-02 19:59:26 +0530 | [diff] [blame] | 1435 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1436 | |
| 1437 | /* BITMAP indicating pause reason */ |
| 1438 | uint32_t pause_map; |
| 1439 | spinlock_t pause_map_lock; |
Nirav Shah | 617cff9 | 2016-04-25 10:24:24 +0530 | [diff] [blame] | 1440 | qdf_time_t start_time; |
| 1441 | qdf_time_t last_time; |
| 1442 | qdf_time_t total_pause_time; |
| 1443 | qdf_time_t total_unpause_time; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1444 | uint8_t history_index; |
| 1445 | struct hdd_netif_queue_history |
| 1446 | queue_oper_history[WLAN_HDD_MAX_HISTORY_ENTRY]; |
| 1447 | struct hdd_netif_queue_stats queue_oper_stats[WLAN_REASON_TYPE_MAX]; |
Dhanashri Atre | 168d2b4 | 2016-02-22 14:43:06 -0800 | [diff] [blame] | 1448 | ol_txrx_tx_fp tx_fn; |
Rajeev Kumar | dca5f81 | 2016-02-04 17:28:06 -0800 | [diff] [blame] | 1449 | /* debugfs entry */ |
| 1450 | struct dentry *debugfs_phy; |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 1451 | /* |
| 1452 | * The pre cac channel is saved here and will be used when the SAP's |
| 1453 | * channel needs to be moved from the existing 2.4GHz channel. |
| 1454 | */ |
| 1455 | uint8_t pre_cac_chan; |
Deepak Dhamdhere | a278582 | 2016-11-17 01:17:45 -0800 | [diff] [blame] | 1456 | |
Varun Reddy Yeturu | a578414 | 2017-03-10 12:11:44 -0800 | [diff] [blame] | 1457 | /* |
Abhishek Singh | 533c9da | 2017-05-04 10:23:34 +0530 | [diff] [blame] | 1458 | * Indicate if HO fails during disconnect so that |
| 1459 | * disconnect is not initiated by HDD as its already |
| 1460 | * initiated by CSR |
Varun Reddy Yeturu | a578414 | 2017-03-10 12:11:44 -0800 | [diff] [blame] | 1461 | */ |
Abhishek Singh | 533c9da | 2017-05-04 10:23:34 +0530 | [diff] [blame] | 1462 | bool roam_ho_fail; |
Sreelakshmi Konamki | 88a2a41 | 2017-04-14 15:11:55 +0530 | [diff] [blame] | 1463 | struct lfr_firmware_status lfr_fw_status; |
Anurag Chouhan | 3920c0f | 2017-09-11 17:10:56 +0530 | [diff] [blame] | 1464 | bool con_status; |
| 1465 | bool dad; |
Ganesh Kondabattini | 1a2aed8 | 2017-09-28 12:21:58 +0530 | [diff] [blame] | 1466 | uint8_t active_ac; |
Poddar, Siddarth | 31797fa | 2018-01-22 17:24:15 +0530 | [diff] [blame] | 1467 | uint32_t pkt_type_bitmap; |
| 1468 | uint32_t track_arp_ip; |
| 1469 | uint8_t dns_payload[256]; |
| 1470 | uint32_t track_dns_domain_len; |
| 1471 | uint32_t track_src_port; |
| 1472 | uint32_t track_dest_port; |
| 1473 | uint32_t track_dest_ipv4; |
Arunk Khandavalli | 062fb03 | 2017-10-04 12:18:15 +0530 | [diff] [blame] | 1474 | uint32_t mon_chan; |
| 1475 | uint32_t mon_bandwidth; |
Rajeev Kumar Sirasanagandla | 996e529 | 2016-11-22 21:20:33 +0530 | [diff] [blame] | 1476 | |
| 1477 | /* rcpi information */ |
| 1478 | struct rcpi_info rcpi; |
Yeshwanth Sriram Guntuka | 4fe30bd | 2018-06-13 11:41:42 +0530 | [diff] [blame] | 1479 | bool send_mode_change; |
Nachiket Kukade | 5f0ce4f | 2018-06-15 19:47:37 +0530 | [diff] [blame] | 1480 | #ifdef FEATURE_WLAN_APF |
| 1481 | struct hdd_apf_context apf_context; |
| 1482 | #endif /* FEATURE_WLAN_APF */ |
Rajeev Kumar Sirasanagandla | 197d417 | 2018-02-15 19:03:29 +0530 | [diff] [blame] | 1483 | |
| 1484 | #ifdef WLAN_DEBUGFS |
| 1485 | struct hdd_debugfs_file_info csr_file[HDD_DEBUGFS_FILE_ID_MAX]; |
| 1486 | #endif /* WLAN_DEBUGFS */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1487 | }; |
| 1488 | |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 1489 | #define WLAN_HDD_GET_STATION_CTX_PTR(adapter) (&(adapter)->session.station) |
| 1490 | #define WLAN_HDD_GET_AP_CTX_PTR(adapter) (&(adapter)->session.ap) |
Jeff Johnson | dba0db6 | 2017-08-30 11:12:39 -0700 | [diff] [blame] | 1491 | #define WLAN_HDD_GET_CTX(adapter) ((adapter)->hdd_ctx) |
Jeff Johnson | 7b92c0f | 2017-10-02 13:31:35 -0700 | [diff] [blame] | 1492 | #define WLAN_HDD_GET_HOSTAP_STATE_PTR(adapter) \ |
Jeff Johnson | b942486 | 2017-10-30 08:49:35 -0700 | [diff] [blame] | 1493 | (&(adapter)->session.ap.hostapd_state) |
| 1494 | #define WLAN_HDD_GET_SAP_CTX_PTR(adapter) ((adapter)->session.ap.sap_context) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1495 | |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 1496 | #ifdef WLAN_FEATURE_NAN_DATAPATH |
Deepak Dhamdhere | 7e6016f | 2016-06-01 09:37:37 -0700 | [diff] [blame] | 1497 | #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] | 1498 | #else |
Deepak Dhamdhere | 8360d4c | 2016-06-01 13:24:31 -0700 | [diff] [blame] | 1499 | /* WLAN_HDD_GET_NDP_CTX_PTR and WLAN_HDD_GET_NDP_WEXT_STATE_PTR are not defined |
| 1500 | * intentionally so that all references to these must be within NDP code. |
| 1501 | * non-NDP code can call WLAN_HDD_IS_NDP_ENABLED(), and when it is enabled, |
| 1502 | * invoke NDP code to do all work. |
| 1503 | */ |
Deepak Dhamdhere | 7e6016f | 2016-06-01 09:37:37 -0700 | [diff] [blame] | 1504 | #define WLAN_HDD_IS_NDP_ENABLED(hdd_ctx) (false) |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 1505 | #endif |
| 1506 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1507 | /* Set mac address locally administered bit */ |
| 1508 | #define WLAN_HDD_RESET_LOCALLY_ADMINISTERED_BIT(macaddr) (macaddr[0] &= 0xFD) |
| 1509 | |
| 1510 | #define HDD_DEFAULT_MCC_P2P_QUOTA 70 |
| 1511 | #define HDD_RESET_MCC_P2P_QUOTA 50 |
| 1512 | |
Jeff Johnson | 353cd29 | 2017-08-17 06:47:26 -0700 | [diff] [blame] | 1513 | /* |
| 1514 | * struct hdd_priv_data - driver ioctl private data payload |
| 1515 | * @buf: pointer to command buffer (may be in userspace) |
| 1516 | * @used_len: length of the command/data currently in @buf |
| 1517 | * @total_len: total length of the @buf memory allocation |
| 1518 | */ |
| 1519 | struct hdd_priv_data { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1520 | uint8_t *buf; |
| 1521 | int used_len; |
| 1522 | int total_len; |
Jeff Johnson | 353cd29 | 2017-08-17 06:47:26 -0700 | [diff] [blame] | 1523 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1524 | |
| 1525 | #define MAX_MOD_LOGLEVEL 10 |
Jeff Johnson | dadef1a | 2017-09-30 16:14:02 -0700 | [diff] [blame] | 1526 | struct fw_log_info { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1527 | uint8_t enable; |
| 1528 | uint8_t dl_type; |
| 1529 | uint8_t dl_report; |
| 1530 | uint8_t dl_loglevel; |
| 1531 | uint8_t index; |
| 1532 | uint32_t dl_mod_loglevel[MAX_MOD_LOGLEVEL]; |
| 1533 | |
Jeff Johnson | dadef1a | 2017-09-30 16:14:02 -0700 | [diff] [blame] | 1534 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1535 | |
Archana Ramachandran | d41c3ed | 2016-02-10 15:48:06 -0800 | [diff] [blame] | 1536 | /** |
| 1537 | * enum antenna_mode - number of TX/RX chains |
| 1538 | * @HDD_ANTENNA_MODE_INVALID: Invalid mode place holder |
| 1539 | * @HDD_ANTENNA_MODE_1X1: Number of TX/RX chains equals 1 |
| 1540 | * @HDD_ANTENNA_MODE_2X2: Number of TX/RX chains equals 2 |
| 1541 | * @HDD_ANTENNA_MODE_MAX: Place holder for max mode |
| 1542 | */ |
| 1543 | enum antenna_mode { |
| 1544 | HDD_ANTENNA_MODE_INVALID, |
| 1545 | HDD_ANTENNA_MODE_1X1, |
| 1546 | HDD_ANTENNA_MODE_2X2, |
| 1547 | HDD_ANTENNA_MODE_MAX |
| 1548 | }; |
| 1549 | |
| 1550 | /** |
| 1551 | * enum smps_mode - SM power save mode |
| 1552 | * @HDD_SMPS_MODE_STATIC: Static power save |
| 1553 | * @HDD_SMPS_MODE_DYNAMIC: Dynamic power save |
| 1554 | * @HDD_SMPS_MODE_RESERVED: Reserved |
| 1555 | * @HDD_SMPS_MODE_DISABLED: Disable power save |
| 1556 | * @HDD_SMPS_MODE_MAX: Place holder for max mode |
| 1557 | */ |
| 1558 | enum smps_mode { |
| 1559 | HDD_SMPS_MODE_STATIC, |
| 1560 | HDD_SMPS_MODE_DYNAMIC, |
| 1561 | HDD_SMPS_MODE_RESERVED, |
| 1562 | HDD_SMPS_MODE_DISABLED, |
| 1563 | HDD_SMPS_MODE_MAX |
| 1564 | }; |
| 1565 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1566 | #ifdef WLAN_FEATURE_OFFLOAD_PACKETS |
| 1567 | /** |
| 1568 | * struct hdd_offloaded_packets - request id to pattern id mapping |
| 1569 | * @request_id: request id |
| 1570 | * @pattern_id: pattern id |
| 1571 | * |
| 1572 | */ |
| 1573 | struct hdd_offloaded_packets { |
| 1574 | uint32_t request_id; |
| 1575 | uint8_t pattern_id; |
| 1576 | }; |
| 1577 | |
| 1578 | /** |
| 1579 | * struct hdd_offloaded_packets_ctx - offloaded packets context |
| 1580 | * @op_table: request id to pattern id table |
| 1581 | * @op_lock: mutex lock |
| 1582 | */ |
| 1583 | struct hdd_offloaded_packets_ctx { |
| 1584 | struct hdd_offloaded_packets op_table[MAXNUM_PERIODIC_TX_PTRNS]; |
| 1585 | struct mutex op_lock; |
| 1586 | }; |
| 1587 | #endif |
| 1588 | |
Arun Khandavalli | 2476ef5 | 2016-04-26 20:19:43 +0530 | [diff] [blame] | 1589 | /** |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1590 | * enum driver_status: Driver Modules status |
| 1591 | * @DRIVER_MODULES_UNINITIALIZED: Driver CDS modules uninitialized |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1592 | * @DRIVER_MODULES_ENABLED: Driver CDS modules opened |
| 1593 | * @DRIVER_MODULES_CLOSED: Driver CDS modules closed |
| 1594 | */ |
| 1595 | enum driver_modules_status { |
| 1596 | DRIVER_MODULES_UNINITIALIZED, |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1597 | DRIVER_MODULES_ENABLED, |
| 1598 | DRIVER_MODULES_CLOSED |
| 1599 | }; |
| 1600 | |
Agrawal Ashish | 6563461 | 2016-08-18 13:24:32 +0530 | [diff] [blame] | 1601 | /** |
| 1602 | * struct acs_dfs_policy - Define ACS policies |
| 1603 | * @acs_dfs_mode: Dfs mode enabled/disabled. |
| 1604 | * @acs_channel: pre defined channel to avoid ACS. |
| 1605 | */ |
| 1606 | struct acs_dfs_policy { |
| 1607 | enum dfs_mode acs_dfs_mode; |
| 1608 | uint8_t acs_channel; |
| 1609 | }; |
| 1610 | |
Dustin Brown | 105d790 | 2016-10-03 16:27:59 -0700 | [diff] [blame] | 1611 | /** |
| 1612 | * enum suspend_fail_reason: Reasons a WLAN suspend might fail |
| 1613 | * SUSPEND_FAIL_IPA: IPA in progress |
| 1614 | * SUSPEND_FAIL_RADAR: radar scan in progress |
| 1615 | * SUSPEND_FAIL_ROAM: roaming in progress |
| 1616 | * SUSPEND_FAIL_SCAN: scan in progress |
| 1617 | * SUSPEND_FAIL_INITIAL_WAKEUP: received initial wakeup from firmware |
| 1618 | * SUSPEND_FAIL_MAX_COUNT: the number of wakeup reasons, always at the end |
| 1619 | */ |
| 1620 | enum suspend_fail_reason { |
| 1621 | SUSPEND_FAIL_IPA, |
| 1622 | SUSPEND_FAIL_RADAR, |
| 1623 | SUSPEND_FAIL_ROAM, |
| 1624 | SUSPEND_FAIL_SCAN, |
| 1625 | SUSPEND_FAIL_INITIAL_WAKEUP, |
| 1626 | SUSPEND_FAIL_MAX_COUNT |
| 1627 | }; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1628 | |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 1629 | /** |
| 1630 | * suspend_resume_stats - Collection of counters for suspend/resume events |
| 1631 | * @suspends: number of suspends completed |
| 1632 | * @resumes: number of resumes completed |
| 1633 | * @suspend_fail: counters for failed suspend reasons |
| 1634 | */ |
| 1635 | struct suspend_resume_stats { |
| 1636 | uint32_t suspends; |
| 1637 | uint32_t resumes; |
| 1638 | uint32_t suspend_fail[SUSPEND_FAIL_MAX_COUNT]; |
| 1639 | }; |
| 1640 | |
Ashish Kumar Dhanotiya | b28338c | 2017-07-21 20:12:34 +0530 | [diff] [blame] | 1641 | /** |
| 1642 | * hdd_sta_smps_param - SMPS parameters to configure from hdd |
| 1643 | * HDD_STA_SMPS_PARAM_UPPER_RSSI_THRESH: RSSI threshold to enter Dynamic SMPS |
| 1644 | * mode from inactive mode |
| 1645 | * HDD_STA_SMPS_PARAM_STALL_RSSI_THRESH: RSSI threshold to enter |
| 1646 | * Stalled-D-SMPS mode from D-SMPS mode or to enter D-SMPS mode from |
| 1647 | * Stalled-D-SMPS mode |
| 1648 | * HDD_STA_SMPS_PARAM_LOWER_RSSI_THRESH: RSSI threshold to disable SMPS modes |
| 1649 | * HDD_STA_SMPS_PARAM_UPPER_BRSSI_THRESH: Upper threshold for beacon-RSSI. |
| 1650 | * Used to reduce RX chainmask. |
| 1651 | * HDD_STA_SMPS_PARAM_LOWER_BRSSI_THRESH: Lower threshold for beacon-RSSI. |
| 1652 | * Used to increase RX chainmask. |
| 1653 | * HDD_STA_SMPS_PARAM_DTIM_1CHRX_ENABLE: Enable/Disable DTIM 1chRx feature |
| 1654 | */ |
| 1655 | enum hdd_sta_smps_param { |
| 1656 | HDD_STA_SMPS_PARAM_UPPER_RSSI_THRESH = 0, |
| 1657 | HDD_STA_SMPS_PARAM_STALL_RSSI_THRESH = 1, |
| 1658 | HDD_STA_SMPS_PARAM_LOWER_RSSI_THRESH = 2, |
| 1659 | HDD_STA_SMPS_PARAM_UPPER_BRSSI_THRESH = 3, |
| 1660 | HDD_STA_SMPS_PARAM_LOWER_BRSSI_THRESH = 4, |
| 1661 | HDD_STA_SMPS_PARAM_DTIM_1CHRX_ENABLE = 5 |
| 1662 | }; |
| 1663 | |
Anurag Chouhan | 3920c0f | 2017-09-11 17:10:56 +0530 | [diff] [blame] | 1664 | /** |
Manjunathappa Prakash | 7b0ad46 | 2018-04-15 00:37:16 -0700 | [diff] [blame] | 1665 | * enum RX_OFFLOAD - Receive offload modes |
| 1666 | * @CFG_LRO_ENABLED: Large Rx offload |
| 1667 | * @CFG_GRO_ENABLED: Generic Rx Offload |
| 1668 | */ |
| 1669 | enum RX_OFFLOAD { |
| 1670 | CFG_LRO_ENABLED = 1, |
| 1671 | CFG_GRO_ENABLED, |
| 1672 | }; |
| 1673 | |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 1674 | /* One per STA: 1 for BCMC_STA_ID, 1 for each SAP_SELF_STA_ID, |
| 1675 | * 1 for WDS_STAID |
| 1676 | */ |
| 1677 | #define HDD_MAX_ADAPTERS (WLAN_MAX_STA_COUNT + QDF_MAX_NO_OF_SAP_MODE + 2) |
| 1678 | |
Ashish Kumar Dhanotiya | 3f78e68 | 2018-03-14 11:19:27 +0530 | [diff] [blame] | 1679 | #ifdef DISABLE_CHANNEL_LIST |
| 1680 | |
| 1681 | /** |
| 1682 | * struct hdd_cache_channel_info - Structure of the channel info |
| 1683 | * which needs to be cached |
| 1684 | * @channel_num: channel number |
| 1685 | * @reg_status: Current regulatory status of the channel |
| 1686 | * Enable |
| 1687 | * Disable |
| 1688 | * DFS |
| 1689 | * Invalid |
| 1690 | * @wiphy_status: Current wiphy status |
| 1691 | */ |
| 1692 | struct hdd_cache_channel_info { |
| 1693 | uint32_t channel_num; |
| 1694 | enum channel_state reg_status; |
| 1695 | uint32_t wiphy_status; |
| 1696 | }; |
| 1697 | |
| 1698 | /** |
| 1699 | * struct hdd_cache_channels - Structure of the channels to be cached |
| 1700 | * @num_channels: Number of channels to be cached |
| 1701 | * @channel_info: Structure of the channel info |
| 1702 | */ |
| 1703 | struct hdd_cache_channels { |
| 1704 | uint32_t num_channels; |
| 1705 | struct hdd_cache_channel_info *channel_info; |
| 1706 | }; |
| 1707 | #endif |
| 1708 | |
Dustin Brown | 20f9fc4 | 2018-08-30 15:19:12 -0700 | [diff] [blame] | 1709 | /** |
| 1710 | * struct hdd_context - hdd shared driver and psoc/device context |
Dustin Brown | 76cd293 | 2018-09-11 16:03:05 -0700 | [diff] [blame] | 1711 | * @psoc: object manager psoc context |
Dustin Brown | 07901ec | 2018-09-07 11:02:41 -0700 | [diff] [blame] | 1712 | * @pdev: object manager pdev context |
Dustin Brown | 20f9fc4 | 2018-08-30 15:19:12 -0700 | [diff] [blame] | 1713 | * @g_event_flags: a bitmap of hdd_driver_flags |
Dustin Brown | 4c66322 | 2018-10-23 14:19:36 -0700 | [diff] [blame] | 1714 | * @psoc_idle_timeout_work: delayed work for psoc idle shutdown |
Dustin Brown | 20f9fc4 | 2018-08-30 15:19:12 -0700 | [diff] [blame] | 1715 | */ |
Jeff Johnson | 82797b6 | 2017-08-11 15:31:27 -0700 | [diff] [blame] | 1716 | struct hdd_context { |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 1717 | struct wlan_objmgr_psoc *psoc; |
Dustin Brown | 07901ec | 2018-09-07 11:02:41 -0700 | [diff] [blame] | 1718 | struct wlan_objmgr_pdev *pdev; |
Jeff Johnson | 1652836 | 2018-06-14 12:34:16 -0700 | [diff] [blame] | 1719 | mac_handle_t mac_handle; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1720 | struct wiphy *wiphy; |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1721 | qdf_spinlock_t hdd_adapter_lock; |
Jeff Johnson | 19fc8e4 | 2017-10-30 19:53:49 -0700 | [diff] [blame] | 1722 | qdf_list_t hdd_adapters; /* List of adapters */ |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1723 | |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 1724 | struct hdd_adapter *sta_to_adapter[HDD_MAX_ADAPTERS]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1725 | |
| 1726 | /** Pointer for firmware image data */ |
| 1727 | const struct firmware *fw; |
| 1728 | |
| 1729 | /** Pointer for configuration data */ |
| 1730 | const struct firmware *cfg; |
| 1731 | |
| 1732 | /** Pointer to the parent device */ |
| 1733 | struct device *parent_dev; |
| 1734 | |
| 1735 | /** Config values read from qcom_cfg.ini file */ |
| 1736 | struct hdd_config *config; |
| 1737 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1738 | /* Completion variable to indicate Mc Thread Suspended */ |
| 1739 | struct completion mc_sus_event_var; |
| 1740 | |
Rajeev Kumar | eada0d0 | 2016-12-08 17:44:17 -0800 | [diff] [blame] | 1741 | bool is_scheduler_suspended; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1742 | |
| 1743 | #ifdef QCA_CONFIG_SMP |
| 1744 | bool is_ol_rx_thread_suspended; |
| 1745 | #endif |
| 1746 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1747 | bool hdd_wlan_suspended; |
| 1748 | bool suspended; |
Poddar, Siddarth | 61fbc93 | 2017-12-19 14:27:55 +0530 | [diff] [blame] | 1749 | /* flag to start pktlog after SSR/PDR if previously enabled */ |
| 1750 | bool is_pktlog_enabled; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1751 | |
| 1752 | /* Lock to avoid race condition during start/stop bss */ |
| 1753 | struct mutex sap_lock; |
| 1754 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1755 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1756 | /* OEM App registered or not */ |
| 1757 | bool oem_app_registered; |
| 1758 | |
| 1759 | /* OEM App Process ID */ |
| 1760 | int32_t oem_pid; |
| 1761 | #endif |
| 1762 | |
| 1763 | /** Concurrency Parameters*/ |
| 1764 | uint32_t concurrency_mode; |
| 1765 | |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 1766 | uint8_t no_of_open_sessions[QDF_MAX_NO_OF_MODE]; |
| 1767 | uint8_t no_of_active_sessions[QDF_MAX_NO_OF_MODE]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1768 | |
| 1769 | /** P2P Device MAC Address for the adapter */ |
Jeff Johnson | acbdb1c | 2017-11-02 20:42:02 -0700 | [diff] [blame] | 1770 | struct qdf_mac_addr p2p_device_address; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1771 | |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1772 | qdf_wake_lock_t rx_wake_lock; |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1773 | qdf_wake_lock_t sap_wake_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1774 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1775 | void *hdd_ipa; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1776 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1777 | /* Flag keeps track of wiphy suspend/resume */ |
Jeff Johnson | 214671b | 2017-10-30 19:45:23 -0700 | [diff] [blame] | 1778 | bool is_wiphy_suspended; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1779 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1780 | #ifdef MSM_PLATFORM |
| 1781 | /* DDR bus bandwidth compute timer |
| 1782 | */ |
Poddar, Siddarth | 2333acb | 2017-01-09 16:45:39 +0530 | [diff] [blame] | 1783 | qdf_timer_t bus_bw_timer; |
Dustin Brown | fce08d1 | 2017-01-17 16:29:38 -0800 | [diff] [blame] | 1784 | bool bus_bw_timer_running; |
| 1785 | qdf_spinlock_t bus_bw_timer_lock; |
| 1786 | struct work_struct bus_bw_work; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1787 | int cur_vote_level; |
| 1788 | spinlock_t bus_bw_lock; |
| 1789 | int cur_rx_level; |
Manjunathappa Prakash | 3a21bea | 2018-05-29 20:41:12 -0700 | [diff] [blame] | 1790 | uint64_t prev_no_rx_offload_pkts; |
| 1791 | uint64_t prev_rx_offload_pkts; |
Mohit Khanna | e71e226 | 2015-11-10 09:37:24 -0800 | [diff] [blame] | 1792 | int cur_tx_level; |
| 1793 | uint64_t prev_tx; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1794 | #endif |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1795 | |
| 1796 | struct completion ready_to_suspend; |
| 1797 | /* defining the solution type */ |
| 1798 | uint32_t target_type; |
| 1799 | |
Sourav Mohapatra | 421d42b | 2017-12-29 16:33:23 +0530 | [diff] [blame] | 1800 | qdf_atomic_t con_mode_flag; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1801 | /* defining the firmware version */ |
| 1802 | uint32_t target_fw_version; |
Sandeep Puligilla | 3d6a8e2 | 2016-10-11 18:57:14 -0700 | [diff] [blame] | 1803 | uint32_t target_fw_vers_ext; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1804 | |
| 1805 | /* defining the chip/rom version */ |
| 1806 | uint32_t target_hw_version; |
| 1807 | /* defining the chip/rom revision */ |
| 1808 | uint32_t target_hw_revision; |
| 1809 | /* chip/rom name */ |
Dustin Brown | 6f17a02 | 2017-07-19 13:40:55 -0700 | [diff] [blame] | 1810 | char *target_hw_name; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1811 | struct regulatory reg; |
| 1812 | #ifdef FEATURE_WLAN_CH_AVOID |
| 1813 | uint16_t unsafe_channel_count; |
Amar Singhal | b8d4f15 | 2016-02-10 10:21:43 -0800 | [diff] [blame] | 1814 | uint16_t unsafe_channel_list[NUM_CHANNELS]; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1815 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 1816 | |
| 1817 | uint8_t max_intf_count; |
| 1818 | uint8_t current_intf_count; |
| 1819 | #ifdef WLAN_FEATURE_LPSS |
| 1820 | uint8_t lpss_support; |
| 1821 | #endif |
| 1822 | uint8_t ap_arpns_support; |
| 1823 | tSirScanType ioctl_scan_mode; |
| 1824 | |
| 1825 | #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH |
Anurag Chouhan | 42958bb | 2016-02-19 15:43:11 +0530 | [diff] [blame] | 1826 | qdf_work_t sta_ap_intf_check_work; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1827 | #endif |
| 1828 | |
| 1829 | struct work_struct sap_start_work; |
| 1830 | bool is_sap_restart_required; |
| 1831 | bool is_sta_connection_pending; |
Manishekar Chandrasekaran | 7f63d05 | 2016-05-07 09:54:00 +0530 | [diff] [blame] | 1832 | qdf_spinlock_t sap_update_info_lock; |
| 1833 | qdf_spinlock_t sta_update_info_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1834 | |
| 1835 | uint8_t dev_dfs_cac_status; |
| 1836 | |
Jeff Johnson | 59b1931 | 2017-11-02 21:14:33 -0700 | [diff] [blame] | 1837 | bool bt_coex_mode_set; |
Jeff Johnson | dadef1a | 2017-09-30 16:14:02 -0700 | [diff] [blame] | 1838 | struct fw_log_info fw_log_settings; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1839 | #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE |
Anurag Chouhan | 210db07 | 2016-02-22 18:42:15 +0530 | [diff] [blame] | 1840 | qdf_mc_timer_t skip_acs_scan_timer; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1841 | uint8_t skip_acs_scan_status; |
Liangwei Dong | aef8434 | 2016-10-21 05:28:00 -0400 | [diff] [blame] | 1842 | uint8_t *last_acs_channel_list; |
| 1843 | uint8_t num_of_channels; |
| 1844 | qdf_spinlock_t acs_skip_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1845 | #endif |
| 1846 | |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1847 | qdf_wake_lock_t sap_dfs_wakelock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1848 | atomic_t sap_dfs_ref_cnt; |
| 1849 | |
| 1850 | #ifdef WLAN_FEATURE_EXTWOW_SUPPORT |
| 1851 | bool is_extwow_app_type1_param_set; |
| 1852 | bool is_extwow_app_type2_param_set; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1853 | #endif |
| 1854 | |
| 1855 | /* Time since boot up to extscan start (in micro seconds) */ |
| 1856 | uint64_t ext_scan_start_since_boot; |
| 1857 | unsigned long g_event_flags; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1858 | uint8_t miracast_value; |
Sravan Kumar Kairam | fece87f | 2016-07-26 14:58:28 +0530 | [diff] [blame] | 1859 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1860 | #ifdef WLAN_NS_OFFLOAD |
| 1861 | /* IPv6 notifier callback for handling NS offload on change in IP */ |
| 1862 | struct notifier_block ipv6_notifier; |
| 1863 | #endif |
Sravan Kumar Kairam | fece87f | 2016-07-26 14:58:28 +0530 | [diff] [blame] | 1864 | bool ns_offload_enable; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1865 | /* IPv4 notifier callback for handling ARP offload on change in IP */ |
| 1866 | struct notifier_block ipv4_notifier; |
| 1867 | |
| 1868 | /* number of rf chains supported by target */ |
| 1869 | uint32_t num_rf_chains; |
| 1870 | /* Is htTxSTBC supported by target */ |
| 1871 | uint8_t ht_tx_stbc_supported; |
| 1872 | #ifdef WLAN_FEATURE_OFFLOAD_PACKETS |
| 1873 | struct hdd_offloaded_packets_ctx op_ctx; |
| 1874 | #endif |
| 1875 | bool mcc_mode; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1876 | struct mutex memdump_lock; |
Padma, Santhosh Kumar | 9aba02f | 2016-08-11 16:30:25 +0530 | [diff] [blame] | 1877 | uint16_t driver_dump_size; |
| 1878 | uint8_t *driver_dump_mem; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1879 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1880 | bool connection_in_progress; |
Anurag Chouhan | a37b5b7 | 2016-02-21 14:53:42 +0530 | [diff] [blame] | 1881 | qdf_spinlock_t connection_status_lock; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1882 | |
| 1883 | uint16_t hdd_txrx_hist_idx; |
Nirav Shah | ed34b21 | 2016-04-25 10:59:16 +0530 | [diff] [blame] | 1884 | struct hdd_tx_rx_histogram *hdd_txrx_hist; |
Arif Hussain | 1969ec8 | 2016-07-08 10:37:01 -0700 | [diff] [blame] | 1885 | |
Krunal Soni | e353194 | 2016-04-12 17:43:53 -0700 | [diff] [blame] | 1886 | /* |
| 1887 | * place to store FTM capab of target. This allows changing of FTM capab |
| 1888 | * at runtime and intersecting it with target capab before updating. |
| 1889 | */ |
| 1890 | uint32_t fine_time_meas_cap_target; |
Ravi Joshi | b89e7f7 | 2016-09-07 13:43:15 -0700 | [diff] [blame] | 1891 | uint32_t rx_high_ind_cnt; |
Manjunathappa Prakash | 3a21bea | 2018-05-29 20:41:12 -0700 | [diff] [blame] | 1892 | /* For Rx thread non GRO/LRO packet accounting */ |
| 1893 | uint64_t no_rx_offload_pkt_cnt; |
Archana Ramachandran | d41c3ed | 2016-02-10 15:48:06 -0800 | [diff] [blame] | 1894 | /* Current number of TX X RX chains being used */ |
| 1895 | enum antenna_mode current_antenna_mode; |
Ryan Hsu | ceddceb | 2016-04-28 10:20:14 -0700 | [diff] [blame] | 1896 | |
| 1897 | /* the radio index assigned by cnss_logger */ |
| 1898 | int radio_index; |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 1899 | qdf_work_t sap_pre_cac_work; |
Nirav Shah | ffc6a09 | 2016-06-09 16:09:08 +0530 | [diff] [blame] | 1900 | bool hbw_requested; |
Kapil Gupta | 0ed58dc | 2016-04-22 15:35:26 +0530 | [diff] [blame] | 1901 | uint32_t last_nil_scan_bug_report_timestamp; |
Manjunathappa Prakash | 7b0ad46 | 2018-04-15 00:37:16 -0700 | [diff] [blame] | 1902 | enum RX_OFFLOAD ol_enable; |
Deepak Dhamdhere | 7e6016f | 2016-06-01 09:37:37 -0700 | [diff] [blame] | 1903 | #ifdef WLAN_FEATURE_NAN_DATAPATH |
| 1904 | bool nan_datapath_enabled; |
| 1905 | #endif |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1906 | /* Present state of driver cds modules */ |
| 1907 | enum driver_modules_status driver_status; |
Dustin Brown | 4c66322 | 2018-10-23 14:19:36 -0700 | [diff] [blame] | 1908 | qdf_delayed_work_t psoc_idle_timeout_work; |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 1909 | /* Interface change lock */ |
| 1910 | struct mutex iface_change_lock; |
Nirav Shah | bd36b06 | 2016-07-18 11:12:59 +0530 | [diff] [blame] | 1911 | bool rps; |
Tang Yingying | 5a4ccf2 | 2018-03-30 15:58:27 +0800 | [diff] [blame] | 1912 | bool dynamic_rps; |
Jeff Johnson | e2ba3cd | 2017-10-30 20:02:09 -0700 | [diff] [blame] | 1913 | bool enable_rxthread; |
Mohit Khanna | 7032200 | 2018-05-15 19:21:32 -0700 | [diff] [blame] | 1914 | /* support for DP RX threads */ |
| 1915 | bool enable_dp_rx_threads; |
Nirav Shah | bd36b06 | 2016-07-18 11:12:59 +0530 | [diff] [blame] | 1916 | bool napi_enable; |
Arun Khandavalli | a172c3e | 2016-08-26 17:33:13 +0530 | [diff] [blame] | 1917 | bool stop_modules_in_progress; |
| 1918 | bool start_modules_in_progress; |
Yuanyuan Liu | 245a3e4 | 2016-09-14 12:15:16 -0700 | [diff] [blame] | 1919 | bool update_mac_addr_to_fw; |
Agrawal Ashish | 6563461 | 2016-08-18 13:24:32 +0530 | [diff] [blame] | 1920 | struct acs_dfs_policy acs_policy; |
Rajeev Kumar Sirasanagandla | 4787300 | 2016-09-09 13:46:09 +0530 | [diff] [blame] | 1921 | uint16_t wmi_max_len; |
Dustin Brown | d932248 | 2017-01-09 12:46:03 -0800 | [diff] [blame] | 1922 | struct suspend_resume_stats suspend_resume_stats; |
Komal Seelam | 8634b77 | 2016-09-29 12:12:24 +0530 | [diff] [blame] | 1923 | struct hdd_runtime_pm_context runtime_context; |
Nitesh Shah | 61c10d9 | 2016-10-19 19:29:15 +0530 | [diff] [blame] | 1924 | bool roaming_in_progress; |
Kapil Gupta | 4f0c0c1 | 2017-02-07 15:21:15 +0530 | [diff] [blame] | 1925 | struct scan_chan_info *chan_info; |
| 1926 | struct mutex chan_info_lock; |
Nitesh Shah | 2b946fa | 2016-10-19 17:05:09 +0530 | [diff] [blame] | 1927 | /* bit map to set/reset TDLS by different sources */ |
| 1928 | unsigned long tdls_source_bitmap; |
Kabilan Kannan | 1c1c402 | 2017-04-06 22:49:26 -0700 | [diff] [blame] | 1929 | bool tdls_umac_comp_active; |
Kabilan Kannan | 256e318 | 2017-05-02 16:02:37 -0700 | [diff] [blame] | 1930 | bool tdls_nap_active; |
Padma, Santhosh Kumar | 31bac74 | 2017-01-16 19:34:45 +0530 | [diff] [blame] | 1931 | uint8_t beacon_probe_rsp_cnt_per_scan; |
Sreelakshmi Konamki | b53c629 | 2017-03-01 13:13:23 +0530 | [diff] [blame] | 1932 | uint8_t last_scan_reject_session_id; |
| 1933 | enum scan_reject_states last_scan_reject_reason; |
| 1934 | unsigned long last_scan_reject_timestamp; |
Abhishek Singh | 0013068 | 2017-07-14 10:46:17 +0530 | [diff] [blame] | 1935 | uint8_t scan_reject_cnt; |
Arif Hussain | 759a023 | 2017-03-20 13:17:18 -0700 | [diff] [blame] | 1936 | bool dfs_cac_offload; |
Amar Singhal | 5cccafe | 2017-02-15 12:42:58 -0800 | [diff] [blame] | 1937 | bool reg_offload; |
Rajeev Kumar Sirasanagandla | 996e529 | 2016-11-22 21:20:33 +0530 | [diff] [blame] | 1938 | bool rcpi_enabled; |
Ajit Pal Singh | 2c7aecd | 2017-05-19 15:09:23 +0530 | [diff] [blame] | 1939 | #ifdef FEATURE_WLAN_CH_AVOID |
Kiran Kumar Lokere | 4879579 | 2017-07-07 15:34:29 -0700 | [diff] [blame] | 1940 | struct ch_avoid_ind_type coex_avoid_freq_list; |
| 1941 | struct ch_avoid_ind_type dnbs_avoid_freq_list; |
Ajit Pal Singh | 2c7aecd | 2017-05-19 15:09:23 +0530 | [diff] [blame] | 1942 | /* Lock to control access to dnbs and coex avoid freq list */ |
| 1943 | struct mutex avoid_freq_lock; |
| 1944 | #endif |
Yu Wang | f5d5b5f | 2017-05-25 22:38:32 +0800 | [diff] [blame] | 1945 | #ifdef WLAN_FEATURE_TSF |
| 1946 | /* indicate whether tsf has been initialized */ |
| 1947 | qdf_atomic_t tsf_ready_flag; |
| 1948 | /* indicate whether it's now capturing tsf(updating tstamp-pair) */ |
| 1949 | qdf_atomic_t cap_tsf_flag; |
| 1950 | /* the context that is capturing tsf */ |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 1951 | struct hdd_adapter *cap_tsf_context; |
Yu Wang | f5d5b5f | 2017-05-25 22:38:32 +0800 | [diff] [blame] | 1952 | #endif |
Vidyullatha Kanchanapally | be0ebb3 | 2017-03-23 14:36:21 +0530 | [diff] [blame] | 1953 | uint8_t bt_a2dp_active:1; |
| 1954 | uint8_t bt_vo_active:1; |
Varun Reddy Yeturu | a48bc41 | 2017-11-17 15:33:35 -0800 | [diff] [blame] | 1955 | enum band_info curr_band; |
Arunk Khandavalli | 847969d | 2017-09-25 15:15:36 +0530 | [diff] [blame] | 1956 | bool imps_enabled; |
Qiwei Cai | 4505fc6 | 2018-05-17 18:35:19 +0800 | [diff] [blame] | 1957 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Hanumanth Reddy Pothula | 3def894 | 2017-10-05 16:19:36 +0530 | [diff] [blame] | 1958 | int user_configured_pkt_filter_rules; |
Qiwei Cai | 4505fc6 | 2018-05-17 18:35:19 +0800 | [diff] [blame] | 1959 | #endif |
Vignesh Viswanathan | 731186f | 2017-09-18 13:47:37 +0530 | [diff] [blame] | 1960 | bool is_fils_roaming_supported; |
Manjunathappa Prakash | 7b0ad46 | 2018-04-15 00:37:16 -0700 | [diff] [blame] | 1961 | QDF_STATUS (*receive_offload_cb)(struct hdd_adapter *, |
| 1962 | struct sk_buff *); |
Poddar, Siddarth | 4b3f731 | 2017-11-02 17:00:20 +0530 | [diff] [blame] | 1963 | qdf_atomic_t vendor_disable_lro_flag; |
Manjunathappa Prakash | 7b6cb00 | 2017-10-09 00:40:24 -0700 | [diff] [blame] | 1964 | qdf_atomic_t disable_lro_in_concurrency; |
Poddar, Siddarth | 47c2340 | 2017-10-25 12:17:39 +0530 | [diff] [blame] | 1965 | qdf_atomic_t disable_lro_in_low_tput; |
Manjunathappa Prakash | 81ca3a5 | 2017-10-09 01:41:58 -0700 | [diff] [blame] | 1966 | bool en_tcp_delack_no_lro; |
Abhishek Singh | 6454ad3 | 2017-12-20 10:42:21 +0530 | [diff] [blame] | 1967 | bool force_rsne_override; |
Arunk Khandavalli | ebd1e37 | 2017-11-06 15:00:24 +0530 | [diff] [blame] | 1968 | qdf_wake_lock_t monitor_mode_wakelock; |
Naveen Rawat | 269b4ed | 2017-12-07 06:47:32 -0800 | [diff] [blame] | 1969 | bool lte_coex_ant_share; |
Liangwei Dong | 0da1426 | 2018-07-03 03:30:23 -0400 | [diff] [blame] | 1970 | bool obss_scan_offload; |
Sandeep Puligilla | 019a1bd | 2018-02-04 22:57:44 -0800 | [diff] [blame] | 1971 | int sscan_pid; |
Sravan Kumar Kairam | c1ae71c | 2017-02-24 12:27:27 +0530 | [diff] [blame] | 1972 | uint32_t track_arp_ip; |
Ryan Hsu | c691855 | 2018-05-16 13:29:59 -0700 | [diff] [blame] | 1973 | |
| 1974 | /* defining the board related information */ |
| 1975 | uint32_t hw_bd_id; |
| 1976 | struct board_info hw_bd_info; |
Varun Reddy Yeturu | d33033f | 2018-06-11 10:58:30 -0700 | [diff] [blame] | 1977 | #ifdef WLAN_SUPPORT_TWT |
Varun Reddy Yeturu | 3c9f89c | 2018-04-18 19:10:34 -0700 | [diff] [blame] | 1978 | enum twt_status twt_state; |
| 1979 | #endif |
Nachiket Kukade | 5f0ce4f | 2018-06-15 19:47:37 +0530 | [diff] [blame] | 1980 | #ifdef FEATURE_WLAN_APF |
Nachiket Kukade | 5f0ce4f | 2018-06-15 19:47:37 +0530 | [diff] [blame] | 1981 | uint32_t apf_version; |
Rajeev Kumar Sirasanagandla | 85f8b02 | 2018-03-12 12:52:59 +0530 | [diff] [blame] | 1982 | bool apf_enabled_v2; |
Nachiket Kukade | 5f0ce4f | 2018-06-15 19:47:37 +0530 | [diff] [blame] | 1983 | #endif |
Ashish Kumar Dhanotiya | 3f78e68 | 2018-03-14 11:19:27 +0530 | [diff] [blame] | 1984 | |
| 1985 | #ifdef DISABLE_CHANNEL_LIST |
| 1986 | struct hdd_cache_channels *original_channels; |
| 1987 | qdf_mutex_t cache_channel_lock; |
| 1988 | #endif |
Jeff Johnson | f917638 | 2018-07-17 19:15:58 -0700 | [diff] [blame] | 1989 | enum sar_version sar_version; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1990 | }; |
| 1991 | |
Kapil Gupta | 086c620 | 2016-12-11 18:17:06 +0530 | [diff] [blame] | 1992 | /** |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 1993 | * struct hdd_vendor_acs_chan_params - vendor acs channel parameters |
| 1994 | * @channel_count: channel count |
| 1995 | * @channel_list: pointer to channel list |
Jayachandran Sreekumaran | 68c952c | 2017-04-24 12:42:03 +0530 | [diff] [blame] | 1996 | * @pcl_count: pcl list count |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 1997 | * @vendor_pcl_list: pointer to pcl list |
| 1998 | * @vendor_weight_list: pointer to pcl weight list |
| 1999 | */ |
| 2000 | struct hdd_vendor_acs_chan_params { |
| 2001 | uint32_t channel_count; |
| 2002 | uint8_t *channel_list; |
Jayachandran Sreekumaran | 68c952c | 2017-04-24 12:42:03 +0530 | [diff] [blame] | 2003 | uint32_t pcl_count; |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2004 | uint8_t *vendor_pcl_list; |
| 2005 | uint8_t *vendor_weight_list; |
| 2006 | }; |
| 2007 | |
| 2008 | /** |
| 2009 | * struct hdd_external_acs_timer_context - acs timer context |
| 2010 | * @reason: reason for acs trigger |
| 2011 | * @adapter: hdd adapter for acs |
| 2012 | */ |
| 2013 | struct hdd_external_acs_timer_context { |
| 2014 | int8_t reason; |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2015 | struct hdd_adapter *adapter; |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2016 | }; |
| 2017 | |
| 2018 | /** |
| 2019 | * struct hdd_vendor_chan_info - vendor channel info |
Kapil Gupta | 63e7528 | 2017-05-18 20:55:10 +0530 | [diff] [blame] | 2020 | * @band: channel operating band |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2021 | * @pri_ch: primary channel |
| 2022 | * @ht_sec_ch: secondary channel |
| 2023 | * @vht_seg0_center_ch: segment0 for vht |
| 2024 | * @vht_seg1_center_ch: vht segment 1 |
| 2025 | * @chan_width: channel width |
| 2026 | */ |
| 2027 | struct hdd_vendor_chan_info { |
Kapil Gupta | 63e7528 | 2017-05-18 20:55:10 +0530 | [diff] [blame] | 2028 | uint8_t band; |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2029 | uint8_t pri_ch; |
| 2030 | uint8_t ht_sec_ch; |
| 2031 | uint8_t vht_seg0_center_ch; |
| 2032 | uint8_t vht_seg1_center_ch; |
| 2033 | uint8_t chan_width; |
| 2034 | }; |
| 2035 | |
| 2036 | /** |
Kapil Gupta | 086c620 | 2016-12-11 18:17:06 +0530 | [diff] [blame] | 2037 | * struct hdd_channel_info - standard channel info |
| 2038 | * @freq: Freq in Mhz |
| 2039 | * @flags: channel info flags |
| 2040 | * @flagext: extended channel info flags |
| 2041 | * @ieee_chan_number: channel number |
| 2042 | * @max_reg_power: max tx power according to regulatory |
| 2043 | * @max_radio_power: max radio power |
| 2044 | * @min_radio_power: min radio power |
| 2045 | * @reg_class_id: regulatory class |
| 2046 | * @max_antenna_gain: max antenna gain allowed on channel |
| 2047 | * @vht_center_freq_seg0: vht center freq segment 0 |
| 2048 | * @vht_center_freq_seg1: vht center freq segment 1 |
| 2049 | */ |
| 2050 | struct hdd_channel_info { |
| 2051 | u_int16_t freq; |
| 2052 | u_int32_t flags; |
| 2053 | u_int16_t flagext; |
| 2054 | u_int8_t ieee_chan_number; |
| 2055 | int8_t max_reg_power; |
| 2056 | int8_t max_radio_power; |
| 2057 | int8_t min_radio_power; |
| 2058 | u_int8_t reg_class_id; |
| 2059 | u_int8_t max_antenna_gain; |
| 2060 | u_int8_t vht_center_freq_seg0; |
| 2061 | u_int8_t vht_center_freq_seg1; |
| 2062 | }; |
| 2063 | |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 2064 | /* |
Nachiket Kukade | be8850b | 2017-09-18 15:37:00 +0530 | [diff] [blame] | 2065 | * @eHDD_DRV_OP_PROBE: Refers to .probe operation |
| 2066 | * @eHDD_DRV_OP_REMOVE: Refers to .remove operation |
| 2067 | * @eHDD_DRV_OP_SHUTDOWN: Refers to .shutdown operation |
| 2068 | * @eHDD_DRV_OP_REINIT: Refers to .reinit operation |
Arunk Khandavalli | e9ef42a | 2017-10-04 14:49:51 +0530 | [diff] [blame] | 2069 | * @eHDD_DRV_OP_IFF_UP: Refers to IFF_UP operation |
Nachiket Kukade | be8850b | 2017-09-18 15:37:00 +0530 | [diff] [blame] | 2070 | */ |
| 2071 | enum { |
| 2072 | eHDD_DRV_OP_PROBE = 0, |
| 2073 | eHDD_DRV_OP_REMOVE, |
| 2074 | eHDD_DRV_OP_SHUTDOWN, |
Arunk Khandavalli | e9ef42a | 2017-10-04 14:49:51 +0530 | [diff] [blame] | 2075 | eHDD_DRV_OP_REINIT, |
| 2076 | eHDD_DRV_OP_IFF_UP |
Nachiket Kukade | be8850b | 2017-09-18 15:37:00 +0530 | [diff] [blame] | 2077 | }; |
| 2078 | |
| 2079 | /* |
Jeff Johnson | ef92635 | 2017-01-12 10:41:02 -0800 | [diff] [blame] | 2080 | * Function declarations and documentation |
| 2081 | */ |
Himanshu Agarwal | 813b2bf | 2018-01-22 16:32:15 +0530 | [diff] [blame] | 2082 | |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2083 | int hdd_validate_channel_and_bandwidth(struct hdd_adapter *adapter, |
Chandrasekaran, Manishekar | 794a098 | 2016-01-12 19:42:20 +0530 | [diff] [blame] | 2084 | uint32_t chan_number, |
Kiran Kumar Lokere | 1364467 | 2016-02-29 15:40:10 -0800 | [diff] [blame] | 2085 | enum phy_ch_width chan_bw); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2086 | |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2087 | QDF_STATUS hdd_get_front_adapter(struct hdd_context *hdd_ctx, |
Dustin Brown | 920397d | 2017-12-13 16:27:50 -0800 | [diff] [blame] | 2088 | struct hdd_adapter **out_adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2089 | |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2090 | QDF_STATUS hdd_get_next_adapter(struct hdd_context *hdd_ctx, |
Dustin Brown | 920397d | 2017-12-13 16:27:50 -0800 | [diff] [blame] | 2091 | struct hdd_adapter *current_adapter, |
| 2092 | struct hdd_adapter **out_adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2093 | |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2094 | QDF_STATUS hdd_remove_adapter(struct hdd_context *hdd_ctx, |
Dustin Brown | 920397d | 2017-12-13 16:27:50 -0800 | [diff] [blame] | 2095 | struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2096 | |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2097 | QDF_STATUS hdd_remove_front_adapter(struct hdd_context *hdd_ctx, |
Dustin Brown | 920397d | 2017-12-13 16:27:50 -0800 | [diff] [blame] | 2098 | struct hdd_adapter **out_adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2099 | |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2100 | QDF_STATUS hdd_add_adapter_back(struct hdd_context *hdd_ctx, |
Dustin Brown | 920397d | 2017-12-13 16:27:50 -0800 | [diff] [blame] | 2101 | struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2102 | |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2103 | QDF_STATUS hdd_add_adapter_front(struct hdd_context *hdd_ctx, |
Dustin Brown | 920397d | 2017-12-13 16:27:50 -0800 | [diff] [blame] | 2104 | struct hdd_adapter *adapter); |
| 2105 | |
| 2106 | /** |
| 2107 | * hdd_for_each_adapter - adapter iterator macro |
| 2108 | * @hdd_ctx: the global HDD context |
| 2109 | * @adapter: an hdd_adapter pointer to use as a cursor |
| 2110 | */ |
| 2111 | #define hdd_for_each_adapter(hdd_ctx, adapter) \ |
| 2112 | for (hdd_get_front_adapter(hdd_ctx, &adapter); \ |
| 2113 | adapter; \ |
| 2114 | hdd_get_next_adapter(hdd_ctx, adapter, &adapter)) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2115 | |
Jeff Johnson | 7b92c0f | 2017-10-02 13:31:35 -0700 | [diff] [blame] | 2116 | struct hdd_adapter *hdd_open_adapter(struct hdd_context *hdd_ctx, |
| 2117 | uint8_t session_type, |
| 2118 | const char *name, tSirMacAddr macAddr, |
| 2119 | unsigned char name_assign_type, |
| 2120 | bool rtnl_held); |
Dustin Brown | 728d65a | 2018-10-02 16:27:52 -0700 | [diff] [blame] | 2121 | |
| 2122 | /** |
| 2123 | * hdd_close_adapter() - remove and free @adapter from the adapter list |
| 2124 | * @hdd_ctx: The Hdd context containing the adapter list |
| 2125 | * @adapter: the adapter to remove and free |
| 2126 | * @rtnl_held: if the caller is already holding the RTNL lock |
| 2127 | * |
| 2128 | * Return: None |
| 2129 | */ |
| 2130 | void hdd_close_adapter(struct hdd_context *hdd_ctx, |
| 2131 | struct hdd_adapter *adapter, |
| 2132 | bool rtnl_held); |
| 2133 | |
| 2134 | /** |
| 2135 | * hdd_close_all_adapters() - remove and free all adapters from the adapter list |
| 2136 | * @hdd_ctx: The Hdd context containing the adapter list |
| 2137 | * @rtnl_held: if the caller is already holding the RTNL lock |
| 2138 | * |
| 2139 | * Return: None |
| 2140 | */ |
| 2141 | void hdd_close_all_adapters(struct hdd_context *hdd_ctx, bool rtnl_held); |
| 2142 | |
Dustin Brown | db2a8be | 2017-12-20 11:49:56 -0800 | [diff] [blame] | 2143 | QDF_STATUS hdd_stop_all_adapters(struct hdd_context *hdd_ctx); |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2144 | void hdd_deinit_all_adapters(struct hdd_context *hdd_ctx, bool rtnl_held); |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2145 | QDF_STATUS hdd_reset_all_adapters(struct hdd_context *hdd_ctx); |
| 2146 | QDF_STATUS hdd_start_all_adapters(struct hdd_context *hdd_ctx); |
| 2147 | struct hdd_adapter *hdd_get_adapter_by_vdev(struct hdd_context *hdd_ctx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2148 | uint32_t vdev_id); |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2149 | struct hdd_adapter *hdd_get_adapter_by_macaddr(struct hdd_context *hdd_ctx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2150 | tSirMacAddr macAddr); |
Dustin Brown | d28772b | 2017-03-17 14:16:07 -0700 | [diff] [blame] | 2151 | |
Krunal Soni | b51eec7 | 2017-11-20 21:53:01 -0800 | [diff] [blame] | 2152 | int hdd_vdev_create(struct hdd_adapter *adapter, |
Jeff Johnson | 6a18c96 | 2018-07-01 09:09:37 -0700 | [diff] [blame] | 2153 | csr_roam_complete_cb callback, void *ctx); |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2154 | int hdd_vdev_destroy(struct hdd_adapter *adapter); |
| 2155 | int hdd_vdev_ready(struct hdd_adapter *adapter); |
Dustin Brown | d28772b | 2017-03-17 14:16:07 -0700 | [diff] [blame] | 2156 | |
Jeff Johnson | 7b92c0f | 2017-10-02 13:31:35 -0700 | [diff] [blame] | 2157 | QDF_STATUS hdd_init_station_mode(struct hdd_adapter *adapter); |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2158 | struct hdd_adapter *hdd_get_adapter(struct hdd_context *hdd_ctx, |
Jeff Johnson | c1e6278 | 2017-11-09 09:50:17 -0800 | [diff] [blame] | 2159 | enum QDF_OPMODE mode); |
Yeshwanth Sriram Guntuka | 469f957 | 2018-02-12 13:28:22 +0530 | [diff] [blame] | 2160 | /* |
| 2161 | * hdd_get_device_mode() - Get device mode |
| 2162 | * @session_id: Session id |
| 2163 | * |
| 2164 | * Return: Device mode |
| 2165 | */ |
Jeff Johnson | 36a0abf | 2018-05-20 11:24:25 -0700 | [diff] [blame] | 2166 | enum QDF_OPMODE hdd_get_device_mode(uint32_t session_id); |
Jeff Johnson | 7b92c0f | 2017-10-02 13:31:35 -0700 | [diff] [blame] | 2167 | void hdd_deinit_adapter(struct hdd_context *hdd_ctx, |
| 2168 | struct hdd_adapter *adapter, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2169 | bool rtnl_held); |
Jeff Johnson | 7b92c0f | 2017-10-02 13:31:35 -0700 | [diff] [blame] | 2170 | QDF_STATUS hdd_stop_adapter(struct hdd_context *hdd_ctx, |
Dustin Brown | db2a8be | 2017-12-20 11:49:56 -0800 | [diff] [blame] | 2171 | struct hdd_adapter *adapter); |
Liangwei Dong | ad89c76 | 2018-06-01 01:56:23 -0400 | [diff] [blame] | 2172 | |
| 2173 | enum hdd_adapter_stop_flag_t { |
| 2174 | HDD_IN_CAC_WORK_TH_CONTEXT = 0x00000001, |
| 2175 | }; |
| 2176 | |
| 2177 | QDF_STATUS hdd_stop_adapter_ext(struct hdd_context *hdd_ctx, |
| 2178 | struct hdd_adapter *adapter, |
| 2179 | enum hdd_adapter_stop_flag_t flag); |
| 2180 | |
Jeff Johnson | 5505db8 | 2017-11-02 21:19:23 -0700 | [diff] [blame] | 2181 | void hdd_set_station_ops(struct net_device *dev); |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2182 | uint8_t *wlan_hdd_get_intf_addr(struct hdd_context *hdd_ctx); |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2183 | void wlan_hdd_release_intf_addr(struct hdd_context *hdd_ctx, |
| 2184 | uint8_t *releaseAddr); |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2185 | uint8_t hdd_get_operating_channel(struct hdd_context *hdd_ctx, |
Jeff Johnson | c1e6278 | 2017-11-09 09:50:17 -0800 | [diff] [blame] | 2186 | enum QDF_OPMODE mode); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2187 | |
Dustin Brown | f0f7056 | 2018-09-14 10:29:38 -0700 | [diff] [blame] | 2188 | void hdd_set_conparam(int32_t con_param); |
Jeff Johnson | 876c1a6 | 2017-12-12 10:43:07 -0800 | [diff] [blame] | 2189 | enum QDF_GLOBAL_MODE hdd_get_conparam(void); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2190 | void crda_regulatory_entry_default(uint8_t *countryCode, int domain_id); |
Jeff Johnson | 9c4f93d | 2017-10-04 08:56:22 -0700 | [diff] [blame] | 2191 | void wlan_hdd_reset_prob_rspies(struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2192 | void hdd_prevent_suspend(uint32_t reason); |
Sourav Mohapatra | 92ea8d6 | 2018-02-05 10:03:10 +0530 | [diff] [blame] | 2193 | |
| 2194 | /* |
| 2195 | * hdd_get_first_valid_adapter() - Get the first valid adapter from adapter list |
| 2196 | * |
| 2197 | * This function is used to fetch the first valid adapter from the adapter |
| 2198 | * list. If there is no valid adapter then it returns NULL |
| 2199 | * |
| 2200 | * @hdd_ctx: HDD context handler |
| 2201 | * |
| 2202 | * Return: NULL if no valid adapter found in the adapter list |
| 2203 | * |
| 2204 | */ |
| 2205 | struct hdd_adapter *hdd_get_first_valid_adapter(struct hdd_context *hdd_ctx); |
| 2206 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2207 | void hdd_allow_suspend(uint32_t reason); |
| 2208 | void hdd_prevent_suspend_timeout(uint32_t timeout, uint32_t reason); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2209 | |
| 2210 | void wlan_hdd_cfg80211_update_wiphy_caps(struct wiphy *wiphy); |
Jeff Johnson | 7b92c0f | 2017-10-02 13:31:35 -0700 | [diff] [blame] | 2211 | QDF_STATUS hdd_set_ibss_power_save_params(struct hdd_adapter *adapter); |
Dustin Brown | da351e3 | 2018-07-23 15:48:22 -0700 | [diff] [blame] | 2212 | |
| 2213 | /** |
| 2214 | * wlan_hdd_validate_context() - check the HDD context |
| 2215 | * @hdd_ctx: Global HDD context pointer |
| 2216 | * |
| 2217 | * Return: 0 if the context is valid. Error code otherwise |
| 2218 | */ |
| 2219 | #define wlan_hdd_validate_context(hdd_ctx) \ |
| 2220 | __wlan_hdd_validate_context(hdd_ctx, __func__) |
| 2221 | |
| 2222 | int __wlan_hdd_validate_context(struct hdd_context *hdd_ctx, const char *func); |
Dustin Brown | f13b8c3 | 2017-05-19 17:23:08 -0700 | [diff] [blame] | 2223 | |
| 2224 | /** |
| 2225 | * hdd_validate_adapter() - Validate the given adapter |
| 2226 | * @adapter: the adapter to validate |
| 2227 | * |
| 2228 | * This function validates the given adapter, and ensures that it is open. |
| 2229 | * |
| 2230 | * Return: Errno |
| 2231 | */ |
Dustin Brown | a8700cc | 2018-08-07 12:04:47 -0700 | [diff] [blame] | 2232 | #define hdd_validate_adapter(adapter) \ |
| 2233 | __hdd_validate_adapter(adapter, __func__) |
| 2234 | |
| 2235 | int __hdd_validate_adapter(struct hdd_adapter *adapter, const char *func); |
Dustin Brown | f13b8c3 | 2017-05-19 17:23:08 -0700 | [diff] [blame] | 2236 | |
Dustin Brown | 6350061 | 2018-08-07 11:36:09 -0700 | [diff] [blame] | 2237 | /** |
| 2238 | * wlan_hdd_validate_session_id() - ensure the given session Id is valid |
| 2239 | * @session_id: the session Id to validate |
| 2240 | * |
| 2241 | * Return: Errno |
| 2242 | */ |
| 2243 | #define wlan_hdd_validate_session_id(session_id) \ |
| 2244 | __wlan_hdd_validate_session_id(session_id, __func__) |
| 2245 | |
| 2246 | int __wlan_hdd_validate_session_id(uint8_t session_id, const char *func); |
| 2247 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2248 | bool hdd_is_valid_mac_address(const uint8_t *pMacAddr); |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2249 | QDF_STATUS hdd_issta_p2p_clientconnected(struct hdd_context *hdd_ctx); |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2250 | bool wlan_hdd_validate_modules_state(struct hdd_context *hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2251 | |
Pragaspathi Thilagaraj | 84b7284 | 2018-09-19 22:06:57 +0530 | [diff] [blame] | 2252 | /** |
| 2253 | * wlan_hdd_validate_mac_address() - Function to validate mac address |
| 2254 | * @mac_addr: input mac address |
| 2255 | * |
| 2256 | * Return QDF_STATUS |
| 2257 | */ |
| 2258 | #define wlan_hdd_validate_mac_address(mac_addr) \ |
| 2259 | __wlan_hdd_validate_mac_address(mac_addr, __func__) |
| 2260 | |
| 2261 | QDF_STATUS __wlan_hdd_validate_mac_address(struct qdf_mac_addr *mac_addr, |
| 2262 | const char *func); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2263 | #ifdef MSM_PLATFORM |
Dustin Brown | 5ec6b55 | 2017-03-31 12:11:40 -0700 | [diff] [blame] | 2264 | /** |
| 2265 | * hdd_bus_bw_compute_timer_start() - start the bandwidth timer |
| 2266 | * @hdd_ctx: the global hdd context |
| 2267 | * |
| 2268 | * Return: None |
| 2269 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2270 | void hdd_bus_bw_compute_timer_start(struct hdd_context *hdd_ctx); |
Dustin Brown | 5ec6b55 | 2017-03-31 12:11:40 -0700 | [diff] [blame] | 2271 | |
| 2272 | /** |
| 2273 | * hdd_bus_bw_compute_timer_try_start() - try to start the bandwidth timer |
| 2274 | * @hdd_ctx: the global hdd context |
| 2275 | * |
| 2276 | * This function ensures there is at least one adapter in the associated state |
| 2277 | * before starting the bandwidth timer. |
| 2278 | * |
| 2279 | * Return: None |
| 2280 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2281 | void hdd_bus_bw_compute_timer_try_start(struct hdd_context *hdd_ctx); |
Dustin Brown | 5ec6b55 | 2017-03-31 12:11:40 -0700 | [diff] [blame] | 2282 | |
| 2283 | /** |
| 2284 | * hdd_bus_bw_compute_timer_stop() - stop the bandwidth timer |
| 2285 | * @hdd_ctx: the global hdd context |
| 2286 | * |
| 2287 | * Return: None |
| 2288 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2289 | void hdd_bus_bw_compute_timer_stop(struct hdd_context *hdd_ctx); |
Dustin Brown | 5ec6b55 | 2017-03-31 12:11:40 -0700 | [diff] [blame] | 2290 | |
| 2291 | /** |
| 2292 | * hdd_bus_bw_compute_timer_try_stop() - try to stop the bandwidth timer |
| 2293 | * @hdd_ctx: the global hdd context |
| 2294 | * |
| 2295 | * This function ensures there are no adapters in the associated state before |
| 2296 | * stopping the bandwidth timer. |
| 2297 | * |
| 2298 | * Return: None |
| 2299 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2300 | void hdd_bus_bw_compute_timer_try_stop(struct hdd_context *hdd_ctx); |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 2301 | |
| 2302 | /** |
| 2303 | * hdd_bus_bandwidth_init() - Initialize bus bandwidth data structures. |
Lin Bai | c5c0688 | 2017-09-21 13:58:43 +0800 | [diff] [blame] | 2304 | * @hdd_ctx: HDD context |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 2305 | * |
| 2306 | * Initialize bus bandwidth related data structures like spinlock and timer. |
| 2307 | * |
| 2308 | * Return: None. |
| 2309 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2310 | int hdd_bus_bandwidth_init(struct hdd_context *hdd_ctx); |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 2311 | |
| 2312 | /** |
Dustin Brown | 86d196b | 2018-08-02 11:51:49 -0700 | [diff] [blame] | 2313 | * hdd_bus_bandwidth_deinit() - De-initialize bus bandwidth data structures. |
Lin Bai | c5c0688 | 2017-09-21 13:58:43 +0800 | [diff] [blame] | 2314 | * @hdd_ctx: HDD context |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 2315 | * |
Dustin Brown | 86d196b | 2018-08-02 11:51:49 -0700 | [diff] [blame] | 2316 | * De-initialize bus bandwidth related data structures like timer. |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 2317 | * |
| 2318 | * Return: None. |
| 2319 | */ |
Dustin Brown | 86d196b | 2018-08-02 11:51:49 -0700 | [diff] [blame] | 2320 | void hdd_bus_bandwidth_deinit(struct hdd_context *hdd_ctx); |
Lin Bai | c5c0688 | 2017-09-21 13:58:43 +0800 | [diff] [blame] | 2321 | |
Lin Bai | 556a192 | 2017-11-10 20:32:04 +0800 | [diff] [blame] | 2322 | #define GET_CUR_RX_LVL(config) ((config)->cur_rx_level) |
jitiphil | 869b9f7 | 2018-09-25 17:14:01 +0530 | [diff] [blame] | 2323 | #define GET_BW_COMPUTE_INTV(config) ((config)->bus_bw_compute_interval) |
Lin Bai | aa7f8d7 | 2017-10-18 17:23:45 +0800 | [diff] [blame] | 2324 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2325 | #else |
Dustin Brown | 5ec6b55 | 2017-03-31 12:11:40 -0700 | [diff] [blame] | 2326 | |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2327 | static inline |
| 2328 | void hdd_bus_bw_compute_timer_start(struct hdd_context *hdd_ctx) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2329 | { |
Dustin Brown | 5ec6b55 | 2017-03-31 12:11:40 -0700 | [diff] [blame] | 2330 | } |
| 2331 | |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2332 | static inline |
| 2333 | void hdd_bus_bw_compute_timer_try_start(struct hdd_context *hdd_ctx) |
Dustin Brown | 5ec6b55 | 2017-03-31 12:11:40 -0700 | [diff] [blame] | 2334 | { |
| 2335 | } |
| 2336 | |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2337 | static inline |
| 2338 | void hdd_bus_bw_compute_timer_stop(struct hdd_context *hdd_ctx) |
Dustin Brown | 5ec6b55 | 2017-03-31 12:11:40 -0700 | [diff] [blame] | 2339 | { |
| 2340 | } |
| 2341 | |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2342 | static inline |
| 2343 | void hdd_bus_bw_compute_timer_try_stop(struct hdd_context *hdd_ctx) |
Dustin Brown | 5ec6b55 | 2017-03-31 12:11:40 -0700 | [diff] [blame] | 2344 | { |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2345 | } |
| 2346 | |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2347 | static inline |
| 2348 | int hdd_bus_bandwidth_init(struct hdd_context *hdd_ctx) |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 2349 | { |
| 2350 | return 0; |
| 2351 | } |
| 2352 | |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2353 | static inline |
Dustin Brown | 86d196b | 2018-08-02 11:51:49 -0700 | [diff] [blame] | 2354 | void hdd_bus_bandwidth_deinit(struct hdd_context *hdd_ctx) |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 2355 | { |
Prashanth Bhatta | ab00438 | 2016-10-11 16:08:11 -0700 | [diff] [blame] | 2356 | } |
Lin Bai | c5c0688 | 2017-09-21 13:58:43 +0800 | [diff] [blame] | 2357 | |
Lin Bai | 556a192 | 2017-11-10 20:32:04 +0800 | [diff] [blame] | 2358 | #define GET_CUR_RX_LVL(config) 0 |
Lin Bai | aa7f8d7 | 2017-10-18 17:23:45 +0800 | [diff] [blame] | 2359 | #define GET_BW_COMPUTE_INTV(config) 0 |
| 2360 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2361 | #endif |
| 2362 | |
Ashish Kumar Dhanotiya | 53c2f69 | 2017-02-08 00:25:11 +0530 | [diff] [blame] | 2363 | int hdd_qdf_trace_enable(QDF_MODULE_ID module_id, uint32_t bitmask); |
| 2364 | |
Prashanth Bhatta | 5da711e | 2015-11-30 14:28:52 -0800 | [diff] [blame] | 2365 | int hdd_init(void); |
| 2366 | void hdd_deinit(void); |
| 2367 | |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 2368 | int hdd_wlan_startup(struct device *dev); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2369 | void __hdd_wlan_exit(void); |
| 2370 | int hdd_wlan_notify_modem_power_state(int state); |
| 2371 | #ifdef QCA_HT_2040_COEX |
Jeff Johnson | e7672e7 | 2017-10-21 15:10:04 -0700 | [diff] [blame] | 2372 | /** |
| 2373 | * hdd_wlan_set_ht2040_mode() - notify FW with HT20/HT40 mode |
| 2374 | * @adapter: pointer to adapter |
| 2375 | * @sta_id: station id |
| 2376 | * @sta_mac: station MAC address |
| 2377 | * @channel_type: channel type |
| 2378 | * |
| 2379 | * This function notifies FW with HT20/HT40 mode |
| 2380 | * |
| 2381 | * Return: 0 if successful, error number otherwise |
| 2382 | */ |
| 2383 | int hdd_wlan_set_ht2040_mode(struct hdd_adapter *adapter, uint16_t sta_id, |
| 2384 | struct qdf_mac_addr sta_mac, int channel_type); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2385 | #endif |
| 2386 | |
Kondabattini, Ganesh | 96ac37b | 2016-09-02 23:12:15 +0530 | [diff] [blame] | 2387 | 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] | 2388 | #ifdef FEATURE_WLAN_AUTO_SHUTDOWN |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2389 | void wlan_hdd_auto_shutdown_enable(struct hdd_context *hdd_ctx, bool enable); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2390 | #endif |
| 2391 | |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2392 | struct hdd_adapter * |
| 2393 | hdd_get_con_sap_adapter(struct hdd_adapter *this_sap_adapter, |
| 2394 | bool check_start_bss); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2395 | |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2396 | bool hdd_is_5g_supported(struct hdd_context *hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2397 | |
Jeff Johnson | 7b92c0f | 2017-10-02 13:31:35 -0700 | [diff] [blame] | 2398 | int wlan_hdd_scan_abort(struct hdd_adapter *adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2399 | |
Srinivas Girigowda | a8f6658 | 2017-06-26 23:02:30 -0700 | [diff] [blame] | 2400 | #ifdef WLAN_FEATURE_ROAM_OFFLOAD |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2401 | static inline bool roaming_offload_enabled(struct hdd_context *hdd_ctx) |
Srinivas Girigowda | 8df27ea | 2017-01-06 12:42:16 -0800 | [diff] [blame] | 2402 | { |
Wu Gao | ca416ff | 2018-09-17 11:05:07 +0800 | [diff] [blame] | 2403 | bool is_roam_offload; |
| 2404 | |
Dustin Brown | 05d8130 | 2018-09-11 16:49:22 -0700 | [diff] [blame] | 2405 | ucfg_mlme_get_roaming_offload(hdd_ctx->psoc, &is_roam_offload); |
Wu Gao | ca416ff | 2018-09-17 11:05:07 +0800 | [diff] [blame] | 2406 | |
| 2407 | return is_roam_offload; |
Srinivas Girigowda | 8df27ea | 2017-01-06 12:42:16 -0800 | [diff] [blame] | 2408 | } |
| 2409 | #else |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2410 | static inline bool roaming_offload_enabled(struct hdd_context *hdd_ctx) |
Srinivas Girigowda | 8df27ea | 2017-01-06 12:42:16 -0800 | [diff] [blame] | 2411 | { |
| 2412 | return false; |
| 2413 | } |
| 2414 | #endif |
| 2415 | |
Srinivas Girigowda | a8f6658 | 2017-06-26 23:02:30 -0700 | [diff] [blame] | 2416 | #ifdef WLAN_FEATURE_HOST_ROAM |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2417 | static inline bool hdd_driver_roaming_supported(struct hdd_context *hdd_ctx) |
Srinivas Girigowda | 8df27ea | 2017-01-06 12:42:16 -0800 | [diff] [blame] | 2418 | { |
Srinivas Girigowda | a8f6658 | 2017-06-26 23:02:30 -0700 | [diff] [blame] | 2419 | return hdd_ctx->config->isFastRoamIniFeatureEnabled; |
Srinivas Girigowda | 8df27ea | 2017-01-06 12:42:16 -0800 | [diff] [blame] | 2420 | } |
| 2421 | #else |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2422 | static inline bool hdd_driver_roaming_supported(struct hdd_context *hdd_ctx) |
Srinivas Girigowda | 8df27ea | 2017-01-06 12:42:16 -0800 | [diff] [blame] | 2423 | { |
| 2424 | return false; |
| 2425 | } |
| 2426 | #endif |
| 2427 | |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2428 | static inline bool hdd_roaming_supported(struct hdd_context *hdd_ctx) |
Srinivas Girigowda | 8df27ea | 2017-01-06 12:42:16 -0800 | [diff] [blame] | 2429 | { |
| 2430 | bool val; |
| 2431 | |
| 2432 | val = hdd_driver_roaming_supported(hdd_ctx) || |
Srinivas Girigowda | a8f6658 | 2017-06-26 23:02:30 -0700 | [diff] [blame] | 2433 | roaming_offload_enabled(hdd_ctx); |
Srinivas Girigowda | 8df27ea | 2017-01-06 12:42:16 -0800 | [diff] [blame] | 2434 | |
| 2435 | return val; |
| 2436 | } |
| 2437 | |
| 2438 | #ifdef CFG80211_SCAN_RANDOM_MAC_ADDR |
| 2439 | static inline bool hdd_scan_random_mac_addr_supported(void) |
| 2440 | { |
| 2441 | return true; |
| 2442 | } |
| 2443 | #else |
| 2444 | static inline bool hdd_scan_random_mac_addr_supported(void) |
| 2445 | { |
| 2446 | return false; |
| 2447 | } |
| 2448 | #endif |
| 2449 | |
Himanshu Agarwal | dfc4dca | 2017-08-29 19:49:05 +0530 | [diff] [blame] | 2450 | /** |
| 2451 | * hdd_start_vendor_acs(): Start vendor ACS procedure |
| 2452 | * @adapter: pointer to SAP adapter struct |
| 2453 | * |
| 2454 | * This function sends the ACS config to the ACS daemon and |
| 2455 | * starts the vendor ACS timer to wait for the next command. |
| 2456 | * |
| 2457 | * Return: Status of vendor ACS procedure |
| 2458 | */ |
| 2459 | int hdd_start_vendor_acs(struct hdd_adapter *adapter); |
| 2460 | |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2461 | void hdd_get_fw_version(struct hdd_context *hdd_ctx, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2462 | uint32_t *major_spid, uint32_t *minor_spid, |
| 2463 | uint32_t *siid, uint32_t *crmid); |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2464 | /** |
| 2465 | * hdd_acs_response_timeout_handler() - timeout handler for acs_timer |
| 2466 | * @context : timeout handler context |
| 2467 | * |
| 2468 | * Return: None |
| 2469 | */ |
| 2470 | void hdd_acs_response_timeout_handler(void *context); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2471 | |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2472 | /** |
| 2473 | * wlan_hdd_cfg80211_start_acs(): Start ACS Procedure for SAP |
| 2474 | * @adapter: pointer to SAP adapter struct |
| 2475 | * |
| 2476 | * This function starts the ACS procedure if there are no |
| 2477 | * constraints like MBSSID DFS restrictions. |
| 2478 | * |
| 2479 | * Return: Status of ACS Start procedure |
| 2480 | */ |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2481 | int wlan_hdd_cfg80211_start_acs(struct hdd_adapter *adapter); |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2482 | |
| 2483 | /** |
| 2484 | * hdd_cfg80211_update_acs_config() - update acs config to application |
| 2485 | * @adapter: hdd adapter |
| 2486 | * @reason: channel change reason |
| 2487 | * |
Himanshu Agarwal | dfc4dca | 2017-08-29 19:49:05 +0530 | [diff] [blame] | 2488 | * Return: 0 for success else error code |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2489 | */ |
Himanshu Agarwal | dfc4dca | 2017-08-29 19:49:05 +0530 | [diff] [blame] | 2490 | int hdd_cfg80211_update_acs_config(struct hdd_adapter *adapter, |
| 2491 | uint8_t reason); |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 2492 | |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2493 | /** |
| 2494 | * hdd_update_acs_timer_reason() - update acs timer start reason |
| 2495 | * @adapter: hdd adapter |
| 2496 | * @reason: channel change reason |
| 2497 | * |
| 2498 | * Return: 0 for success |
| 2499 | */ |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2500 | int hdd_update_acs_timer_reason(struct hdd_adapter *adapter, uint8_t reason); |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2501 | |
| 2502 | /** |
Tushnim Bhattacharyya | 9e81b4c | 2017-02-15 17:11:14 -0800 | [diff] [blame] | 2503 | * hdd_switch_sap_channel() - Move SAP to the given channel |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2504 | * @adapter: AP adapter |
| 2505 | * @channel: Channel |
Min Liu | 2fef579 | 2018-01-19 17:59:42 +0800 | [diff] [blame] | 2506 | * @forced: Force to switch channel, ignore SCC/MCC check |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2507 | * |
Tushnim Bhattacharyya | 9e81b4c | 2017-02-15 17:11:14 -0800 | [diff] [blame] | 2508 | * Moves the SAP interface by invoking the function which |
| 2509 | * executes the callback to perform channel switch using (E)CSA. |
Kapil Gupta | 8878ad9 | 2017-02-13 11:56:04 +0530 | [diff] [blame] | 2510 | * |
| 2511 | * Return: None |
| 2512 | */ |
Min Liu | 2fef579 | 2018-01-19 17:59:42 +0800 | [diff] [blame] | 2513 | void hdd_switch_sap_channel(struct hdd_adapter *adapter, uint8_t channel, |
| 2514 | bool forced); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2515 | |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 2516 | #if defined(FEATURE_WLAN_CH_AVOID) |
| 2517 | void hdd_unsafe_channel_restart_sap(struct hdd_context *hdd_ctx); |
| 2518 | |
| 2519 | void hdd_ch_avoid_ind(struct hdd_context *hdd_ctxt, |
| 2520 | struct unsafe_ch_list *unsafe_chan_list, |
| 2521 | struct ch_avoid_ind_type *avoid_freq_list); |
| 2522 | #else |
| 2523 | static inline |
| 2524 | void hdd_unsafe_channel_restart_sap(struct hdd_context *hdd_ctx) |
| 2525 | { |
| 2526 | } |
| 2527 | |
| 2528 | static inline |
| 2529 | void hdd_ch_avoid_ind(struct hdd_context *hdd_ctxt, |
| 2530 | struct unsafe_ch_list *unsafe_chan_list, |
| 2531 | struct ch_avoid_ind_type *avoid_freq_list) |
| 2532 | { |
| 2533 | } |
| 2534 | #endif |
| 2535 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2536 | void hdd_update_macaddr(struct hdd_config *config, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 2537 | struct qdf_mac_addr hw_macaddr); |
Padma, Santhosh Kumar | 86747ec | 2018-05-29 18:28:29 +0530 | [diff] [blame] | 2538 | |
| 2539 | /** |
| 2540 | * wlan_hdd_disable_roaming() - disable roaming on all STAs except the input one |
| 2541 | * @cur_adapter: Current HDD adapter passed from caller |
| 2542 | * |
| 2543 | * This function loops through all adapters and disables roaming on each STA |
| 2544 | * mode adapter except the current adapter passed from the caller |
| 2545 | * |
| 2546 | * Return: None |
| 2547 | */ |
| 2548 | void wlan_hdd_disable_roaming(struct hdd_adapter *cur_adapter); |
| 2549 | |
| 2550 | /** |
| 2551 | * wlan_hdd_enable_roaming() - enable roaming on all STAs except the input one |
| 2552 | * @cur_adapter: Current HDD adapter passed from caller |
| 2553 | * |
| 2554 | * This function loops through all adapters and enables roaming on each STA |
| 2555 | * mode adapter except the current adapter passed from the caller |
| 2556 | * |
| 2557 | * Return: None |
| 2558 | */ |
| 2559 | void wlan_hdd_enable_roaming(struct hdd_adapter *cur_adapter); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2560 | |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2561 | QDF_STATUS hdd_post_cds_enable_config(struct hdd_context *hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2562 | |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2563 | QDF_STATUS hdd_abort_mac_scan_all_adapters(struct hdd_context *hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2564 | |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2565 | QDF_STATUS |
| 2566 | wlan_hdd_check_custom_con_channel_rules(struct hdd_adapter *sta_adapter, |
| 2567 | struct hdd_adapter *ap_adapter, |
Jeff Johnson | 61b5e98 | 2018-03-15 11:33:31 -0700 | [diff] [blame] | 2568 | struct csr_roam_profile *roam_profile, |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2569 | tScanResultHandle *scan_cache, |
| 2570 | bool *concurrent_chnl_same); |
| 2571 | |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2572 | void wlan_hdd_stop_sap(struct hdd_adapter *ap_adapter); |
| 2573 | void wlan_hdd_start_sap(struct hdd_adapter *ap_adapter, bool reinit); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2574 | |
| 2575 | #ifdef QCA_CONFIG_SMP |
| 2576 | int wlan_hdd_get_cpu(void); |
| 2577 | #else |
| 2578 | static inline int wlan_hdd_get_cpu(void) |
| 2579 | { |
| 2580 | return 0; |
| 2581 | } |
| 2582 | #endif |
| 2583 | |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 2584 | void wlan_hdd_sap_pre_cac_failure(void *data); |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2585 | void hdd_clean_up_pre_cac_interface(struct hdd_context *hdd_ctx); |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 2586 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2587 | void wlan_hdd_txrx_pause_cb(uint8_t vdev_id, |
| 2588 | enum netif_action_type action, enum netif_reason_type reason); |
| 2589 | |
Ajit Pal Singh | 106c141 | 2018-04-18 18:08:49 +0530 | [diff] [blame] | 2590 | #ifdef QCA_HL_NETDEV_FLOW_CONTROL |
| 2591 | void wlan_hdd_mod_fc_timer(struct hdd_adapter *adapter, |
| 2592 | enum netif_action_type action); |
| 2593 | #else |
| 2594 | static inline void wlan_hdd_mod_fc_timer(struct hdd_adapter *adapter, |
| 2595 | enum netif_action_type action) |
| 2596 | { |
| 2597 | } |
| 2598 | #endif /* QCA_HL_NETDEV_FLOW_CONTROL */ |
| 2599 | |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2600 | int hdd_wlan_dump_stats(struct hdd_adapter *adapter, int value); |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2601 | void wlan_hdd_deinit_tx_rx_histogram(struct hdd_context *hdd_ctx); |
Jeff Johnson | 58adbcf | 2017-09-03 08:53:31 -0700 | [diff] [blame] | 2602 | void wlan_hdd_display_tx_rx_histogram(struct hdd_context *hdd_ctx); |
| 2603 | void wlan_hdd_clear_tx_rx_histogram(struct hdd_context *hdd_ctx); |
Mohit Khanna | 7032200 | 2018-05-15 19:21:32 -0700 | [diff] [blame] | 2604 | |
Mohit Khanna | ca4173b | 2017-09-12 21:52:19 -0700 | [diff] [blame] | 2605 | void |
| 2606 | wlan_hdd_display_netif_queue_history(struct hdd_context *hdd_ctx, |
| 2607 | enum qdf_stats_verbosity_level verb_lvl); |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2608 | void wlan_hdd_clear_netif_queue_history(struct hdd_context *hdd_ctx); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 2609 | const char *hdd_get_fwpath(void); |
Abhishek Singh | 7996eb7 | 2015-12-30 17:24:02 +0530 | [diff] [blame] | 2610 | void hdd_indicate_mgmt_frame(tSirSmeMgmtFrameInd *frame_ind); |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2611 | |
| 2612 | struct hdd_adapter * |
| 2613 | hdd_get_adapter_by_sme_session_id(struct hdd_context *hdd_ctx, |
| 2614 | uint32_t sme_session_id); |
| 2615 | |
Naveen Rawat | 4edb682 | 2017-04-12 10:09:17 -0700 | [diff] [blame] | 2616 | /** |
| 2617 | * hdd_get_adapter_by_iface_name() - Return adapter with given interface name |
| 2618 | * @hdd_ctx: hdd context. |
| 2619 | * @iface_name: interface name |
| 2620 | * |
| 2621 | * This function is used to get the adapter with given interface name |
| 2622 | * |
| 2623 | * Return: adapter pointer if found, NULL otherwise |
| 2624 | * |
| 2625 | */ |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2626 | struct hdd_adapter *hdd_get_adapter_by_iface_name(struct hdd_context *hdd_ctx, |
Naveen Rawat | 4edb682 | 2017-04-12 10:09:17 -0700 | [diff] [blame] | 2627 | const char *iface_name); |
Kiran Kumar Lokere | 1364467 | 2016-02-29 15:40:10 -0800 | [diff] [blame] | 2628 | enum phy_ch_width hdd_map_nl_chan_width(enum nl80211_chan_width ch_width); |
Jeff Johnson | 1652836 | 2018-06-14 12:34:16 -0700 | [diff] [blame] | 2629 | |
| 2630 | /** |
Dustin Brown | 56377e1 | 2018-10-10 17:04:04 -0700 | [diff] [blame] | 2631 | * hdd_nl_to_qdf_iface_type() - map nl80211_iftype to QDF_OPMODE |
| 2632 | * @nl_type: the input NL80211 interface type to map |
| 2633 | * @out_qdf_type: the output, equivalent QDF operating mode |
| 2634 | * |
| 2635 | * Return: QDF_STATUS |
| 2636 | */ |
| 2637 | QDF_STATUS hdd_nl_to_qdf_iface_type(enum nl80211_iftype nl_type, |
| 2638 | enum QDF_OPMODE *out_qdf_type); |
| 2639 | |
| 2640 | /** |
Jeff Johnson | 1652836 | 2018-06-14 12:34:16 -0700 | [diff] [blame] | 2641 | * wlan_hdd_find_opclass() - Find operating class for a channel |
| 2642 | * @mac_handle: global MAC handle |
| 2643 | * @channel: channel id |
| 2644 | * @bw_offset: bandwidth offset |
| 2645 | * |
| 2646 | * Function invokes sme api to find the operating class |
| 2647 | * |
| 2648 | * Return: operating class |
| 2649 | */ |
| 2650 | uint8_t wlan_hdd_find_opclass(mac_handle_t mac_handle, uint8_t channel, |
| 2651 | uint8_t bw_offset); |
| 2652 | |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2653 | int hdd_update_config(struct hdd_context *hdd_ctx); |
Dhanashri Atre | 83d373d | 2015-07-28 16:45:59 -0700 | [diff] [blame] | 2654 | |
Mukul Sharma | 9d797a0 | 2017-01-05 20:26:03 +0530 | [diff] [blame] | 2655 | /** |
| 2656 | * hdd_update_components_config() - Initialize driver per module ini parameters |
| 2657 | * @hdd_ctx: HDD Context |
| 2658 | * |
| 2659 | * API is used to initialize components configuration parameters |
| 2660 | * Return: 0 for success, errno for failure |
| 2661 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2662 | int hdd_update_components_config(struct hdd_context *hdd_ctx); |
Mukul Sharma | 9d797a0 | 2017-01-05 20:26:03 +0530 | [diff] [blame] | 2663 | |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2664 | QDF_STATUS hdd_chan_change_notify(struct hdd_adapter *adapter, |
Manishekar Chandrasekaran | ec26759 | 2016-05-26 19:10:04 +0530 | [diff] [blame] | 2665 | struct net_device *dev, |
bings | 58ce862 | 2017-07-10 15:55:36 +0800 | [diff] [blame] | 2666 | struct hdd_chan_change_params chan_change, |
| 2667 | bool legacy_phymode); |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 2668 | int wlan_hdd_set_channel(struct wiphy *wiphy, |
| 2669 | struct net_device *dev, |
| 2670 | struct cfg80211_chan_def *chandef, |
| 2671 | enum nl80211_channel_type channel_type); |
Jeff Johnson | 9c4f93d | 2017-10-04 08:56:22 -0700 | [diff] [blame] | 2672 | int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter, |
Manishekar Chandrasekaran | 9e8c7be | 2016-08-03 14:57:14 +0530 | [diff] [blame] | 2673 | struct cfg80211_beacon_data *params, |
| 2674 | const u8 *ssid, size_t ssid_len, |
| 2675 | enum nl80211_hidden_ssid hidden_ssid, |
Mahesh Kumar Kalikot Veetil | c637fc9 | 2017-09-27 16:06:21 -0700 | [diff] [blame] | 2676 | bool check_for_concurrency); |
Chandrasekaran Manishekar | cde33d7 | 2016-04-14 19:03:39 +0530 | [diff] [blame] | 2677 | |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 2678 | #if !defined(REMOVE_PKT_LOG) |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2679 | int hdd_process_pktlog_command(struct hdd_context *hdd_ctx, uint32_t set_value, |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 2680 | int set_value2); |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2681 | int hdd_pktlog_enable_disable(struct hdd_context *hdd_ctx, bool enable, |
Poddar, Siddarth | 176c436 | 2016-10-03 12:25:00 +0530 | [diff] [blame] | 2682 | uint8_t user_triggered, int size); |
| 2683 | |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 2684 | #else |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2685 | static inline |
| 2686 | int hdd_pktlog_enable_disable(struct hdd_context *hdd_ctx, bool enable, |
| 2687 | uint8_t user_triggered, int size) |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 2688 | { |
| 2689 | return 0; |
| 2690 | } |
Jeff Johnson | 6dff3ee | 2017-10-06 14:58:57 -0700 | [diff] [blame] | 2691 | |
| 2692 | static inline |
| 2693 | int hdd_process_pktlog_command(struct hdd_context *hdd_ctx, |
| 2694 | uint32_t set_value, int set_value2) |
Srinivas Girigowda | c34f11d | 2016-02-25 16:02:42 -0800 | [diff] [blame] | 2695 | { |
| 2696 | return 0; |
| 2697 | } |
| 2698 | #endif /* REMOVE_PKT_LOG */ |
| 2699 | |
Dhanashri Atre | 83d373d | 2015-07-28 16:45:59 -0700 | [diff] [blame] | 2700 | #ifdef FEATURE_TSO |
| 2701 | /** |
| 2702 | * hdd_set_tso_flags() - enable TSO flags in the network device |
| 2703 | * @hdd_ctx: HDD context |
| 2704 | * @wlan_dev: network device structure |
| 2705 | * |
| 2706 | * This function enables the TSO related feature flags in the |
| 2707 | * given network device. |
| 2708 | * |
| 2709 | * Return: none |
| 2710 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2711 | static inline void hdd_set_tso_flags(struct hdd_context *hdd_ctx, |
Dhanashri Atre | 83d373d | 2015-07-28 16:45:59 -0700 | [diff] [blame] | 2712 | struct net_device *wlan_dev) |
| 2713 | { |
Mohit Khanna | 816e653 | 2016-12-09 15:28:21 -0800 | [diff] [blame] | 2714 | if (hdd_ctx->config->tso_enable && |
| 2715 | hdd_ctx->config->enable_ip_tcp_udp_checksum_offload) { |
| 2716 | /* |
| 2717 | * We want to enable TSO only if IP/UDP/TCP TX checksum flag is |
| 2718 | * enabled. |
| 2719 | */ |
Dustin Brown | 7e761c7 | 2018-07-31 13:50:17 -0700 | [diff] [blame] | 2720 | hdd_debug("TSO Enabled"); |
Dhanashri Atre | 83d373d | 2015-07-28 16:45:59 -0700 | [diff] [blame] | 2721 | wlan_dev->features |= |
| 2722 | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | |
| 2723 | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG; |
| 2724 | } |
| 2725 | } |
| 2726 | #else |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2727 | static inline void hdd_set_tso_flags(struct hdd_context *hdd_ctx, |
Dhanashri Atre | 83d373d | 2015-07-28 16:45:59 -0700 | [diff] [blame] | 2728 | struct net_device *wlan_dev){} |
| 2729 | #endif /* FEATURE_TSO */ |
Varun Reddy Yeturu | bbbbe23 | 2016-02-29 14:01:57 -0800 | [diff] [blame] | 2730 | |
Rajeev Kumar | 94c9b45 | 2016-03-24 12:58:47 -0700 | [diff] [blame] | 2731 | void hdd_get_ibss_peer_info_cb(void *pUserData, |
| 2732 | tSirPeerInfoRspParams *pPeerInfo); |
| 2733 | |
Ryan Hsu | ceddceb | 2016-04-28 10:20:14 -0700 | [diff] [blame] | 2734 | #ifdef CONFIG_CNSS_LOGGER |
| 2735 | /** |
| 2736 | * wlan_hdd_nl_init() - wrapper function to CNSS_LOGGER case |
| 2737 | * @hdd_ctx: the hdd context pointer |
| 2738 | * |
| 2739 | * The nl_srv_init() will call to cnss_logger_device_register() and |
| 2740 | * expect to get a radio_index from cnss_logger module and assign to |
| 2741 | * hdd_ctx->radio_index, then to maintain the consistency to original |
| 2742 | * design, adding the radio_index check here, then return the error |
| 2743 | * code if radio_index is not assigned correctly, which means the nl_init |
| 2744 | * from cnss_logger is failed. |
| 2745 | * |
| 2746 | * Return: 0 if successfully, otherwise error code |
| 2747 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2748 | static inline int wlan_hdd_nl_init(struct hdd_context *hdd_ctx) |
Ryan Hsu | ceddceb | 2016-04-28 10:20:14 -0700 | [diff] [blame] | 2749 | { |
| 2750 | hdd_ctx->radio_index = nl_srv_init(hdd_ctx->wiphy); |
| 2751 | |
| 2752 | /* radio_index is assigned from 0, so only >=0 will be valid index */ |
| 2753 | if (hdd_ctx->radio_index >= 0) |
| 2754 | return 0; |
| 2755 | else |
| 2756 | return -EINVAL; |
| 2757 | } |
| 2758 | #else |
| 2759 | /** |
| 2760 | * wlan_hdd_nl_init() - wrapper function to non CNSS_LOGGER case |
| 2761 | * @hdd_ctx: the hdd context pointer |
| 2762 | * |
| 2763 | * In case of non CNSS_LOGGER case, the nl_srv_init() will initialize |
| 2764 | * the netlink socket and return the success or not. |
| 2765 | * |
| 2766 | * Return: the return value from nl_srv_init() |
| 2767 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2768 | static inline int wlan_hdd_nl_init(struct hdd_context *hdd_ctx) |
Ryan Hsu | ceddceb | 2016-04-28 10:20:14 -0700 | [diff] [blame] | 2769 | { |
| 2770 | return nl_srv_init(hdd_ctx->wiphy); |
| 2771 | } |
| 2772 | #endif |
Pragaspathi Thilagaraj | 3551caa | 2018-09-26 15:52:56 +0530 | [diff] [blame] | 2773 | QDF_STATUS hdd_sme_open_session_callback(uint8_t session_id, |
| 2774 | QDF_STATUS qdf_status); |
Krunal Soni | b51eec7 | 2017-11-20 21:53:01 -0800 | [diff] [blame] | 2775 | QDF_STATUS hdd_sme_close_session_callback(uint8_t session_id); |
Deepak Dhamdhere | 5cdce84 | 2016-05-31 10:39:12 -0700 | [diff] [blame] | 2776 | |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2777 | int hdd_reassoc(struct hdd_adapter *adapter, const uint8_t *bssid, |
Deepak Dhamdhere | 5a36a4a | 2016-11-12 15:08:22 -0800 | [diff] [blame] | 2778 | uint8_t channel, const handoff_src src); |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2779 | int hdd_register_cb(struct hdd_context *hdd_ctx); |
| 2780 | void hdd_deregister_cb(struct hdd_context *hdd_ctx); |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2781 | int hdd_start_station_adapter(struct hdd_adapter *adapter); |
| 2782 | int hdd_start_ap_adapter(struct hdd_adapter *adapter); |
Dustin Brown | e7e71d3 | 2018-05-11 16:00:08 -0700 | [diff] [blame] | 2783 | int hdd_configure_cds(struct hdd_context *hdd_ctx); |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2784 | int hdd_set_fw_params(struct hdd_adapter *adapter); |
Dustin Brown | e7e71d3 | 2018-05-11 16:00:08 -0700 | [diff] [blame] | 2785 | int hdd_wlan_start_modules(struct hdd_context *hdd_ctx, bool reinit); |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2786 | int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode); |
Dustin Brown | 4c66322 | 2018-10-23 14:19:36 -0700 | [diff] [blame] | 2787 | |
| 2788 | /** |
| 2789 | * hdd_psoc_idle_timer_start() - start the idle psoc detection timer |
| 2790 | * @hdd_ctx: the hdd context for which the timer should be started |
| 2791 | * |
| 2792 | * Return: None |
| 2793 | */ |
| 2794 | void hdd_psoc_idle_timer_start(struct hdd_context *hdd_ctx); |
| 2795 | |
| 2796 | /** |
| 2797 | * hdd_psoc_idle_timer_stop() - stop the idle psoc detection timer |
| 2798 | * @hdd_ctx: the hdd context for which the timer should be stopped |
| 2799 | * |
| 2800 | * Return: None |
| 2801 | */ |
| 2802 | void hdd_psoc_idle_timer_stop(struct hdd_context *hdd_ctx); |
| 2803 | |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2804 | int hdd_start_adapter(struct hdd_adapter *adapter); |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2805 | void hdd_populate_random_mac_addr(struct hdd_context *hdd_ctx, uint32_t num); |
yeshwanth sriram guntuka | ea63f63 | 2017-08-30 19:31:56 +0530 | [diff] [blame] | 2806 | /** |
| 2807 | * hdd_is_interface_up()- Checkfor interface up before ssr |
| 2808 | * @hdd_ctx: HDD context |
| 2809 | * |
| 2810 | * check if there are any wlan interfaces before SSR accordingly start |
| 2811 | * the interface. |
| 2812 | * |
| 2813 | * Return: 0 if interface was opened else false |
| 2814 | */ |
| 2815 | bool hdd_is_interface_up(struct hdd_adapter *adapter); |
Abhishek Singh | b5e38ef | 2017-01-02 12:09:34 +0530 | [diff] [blame] | 2816 | /** |
| 2817 | * hdd_get_bss_entry() - Get the bss entry matching the chan, bssid and ssid |
| 2818 | * @wiphy: wiphy |
| 2819 | * @channel: channel of the BSS to find |
| 2820 | * @bssid: bssid of the BSS to find |
| 2821 | * @ssid: ssid of the BSS to find |
| 2822 | * @ssid_len: ssid len of of the BSS to find |
| 2823 | * |
| 2824 | * The API is a wrapper to get bss from kernel matching the chan, |
| 2825 | * bssid and ssid |
| 2826 | * |
| 2827 | * Return: bss structure if found else NULL |
| 2828 | */ |
| 2829 | struct cfg80211_bss *hdd_cfg80211_get_bss(struct wiphy *wiphy, |
| 2830 | struct ieee80211_channel *channel, |
| 2831 | const u8 *bssid, |
| 2832 | const u8 *ssid, size_t ssid_len); |
| 2833 | |
Anurag Chouhan | c409292 | 2016-09-08 15:56:11 +0530 | [diff] [blame] | 2834 | void hdd_connect_result(struct net_device *dev, const u8 *bssid, |
Jeff Johnson | 172237b | 2017-11-07 15:32:59 -0800 | [diff] [blame] | 2835 | struct csr_roam_info *roam_info, const u8 *req_ie, |
Anurag Chouhan | c409292 | 2016-09-08 15:56:11 +0530 | [diff] [blame] | 2836 | size_t req_ie_len, const u8 *resp_ie, |
Abhishek Singh | a84d395 | 2016-09-13 13:45:05 +0530 | [diff] [blame] | 2837 | size_t resp_ie_len, u16 status, gfp_t gfp, |
yeshwanth sriram guntuka | af7b73f | 2017-02-22 17:35:32 +0530 | [diff] [blame] | 2838 | bool connect_timeout, |
| 2839 | tSirResultCodes timeout_reason); |
Anurag Chouhan | c409292 | 2016-09-08 15:56:11 +0530 | [diff] [blame] | 2840 | |
Arun Khandavalli | fae9294 | 2016-08-01 13:31:08 +0530 | [diff] [blame] | 2841 | #ifdef WLAN_FEATURE_FASTPATH |
| 2842 | void hdd_enable_fastpath(struct hdd_config *hdd_cfg, |
| 2843 | void *context); |
| 2844 | #else |
| 2845 | static inline void hdd_enable_fastpath(struct hdd_config *hdd_cfg, |
| 2846 | void *context) |
| 2847 | { |
| 2848 | } |
| 2849 | #endif |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2850 | void hdd_wlan_update_target_info(struct hdd_context *hdd_ctx, void *context); |
Nirav Shah | eb017be | 2018-02-15 11:20:58 +0530 | [diff] [blame] | 2851 | |
Agrawal Ashish | 6563461 | 2016-08-18 13:24:32 +0530 | [diff] [blame] | 2852 | enum sap_acs_dfs_mode wlan_hdd_get_dfs_mode(enum dfs_mode mode); |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2853 | void hdd_unsafe_channel_restart_sap(struct hdd_context *hdd_ctx); |
Liangwei Dong | 6e1a209 | 2017-08-30 16:29:06 +0800 | [diff] [blame] | 2854 | /** |
| 2855 | * hdd_clone_local_unsafe_chan() - clone hdd ctx unsafe chan list |
| 2856 | * @hdd_ctx: hdd context pointer |
| 2857 | * @local_unsafe_list: copied unsafe chan list array |
| 2858 | * @local_unsafe_list_count: channel number in returned local_unsafe_list |
| 2859 | * |
| 2860 | * The function will allocate memory and make a copy the current unsafe |
| 2861 | * channels from hdd ctx. The caller need to free the local_unsafe_list |
| 2862 | * memory after use. |
| 2863 | * |
| 2864 | * Return: 0 if successfully clone unsafe chan list. |
| 2865 | */ |
| 2866 | int hdd_clone_local_unsafe_chan(struct hdd_context *hdd_ctx, |
| 2867 | uint16_t **local_unsafe_list, uint16_t *local_unsafe_list_count); |
| 2868 | |
| 2869 | /** |
| 2870 | * hdd_local_unsafe_channel_updated() - check unsafe chan list same or not |
| 2871 | * @hdd_ctx: hdd context pointer |
| 2872 | * @local_unsafe_list: unsafe chan list to be compared with hdd_ctx's list |
| 2873 | * @local_unsafe_list_count: channel number in local_unsafe_list |
| 2874 | * |
| 2875 | * The function checked the input channel is same as current unsafe chan |
| 2876 | * list in hdd_ctx. |
| 2877 | * |
| 2878 | * Return: true if input channel list is same as the list in hdd_ctx |
| 2879 | */ |
| 2880 | bool hdd_local_unsafe_channel_updated(struct hdd_context *hdd_ctx, |
| 2881 | uint16_t *local_unsafe_list, uint16_t local_unsafe_list_count); |
| 2882 | |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2883 | int hdd_enable_disable_ca_event(struct hdd_context *hddctx, |
Selvaraj, Sridhar | ebda0f2 | 2016-08-29 16:05:23 +0530 | [diff] [blame] | 2884 | uint8_t set_value); |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2885 | void wlan_hdd_undo_acs(struct hdd_adapter *adapter); |
Dustin Brown | bb7e2f5 | 2016-10-17 12:16:35 -0700 | [diff] [blame] | 2886 | |
| 2887 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)) |
| 2888 | static inline int |
| 2889 | hdd_wlan_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) |
| 2890 | { |
| 2891 | return nla_put_u64(skb, attrtype, value); |
| 2892 | } |
| 2893 | #else |
| 2894 | static inline int |
| 2895 | hdd_wlan_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) |
| 2896 | { |
| 2897 | return nla_put_u64_64bit(skb, attrtype, value, NL80211_ATTR_PAD); |
| 2898 | } |
| 2899 | #endif |
| 2900 | |
Jeff Johnson | 57e0751 | 2018-03-13 09:16:33 -0700 | [diff] [blame] | 2901 | /** |
| 2902 | * hdd_roam_profile() - Get adapter's roam profile |
| 2903 | * @adapter: The adapter being queried |
| 2904 | * |
| 2905 | * Given an adapter this function returns a pointer to its roam profile. |
| 2906 | * |
| 2907 | * NOTE WELL: Caller is responsible for ensuring this interface is only |
| 2908 | * invoked for STA-type interfaces |
| 2909 | * |
| 2910 | * Return: pointer to the adapter's roam profile |
| 2911 | */ |
| 2912 | static inline |
| 2913 | struct csr_roam_profile *hdd_roam_profile(struct hdd_adapter *adapter) |
| 2914 | { |
Jeff Johnson | fd9928a | 2018-03-19 15:17:29 -0700 | [diff] [blame] | 2915 | struct hdd_station_ctx *sta_ctx; |
Jeff Johnson | 57e0751 | 2018-03-13 09:16:33 -0700 | [diff] [blame] | 2916 | |
Jeff Johnson | fd9928a | 2018-03-19 15:17:29 -0700 | [diff] [blame] | 2917 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | 57e0751 | 2018-03-13 09:16:33 -0700 | [diff] [blame] | 2918 | |
Jeff Johnson | fd9928a | 2018-03-19 15:17:29 -0700 | [diff] [blame] | 2919 | return &sta_ctx->roam_profile; |
Jeff Johnson | 57e0751 | 2018-03-13 09:16:33 -0700 | [diff] [blame] | 2920 | } |
| 2921 | |
| 2922 | /** |
| 2923 | * hdd_security_ie() - Get adapter's security IE |
| 2924 | * @adapter: The adapter being queried |
| 2925 | * |
| 2926 | * Given an adapter this function returns a pointer to its security IE |
| 2927 | * buffer. Note that this buffer is maintained outside the roam |
| 2928 | * profile but, when in use, is referenced by a pointer within the |
| 2929 | * roam profile. |
| 2930 | * |
| 2931 | * NOTE WELL: Caller is responsible for ensuring this interface is only |
| 2932 | * invoked for STA-type interfaces |
| 2933 | * |
| 2934 | * Return: pointer to the adapter's roam profile security IE buffer |
| 2935 | */ |
| 2936 | static inline |
| 2937 | uint8_t *hdd_security_ie(struct hdd_adapter *adapter) |
| 2938 | { |
Jeff Johnson | fd9928a | 2018-03-19 15:17:29 -0700 | [diff] [blame] | 2939 | struct hdd_station_ctx *sta_ctx; |
Jeff Johnson | 57e0751 | 2018-03-13 09:16:33 -0700 | [diff] [blame] | 2940 | |
Jeff Johnson | fd9928a | 2018-03-19 15:17:29 -0700 | [diff] [blame] | 2941 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | 57e0751 | 2018-03-13 09:16:33 -0700 | [diff] [blame] | 2942 | |
Jeff Johnson | fd9928a | 2018-03-19 15:17:29 -0700 | [diff] [blame] | 2943 | return sta_ctx->security_ie; |
Jeff Johnson | 57e0751 | 2018-03-13 09:16:33 -0700 | [diff] [blame] | 2944 | } |
| 2945 | |
| 2946 | /** |
| 2947 | * hdd_assoc_additional_ie() - Get adapter's assoc additional IE |
| 2948 | * @adapter: The adapter being queried |
| 2949 | * |
| 2950 | * Given an adapter this function returns a pointer to its assoc |
| 2951 | * additional IE buffer. Note that this buffer is maintained outside |
| 2952 | * the roam profile but, when in use, is referenced by a pointer |
| 2953 | * within the roam profile. |
| 2954 | * |
| 2955 | * NOTE WELL: Caller is responsible for ensuring this interface is only |
| 2956 | * invoked for STA-type interfaces |
| 2957 | * |
| 2958 | * Return: pointer to the adapter's assoc additional IE buffer |
| 2959 | */ |
| 2960 | static inline |
| 2961 | tSirAddie *hdd_assoc_additional_ie(struct hdd_adapter *adapter) |
| 2962 | { |
Jeff Johnson | fd9928a | 2018-03-19 15:17:29 -0700 | [diff] [blame] | 2963 | struct hdd_station_ctx *sta_ctx; |
Jeff Johnson | 57e0751 | 2018-03-13 09:16:33 -0700 | [diff] [blame] | 2964 | |
Jeff Johnson | fd9928a | 2018-03-19 15:17:29 -0700 | [diff] [blame] | 2965 | sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); |
Jeff Johnson | 57e0751 | 2018-03-13 09:16:33 -0700 | [diff] [blame] | 2966 | |
Jeff Johnson | fd9928a | 2018-03-19 15:17:29 -0700 | [diff] [blame] | 2967 | return &sta_ctx->assoc_additional_ie; |
Jeff Johnson | 57e0751 | 2018-03-13 09:16:33 -0700 | [diff] [blame] | 2968 | } |
| 2969 | |
Padma, Santhosh Kumar | 86747ec | 2018-05-29 18:28:29 +0530 | [diff] [blame] | 2970 | /** |
| 2971 | * hdd_is_roaming_in_progress() - check if roaming is in progress |
| 2972 | * @hdd_ctx - Global HDD context |
| 2973 | * |
| 2974 | * Checks if roaming is in progress on any of the adapters |
| 2975 | * |
| 2976 | * Return: true if roaming is in progress else false |
| 2977 | */ |
| 2978 | bool hdd_is_roaming_in_progress(struct hdd_context *hdd_ctx); |
Varun Reddy Yeturu | dce1c56 | 2016-11-18 10:00:45 -0800 | [diff] [blame] | 2979 | void hdd_set_roaming_in_progress(bool value); |
Tushnim Bhattacharyya | 9e81b4c | 2017-02-15 17:11:14 -0800 | [diff] [blame] | 2980 | bool hdd_is_connection_in_progress(uint8_t *session_id, |
| 2981 | enum scan_reject_states *reason); |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 2982 | void hdd_restart_sap(struct hdd_adapter *ap_adapter); |
Tushnim Bhattacharyya | 9e81b4c | 2017-02-15 17:11:14 -0800 | [diff] [blame] | 2983 | void hdd_check_and_restart_sap_with_non_dfs_acs(void); |
| 2984 | bool hdd_set_connection_in_progress(bool value); |
Varun Reddy Yeturu | dce1c56 | 2016-11-18 10:00:45 -0800 | [diff] [blame] | 2985 | |
Kapil Gupta | 94ca6f6 | 2016-12-11 18:43:12 +0530 | [diff] [blame] | 2986 | /** |
Kapil Gupta | 4f0c0c1 | 2017-02-07 15:21:15 +0530 | [diff] [blame] | 2987 | * wlan_hdd_init_chan_info() - initialize channel info variables |
| 2988 | * @hdd_ctx: hdd ctx |
| 2989 | * |
| 2990 | * This API initialize channel info variables |
| 2991 | * |
| 2992 | * Return: None |
| 2993 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 2994 | void wlan_hdd_init_chan_info(struct hdd_context *hdd_ctx); |
Srinivas Girigowda | 85218af | 2017-03-25 13:21:40 -0700 | [diff] [blame] | 2995 | |
Kapil Gupta | 4f0c0c1 | 2017-02-07 15:21:15 +0530 | [diff] [blame] | 2996 | /** |
| 2997 | * wlan_hdd_deinit_chan_info() - deinitialize channel info variables |
| 2998 | * @hdd_ctx: hdd ctx |
| 2999 | * |
| 3000 | * This API deinitialize channel info variables |
| 3001 | * |
| 3002 | * Return: None |
| 3003 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 3004 | void wlan_hdd_deinit_chan_info(struct hdd_context *hdd_ctx); |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 3005 | void wlan_hdd_start_sap(struct hdd_adapter *ap_adapter, bool reinit); |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 3006 | |
Ashish Kumar Dhanotiya | 486c13a | 2017-03-03 12:57:56 +0530 | [diff] [blame] | 3007 | /** |
Dustin Brown | 4c66322 | 2018-10-23 14:19:36 -0700 | [diff] [blame] | 3008 | * hdd_is_any_interface_open() - Check for interface up |
Ashish Kumar Dhanotiya | 486c13a | 2017-03-03 12:57:56 +0530 | [diff] [blame] | 3009 | * @hdd_ctx: HDD context |
| 3010 | * |
Dustin Brown | 4c66322 | 2018-10-23 14:19:36 -0700 | [diff] [blame] | 3011 | * Return: true if any interface is open |
Ashish Kumar Dhanotiya | 486c13a | 2017-03-03 12:57:56 +0530 | [diff] [blame] | 3012 | */ |
Dustin Brown | 4c66322 | 2018-10-23 14:19:36 -0700 | [diff] [blame] | 3013 | bool hdd_is_any_interface_open(struct hdd_context *hdd_ctx); |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 3014 | |
| 3015 | #ifdef WIFI_POS_CONVERGED |
| 3016 | /** |
| 3017 | * hdd_send_peer_status_ind_to_app() - wrapper to call legacy or new wifi_pos |
| 3018 | * function to send peer status to a registered application |
| 3019 | * @peer_mac: MAC address of peer |
| 3020 | * @peer_status: ePeerConnected or ePeerDisconnected |
| 3021 | * @peer_timing_meas_cap: 0: RTT/RTT2, 1: RTT3. Default is 0 |
| 3022 | * @sessionId: SME session id, i.e. vdev_id |
| 3023 | * @chan_info: operating channel information |
| 3024 | * @dev_mode: dev mode for which indication is sent |
| 3025 | * |
| 3026 | * Return: none |
| 3027 | */ |
| 3028 | static inline void hdd_send_peer_status_ind_to_app( |
| 3029 | struct qdf_mac_addr *peer_mac, |
| 3030 | uint8_t peer_status, |
| 3031 | uint8_t peer_timing_meas_cap, |
| 3032 | uint8_t sessionId, |
| 3033 | tSirSmeChanInfo *chan_info, |
Jeff Johnson | c1e6278 | 2017-11-09 09:50:17 -0800 | [diff] [blame] | 3034 | enum QDF_OPMODE dev_mode) |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 3035 | { |
| 3036 | struct wifi_pos_ch_info ch_info; |
| 3037 | |
Naveen Rawat | 6877a24 | 2017-03-23 17:15:38 -0700 | [diff] [blame] | 3038 | if (!chan_info) { |
| 3039 | os_if_wifi_pos_send_peer_status(peer_mac, peer_status, |
| 3040 | peer_timing_meas_cap, sessionId, |
| 3041 | NULL, dev_mode); |
| 3042 | return; |
| 3043 | } |
| 3044 | |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 3045 | ch_info.chan_id = chan_info->chan_id; |
| 3046 | ch_info.mhz = chan_info->mhz; |
| 3047 | ch_info.band_center_freq1 = chan_info->band_center_freq1; |
| 3048 | ch_info.band_center_freq2 = chan_info->band_center_freq2; |
| 3049 | ch_info.info = chan_info->info; |
| 3050 | ch_info.reg_info_1 = chan_info->reg_info_1; |
| 3051 | ch_info.reg_info_2 = chan_info->reg_info_2; |
| 3052 | ch_info.nss = chan_info->nss; |
| 3053 | ch_info.rate_flags = chan_info->rate_flags; |
| 3054 | ch_info.sec_ch_offset = chan_info->sec_ch_offset; |
| 3055 | ch_info.ch_width = chan_info->ch_width; |
| 3056 | os_if_wifi_pos_send_peer_status(peer_mac, peer_status, |
| 3057 | peer_timing_meas_cap, sessionId, |
| 3058 | &ch_info, dev_mode); |
| 3059 | } |
| 3060 | #else |
| 3061 | static inline void hdd_send_peer_status_ind_to_app( |
| 3062 | struct qdf_mac_addr *peer_mac, |
| 3063 | uint8_t peer_status, |
| 3064 | uint8_t peer_timing_meas_cap, |
| 3065 | uint8_t sessionId, |
| 3066 | tSirSmeChanInfo *chan_info, |
Jeff Johnson | c1e6278 | 2017-11-09 09:50:17 -0800 | [diff] [blame] | 3067 | enum QDF_OPMODE dev_mode) |
Naveen Rawat | 910726a | 2017-03-06 11:42:51 -0800 | [diff] [blame] | 3068 | { |
| 3069 | hdd_send_peer_status_ind_to_oem_app(peer_mac, peer_status, |
| 3070 | peer_timing_meas_cap, sessionId, chan_info, dev_mode); |
| 3071 | } |
| 3072 | #endif /* WIFI_POS_CONVERGENCE */ |
| 3073 | |
Archana Ramachandran | b8c04f9 | 2017-03-17 20:05:47 -0700 | [diff] [blame] | 3074 | /** |
| 3075 | * wlan_hdd_send_p2p_quota()- Send P2P Quota value to FW |
| 3076 | * @adapter: Adapter data |
| 3077 | * @sval: P2P quota value |
| 3078 | * |
| 3079 | * Send P2P quota value to FW |
| 3080 | * |
Jeff Johnson | 5ead5ab | 2018-05-06 00:11:08 -0700 | [diff] [blame] | 3081 | * Return: 0 success else failure |
Archana Ramachandran | b8c04f9 | 2017-03-17 20:05:47 -0700 | [diff] [blame] | 3082 | */ |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 3083 | int wlan_hdd_send_p2p_quota(struct hdd_adapter *adapter, int sval); |
Archana Ramachandran | ea34c4f | 2017-03-19 18:56:18 -0700 | [diff] [blame] | 3084 | |
Archana Ramachandran | b8c04f9 | 2017-03-17 20:05:47 -0700 | [diff] [blame] | 3085 | /** |
| 3086 | * wlan_hdd_send_p2p_quota()- Send MCC latency to FW |
| 3087 | * @adapter: Adapter data |
| 3088 | * @sval: MCC latency value |
| 3089 | * |
| 3090 | * Send MCC latency value to FW |
| 3091 | * |
Jeff Johnson | 5ead5ab | 2018-05-06 00:11:08 -0700 | [diff] [blame] | 3092 | * Return: 0 success else failure |
Archana Ramachandran | b8c04f9 | 2017-03-17 20:05:47 -0700 | [diff] [blame] | 3093 | */ |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 3094 | int wlan_hdd_send_mcc_latency(struct hdd_adapter *adapter, int sval); |
Archana Ramachandran | ea34c4f | 2017-03-19 18:56:18 -0700 | [diff] [blame] | 3095 | |
| 3096 | /** |
| 3097 | * wlan_hdd_get_adapter_from_vdev()- Get adapter from vdev id |
| 3098 | * and PSOC object data |
| 3099 | * @psoc: Psoc object data |
| 3100 | * @vdev_id: vdev id |
| 3101 | * |
| 3102 | * Get adapter from vdev id and PSOC object data |
| 3103 | * |
| 3104 | * Return: adapter pointer |
| 3105 | */ |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 3106 | struct hdd_adapter *wlan_hdd_get_adapter_from_vdev(struct wlan_objmgr_psoc |
Archana Ramachandran | ea34c4f | 2017-03-19 18:56:18 -0700 | [diff] [blame] | 3107 | *psoc, uint8_t vdev_id); |
Ashish Kumar Dhanotiya | aa2b17c | 2017-03-29 00:41:32 +0530 | [diff] [blame] | 3108 | /** |
| 3109 | * hdd_unregister_notifiers()- unregister kernel notifiers |
| 3110 | * @hdd_ctx: Hdd Context |
| 3111 | * |
| 3112 | * Unregister netdev notifiers like Netdevice,IPv4 and IPv6. |
| 3113 | * |
| 3114 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 3115 | void hdd_unregister_notifiers(struct hdd_context *hdd_ctx); |
Sachin Ahuja | dddd263 | 2017-03-07 19:07:24 +0530 | [diff] [blame] | 3116 | |
| 3117 | /** |
Nitesh Shah | f9a09ff | 2017-05-22 15:46:25 +0530 | [diff] [blame] | 3118 | * hdd_dbs_scan_selection_init() - initialization for DBS scan selection config |
| 3119 | * @hdd_ctx: HDD context |
| 3120 | * |
| 3121 | * This function sends the DBS scan selection config configuration to the |
| 3122 | * firmware via WMA |
| 3123 | * |
| 3124 | * Return: 0 - success, < 0 - failure |
| 3125 | */ |
Jeff Johnson | d49c4a1 | 2017-08-28 12:08:05 -0700 | [diff] [blame] | 3126 | int hdd_dbs_scan_selection_init(struct hdd_context *hdd_ctx); |
Nitesh Shah | f9a09ff | 2017-05-22 15:46:25 +0530 | [diff] [blame] | 3127 | |
| 3128 | /** |
Sachin Ahuja | dddd263 | 2017-03-07 19:07:24 +0530 | [diff] [blame] | 3129 | * hdd_start_complete()- complete the start event |
| 3130 | * @ret: return value for complete event. |
| 3131 | * |
| 3132 | * complete the startup event and set the return in |
| 3133 | * global variable |
| 3134 | * |
| 3135 | * Return: void |
| 3136 | */ |
| 3137 | |
| 3138 | void hdd_start_complete(int ret); |
Ravi Kumar Bokka | 05c14e5 | 2017-03-27 14:48:23 +0530 | [diff] [blame] | 3139 | |
| 3140 | /** |
| 3141 | * hdd_chip_pwr_save_fail_detected_cb() - chip power save failure detected |
| 3142 | * callback |
Jeff Johnson | b7fa256 | 2018-07-02 08:36:17 -0700 | [diff] [blame] | 3143 | * @hdd_handle: HDD handle |
Ravi Kumar Bokka | 05c14e5 | 2017-03-27 14:48:23 +0530 | [diff] [blame] | 3144 | * @data: chip power save failure detected data |
| 3145 | * |
| 3146 | * This function reads the chip power save failure detected data and fill in |
| 3147 | * the skb with NL attributes and send up the NL event. |
| 3148 | * This callback execute in atomic context and must not invoke any |
| 3149 | * blocking calls. |
| 3150 | * |
| 3151 | * Return: none |
| 3152 | */ |
| 3153 | |
Jeff Johnson | b7fa256 | 2018-07-02 08:36:17 -0700 | [diff] [blame] | 3154 | void hdd_chip_pwr_save_fail_detected_cb(hdd_handle_t hdd_handle, |
Ravi Kumar Bokka | 05c14e5 | 2017-03-27 14:48:23 +0530 | [diff] [blame] | 3155 | struct chip_pwr_save_fail_detected_params |
| 3156 | *data); |
| 3157 | |
Hanumanth Reddy Pothula | 9005178 | 2017-05-04 22:14:43 +0530 | [diff] [blame] | 3158 | /** |
Rajeev Kumar Sirasanagandla | aec0b08 | 2017-06-21 11:59:41 +0530 | [diff] [blame] | 3159 | * hdd_update_ie_whitelist_attr() - Copy probe req ie whitelist attrs from cfg |
| 3160 | * @ie_whitelist: output parameter |
Dundi Raviteja | 85a240a | 2018-09-10 15:03:07 +0530 | [diff] [blame] | 3161 | * @hdd_ctx: pointer to hdd context |
Rajeev Kumar Sirasanagandla | aec0b08 | 2017-06-21 11:59:41 +0530 | [diff] [blame] | 3162 | * |
| 3163 | * Return: None |
| 3164 | */ |
| 3165 | void hdd_update_ie_whitelist_attr(struct probe_req_whitelist_attr *ie_whitelist, |
Dundi Raviteja | 85a240a | 2018-09-10 15:03:07 +0530 | [diff] [blame] | 3166 | struct hdd_context *hdd_ctx); |
Rajeev Kumar Sirasanagandla | aec0b08 | 2017-06-21 11:59:41 +0530 | [diff] [blame] | 3167 | |
| 3168 | /** |
Hanumanth Reddy Pothula | 9005178 | 2017-05-04 22:14:43 +0530 | [diff] [blame] | 3169 | * hdd_get_rssi_snr_by_bssid() - gets the rssi and snr by bssid from scan cache |
| 3170 | * @adapter: adapter handle |
| 3171 | * @bssid: bssid to look for in scan cache |
| 3172 | * @rssi: rssi value found |
| 3173 | * @snr: snr value found |
| 3174 | * |
| 3175 | * Return: QDF_STATUS |
| 3176 | */ |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 3177 | int hdd_get_rssi_snr_by_bssid(struct hdd_adapter *adapter, const uint8_t *bssid, |
Hanumanth Reddy Pothula | 9005178 | 2017-05-04 22:14:43 +0530 | [diff] [blame] | 3178 | int8_t *rssi, int8_t *snr); |
| 3179 | |
Ganesh Kondabattini | 479a8ae | 2017-10-03 16:49:24 +0530 | [diff] [blame] | 3180 | /** |
| 3181 | * hdd_reset_limit_off_chan() - reset limit off-channel command parameters |
| 3182 | * @adapter - HDD adapter |
| 3183 | * |
| 3184 | * Return: 0 on success and non zero value on failure |
| 3185 | */ |
| 3186 | int hdd_reset_limit_off_chan(struct hdd_adapter *adapter); |
| 3187 | |
Vignesh Viswanathan | 3fa1d38 | 2017-08-02 19:36:43 +0530 | [diff] [blame] | 3188 | #if defined(WLAN_FEATURE_FILS_SK) && \ |
| 3189 | (defined(CFG80211_FILS_SK_OFFLOAD_SUPPORT) || \ |
| 3190 | (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))) |
Sridhar Selvaraj | 8c6f5e8 | 2017-08-21 14:53:46 +0530 | [diff] [blame] | 3191 | /** |
| 3192 | * hdd_clear_fils_connection_info: API to clear fils info from roam profile and |
| 3193 | * free allocated memory |
| 3194 | * @adapter: pointer to hdd adapter |
| 3195 | * |
| 3196 | * Return: None |
| 3197 | */ |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 3198 | void hdd_clear_fils_connection_info(struct hdd_adapter *adapter); |
Vignesh Viswanathan | c6d1e1c | 2017-09-18 12:32:49 +0530 | [diff] [blame] | 3199 | |
| 3200 | /** |
| 3201 | * hdd_update_hlp_info() - Update HLP packet received in FILS (re)assoc rsp |
| 3202 | * @dev: net device |
| 3203 | * @roam_fils_params: Fils join rsp params |
| 3204 | * |
| 3205 | * This API is used to send the received HLP packet in Assoc rsp(FILS AKM) |
| 3206 | * to the network layer. |
| 3207 | * |
| 3208 | * Return: None |
| 3209 | */ |
Jeff Johnson | 172237b | 2017-11-07 15:32:59 -0800 | [diff] [blame] | 3210 | void hdd_update_hlp_info(struct net_device *dev, |
| 3211 | struct csr_roam_info *roam_info); |
Sridhar Selvaraj | 8c6f5e8 | 2017-08-21 14:53:46 +0530 | [diff] [blame] | 3212 | #else |
Jeff Johnson | 9d29524 | 2017-08-29 14:39:48 -0700 | [diff] [blame] | 3213 | static inline void hdd_clear_fils_connection_info(struct hdd_adapter *adapter) |
Sridhar Selvaraj | 8c6f5e8 | 2017-08-21 14:53:46 +0530 | [diff] [blame] | 3214 | { } |
Vignesh Viswanathan | c6d1e1c | 2017-09-18 12:32:49 +0530 | [diff] [blame] | 3215 | static inline void hdd_update_hlp_info(struct net_device *dev, |
Jeff Johnson | 172237b | 2017-11-07 15:32:59 -0800 | [diff] [blame] | 3216 | struct csr_roam_info *roam_info) |
Vignesh Viswanathan | c6d1e1c | 2017-09-18 12:32:49 +0530 | [diff] [blame] | 3217 | {} |
Sridhar Selvaraj | 8c6f5e8 | 2017-08-21 14:53:46 +0530 | [diff] [blame] | 3218 | #endif |
Dustin Brown | 3fb1504 | 2017-08-15 15:54:49 -0700 | [diff] [blame] | 3219 | |
| 3220 | #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) |
Dustin Brown | c81dd41 | 2017-08-15 16:26:28 -0700 | [diff] [blame] | 3221 | static inline void hdd_dev_setup_destructor(struct net_device *dev) |
| 3222 | { |
| 3223 | dev->destructor = free_netdev; |
| 3224 | } |
Dustin Brown | 3fb1504 | 2017-08-15 15:54:49 -0700 | [diff] [blame] | 3225 | #else |
Dustin Brown | c81dd41 | 2017-08-15 16:26:28 -0700 | [diff] [blame] | 3226 | static inline void hdd_dev_setup_destructor(struct net_device *dev) |
| 3227 | { |
| 3228 | dev->needs_free_netdev = true; |
| 3229 | } |
Dustin Brown | c81dd41 | 2017-08-15 16:26:28 -0700 | [diff] [blame] | 3230 | #endif /* KERNEL_VERSION(4, 12, 0) */ |
Dustin Brown | 3fb1504 | 2017-08-15 15:54:49 -0700 | [diff] [blame] | 3231 | |
Mohit Khanna | f8f9682 | 2017-05-17 17:11:59 -0700 | [diff] [blame] | 3232 | /** |
| 3233 | * hdd_dp_trace_init() - initialize DP Trace by calling the QDF API |
| 3234 | * @config: hdd config |
| 3235 | * |
| 3236 | * Return: NONE |
| 3237 | */ |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 3238 | #ifdef CONFIG_DP_TRACE |
Mohit Khanna | f8f9682 | 2017-05-17 17:11:59 -0700 | [diff] [blame] | 3239 | void hdd_dp_trace_init(struct hdd_config *config); |
Nirav Shah | d21a2e3 | 2018-04-20 16:34:43 +0530 | [diff] [blame] | 3240 | #else |
| 3241 | static inline |
| 3242 | void hdd_dp_trace_init(struct hdd_config *config) {} |
| 3243 | #endif |
| 3244 | |
Yun Park | ff6a16a | 2017-09-26 16:38:18 -0700 | [diff] [blame] | 3245 | void hdd_set_rx_mode_rps(bool enable); |
Mohit Khanna | f8f9682 | 2017-05-17 17:11:59 -0700 | [diff] [blame] | 3246 | |
Ganesh Kondabattini | 3573957 | 2017-06-21 16:26:39 +0530 | [diff] [blame] | 3247 | /** |
Nachiket Kukade | be8850b | 2017-09-18 15:37:00 +0530 | [diff] [blame] | 3248 | * hdd_drv_ops_inactivity_handler() - Timeout handler for driver ops |
| 3249 | * inactivity timer |
| 3250 | * |
| 3251 | * Return: None |
| 3252 | */ |
| 3253 | void hdd_drv_ops_inactivity_handler(void); |
| 3254 | |
| 3255 | /** |
| 3256 | * hdd_start_driver_ops_timer() - Starts driver ops inactivity timer |
| 3257 | * @drv_op: Enum indicating driver op |
| 3258 | * |
| 3259 | * Return: none |
| 3260 | */ |
| 3261 | void hdd_start_driver_ops_timer(int drv_op); |
| 3262 | |
| 3263 | /** |
| 3264 | * hdd_stop_driver_ops_timer() - Stops driver ops inactivity timer |
| 3265 | * |
| 3266 | * Return: none |
| 3267 | */ |
| 3268 | void hdd_stop_driver_ops_timer(void); |
| 3269 | |
Sravan Kumar Kairam | d80c766 | 2017-10-03 16:11:05 +0530 | [diff] [blame] | 3270 | /** |
| 3271 | * hdd_pld_ipa_uc_shutdown_pipes() - Disconnect IPA WDI pipes during PDR |
| 3272 | * |
| 3273 | * Return: None |
| 3274 | */ |
| 3275 | void hdd_pld_ipa_uc_shutdown_pipes(void); |
Abhishek Singh | b6cdaf1 | 2017-11-10 14:43:39 +0530 | [diff] [blame] | 3276 | |
| 3277 | /** |
Jeff Johnson | 33142e6 | 2018-05-06 17:58:36 -0700 | [diff] [blame] | 3278 | * hdd_limit_max_per_index_score() -check if per index score doesn't exceed 100% |
Abhishek Singh | b6cdaf1 | 2017-11-10 14:43:39 +0530 | [diff] [blame] | 3279 | * (0x64). If it exceed make it 100% |
| 3280 | * |
| 3281 | * @per_index_score: per_index_score as input |
| 3282 | * |
| 3283 | * Return: per_index_score within the max limit |
| 3284 | */ |
| 3285 | uint32_t hdd_limit_max_per_index_score(uint32_t per_index_score); |
Abhinav Kumar | b074f2f | 2018-09-15 15:32:11 +0530 | [diff] [blame] | 3286 | |
| 3287 | /** |
| 3288 | * hdd_update_score_config - API to update candidate scoring related params |
| 3289 | * configuration parameters |
| 3290 | * @score_config: score config to update |
| 3291 | * @cfg: config params |
| 3292 | * |
| 3293 | * Return: QDF_STATUS |
| 3294 | */ |
| 3295 | QDF_STATUS hdd_update_score_config( |
| 3296 | struct scoring_config *score_config, struct hdd_context *hdd_ctx); |
| 3297 | |
Ashish Kumar Dhanotiya | 443d31f | 2017-10-13 12:41:19 +0530 | [diff] [blame] | 3298 | /** |
| 3299 | * hdd_get_stainfo() - get stainfo for the specified peer |
| 3300 | * @astainfo: array of the station info in which the sta info |
| 3301 | * corresponding to mac_addr needs to be searched |
| 3302 | * @mac_addr: mac address of requested peer |
| 3303 | * |
| 3304 | * This function find the stainfo for the peer with mac_addr |
| 3305 | * |
| 3306 | * Return: stainfo if found, NULL if not found |
| 3307 | */ |
| 3308 | struct hdd_station_info *hdd_get_stainfo(struct hdd_station_info *astainfo, |
| 3309 | struct qdf_mac_addr mac_addr); |
Abhishek Singh | b6cdaf1 | 2017-11-10 14:43:39 +0530 | [diff] [blame] | 3310 | |
Nachiket Kukade | 98f562a | 2017-12-15 12:18:07 +0530 | [diff] [blame] | 3311 | /** |
Vignesh Viswanathan | 21c58cb | 2018-05-24 15:53:58 +0530 | [diff] [blame] | 3312 | * hdd_component_psoc_open() - Open the legacy components |
| 3313 | * @psoc: Pointer to psoc object |
| 3314 | * |
| 3315 | * This function opens the legacy components and initializes the |
| 3316 | * component's private objects. |
| 3317 | * |
| 3318 | * Return: QDF_STATUS |
| 3319 | */ |
| 3320 | QDF_STATUS hdd_component_psoc_open(struct wlan_objmgr_psoc *psoc); |
| 3321 | |
| 3322 | /** |
| 3323 | * hdd_component_psoc_close() - Close the legacy components |
| 3324 | * @psoc: Pointer to psoc object |
| 3325 | * |
| 3326 | * This function closes the legacy components and resets the |
| 3327 | * component's private objects. |
| 3328 | * |
| 3329 | * Return: None |
| 3330 | */ |
| 3331 | void hdd_component_psoc_close(struct wlan_objmgr_psoc *psoc); |
| 3332 | |
| 3333 | /** |
Nachiket Kukade | 98f562a | 2017-12-15 12:18:07 +0530 | [diff] [blame] | 3334 | * hdd_component_psoc_enable() - Trigger psoc enable for CLD Components |
| 3335 | * |
| 3336 | * Return: None |
| 3337 | */ |
| 3338 | void hdd_component_psoc_enable(struct wlan_objmgr_psoc *psoc); |
| 3339 | |
| 3340 | /** |
| 3341 | * hdd_component_psoc_disable() - Trigger psoc disable for CLD Components |
| 3342 | * |
| 3343 | * Return: None |
| 3344 | */ |
| 3345 | void hdd_component_psoc_disable(struct wlan_objmgr_psoc *psoc); |
| 3346 | |
Sandeep Puligilla | b7beb47 | 2018-08-13 22:54:20 -0700 | [diff] [blame] | 3347 | /** |
| 3348 | * hdd_component_pdev_open() - Trigger pdev open for CLD Components |
| 3349 | * |
| 3350 | * Return: QDF_STATUS |
| 3351 | */ |
| 3352 | QDF_STATUS hdd_component_pdev_open(struct wlan_objmgr_pdev *pdev); |
| 3353 | |
| 3354 | /** |
| 3355 | * hdd_component_pdev_close() - Trigger pdev close for CLD Components |
| 3356 | * |
| 3357 | * Return: None |
| 3358 | */ |
| 3359 | void hdd_component_pdev_close(struct wlan_objmgr_pdev *pdev); |
| 3360 | |
Wen Gong | 3f00338 | 2018-05-14 14:26:37 +0800 | [diff] [blame] | 3361 | #ifdef WLAN_FEATURE_MEMDUMP_ENABLE |
Hanumanth Reddy Pothula | 07e5f99 | 2017-11-08 19:35:19 +0530 | [diff] [blame] | 3362 | int hdd_driver_memdump_init(void); |
| 3363 | void hdd_driver_memdump_deinit(void); |
Wen Gong | 3f00338 | 2018-05-14 14:26:37 +0800 | [diff] [blame] | 3364 | #else /* WLAN_FEATURE_MEMDUMP_ENABLE */ |
Wen Gong | aa6d55d | 2018-04-26 16:33:21 +0800 | [diff] [blame] | 3365 | static inline int hdd_driver_memdump_init(void) |
| 3366 | { |
| 3367 | return 0; |
| 3368 | } |
| 3369 | static inline void hdd_driver_memdump_deinit(void) |
| 3370 | { |
| 3371 | } |
Wen Gong | 3f00338 | 2018-05-14 14:26:37 +0800 | [diff] [blame] | 3372 | #endif /* WLAN_FEATURE_MEMDUMP_ENABLE */ |
Himanshu Agarwal | b229a14 | 2017-12-21 10:16:45 +0530 | [diff] [blame] | 3373 | /** |
Hanumanth Reddy Pothula | 3862ca9 | 2018-01-12 16:44:10 +0530 | [diff] [blame] | 3374 | * hdd_is_cli_iface_up() - check if there is any cli iface up |
| 3375 | * @hdd_ctx: HDD context |
| 3376 | * |
| 3377 | * Return: return true if there is any cli iface(STA/P2P_CLI) is up |
| 3378 | * else return false |
| 3379 | */ |
| 3380 | bool hdd_is_cli_iface_up(struct hdd_context *hdd_ctx); |
| 3381 | |
Alok Kumar | b64650c | 2018-03-23 17:05:11 +0530 | [diff] [blame] | 3382 | /** |
| 3383 | * hdd_set_disconnect_status() - set adapter disconnection status |
| 3384 | * @hdd_adapter: Pointer to hdd adapter |
| 3385 | * @disconnecting: Disconnect status to set |
| 3386 | * |
| 3387 | * Return: None |
| 3388 | */ |
| 3389 | void hdd_set_disconnect_status(struct hdd_adapter *adapter, bool disconnecting); |
| 3390 | |
Nirav Shah | 73713f7 | 2018-05-17 14:50:41 +0530 | [diff] [blame] | 3391 | #ifdef FEATURE_MONITOR_MODE_SUPPORT |
Jeff Johnson | d995275 | 2018-04-18 12:15:35 -0700 | [diff] [blame] | 3392 | /** |
| 3393 | * wlan_hdd_set_mon_chan() - Set capture channel on the monitor mode interface. |
| 3394 | * @adapter: Handle to adapter |
| 3395 | * @chan: Monitor mode channel |
| 3396 | * @bandwidth: Capture channel bandwidth |
| 3397 | * |
| 3398 | * Return: 0 on success else error code. |
| 3399 | */ |
| 3400 | int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan, |
| 3401 | uint32_t bandwidth); |
Nirav Shah | 73713f7 | 2018-05-17 14:50:41 +0530 | [diff] [blame] | 3402 | #else |
| 3403 | static inline |
| 3404 | int wlan_hdd_set_mon_chan(struct hdd_adapter *adapter, uint32_t chan, |
| 3405 | uint32_t bandwidth) |
| 3406 | { |
| 3407 | return 0; |
| 3408 | } |
| 3409 | #endif |
Jeff Johnson | d995275 | 2018-04-18 12:15:35 -0700 | [diff] [blame] | 3410 | |
Ryan Hsu | aadba07 | 2018-04-20 13:01:53 -0700 | [diff] [blame] | 3411 | /** |
| 3412 | * hdd_wlan_get_version() - Get version information |
| 3413 | * @hdd_ctx: Global HDD context |
| 3414 | * @version_len: length of the version buffer size |
| 3415 | * @version: the buffer to the version string |
| 3416 | * |
| 3417 | * This function is used to get Wlan Driver, Firmware, Hardware Version |
| 3418 | * & the Board related information. |
| 3419 | * |
| 3420 | * Return: the length of the version string |
| 3421 | */ |
| 3422 | uint32_t hdd_wlan_get_version(struct hdd_context *hdd_ctx, |
| 3423 | const size_t version_len, uint8_t *version); |
Rachit Kankane | 0dc3e85 | 2018-05-07 17:33:42 +0530 | [diff] [blame] | 3424 | /** |
| 3425 | * hdd_assemble_rate_code() - assemble rate code to be sent to FW |
| 3426 | * @preamble: rate preamble |
| 3427 | * @nss: number of streams |
| 3428 | * @rate: rate index |
| 3429 | * |
| 3430 | * Rate code assembling is different for targets which are 11ax capable. |
| 3431 | * Check for the target support and assemble the rate code accordingly. |
| 3432 | * |
| 3433 | * Return: assembled rate code |
| 3434 | */ |
| 3435 | int hdd_assemble_rate_code(uint8_t preamble, uint8_t nss, uint8_t rate); |
| 3436 | |
| 3437 | /** |
| 3438 | * hdd_set_11ax_rate() - set 11ax rate |
| 3439 | * @adapter: adapter being modified |
| 3440 | * @value: new 11ax rate code |
| 3441 | * @sap_config: pointer to SAP config to check HW mode |
| 3442 | * this will be NULL for call from STA persona |
| 3443 | * |
| 3444 | * Return: 0 on success, negative errno on failure |
| 3445 | */ |
| 3446 | int hdd_set_11ax_rate(struct hdd_adapter *adapter, int value, |
| 3447 | struct sap_config *sap_config); |
Ryan Hsu | aadba07 | 2018-04-20 13:01:53 -0700 | [diff] [blame] | 3448 | |
| 3449 | /** |
| 3450 | * hdd_update_hw_sw_info() - API to update the HW/SW information |
| 3451 | * @hdd_ctx: Global HDD context |
| 3452 | * |
| 3453 | * API to update the HW and SW information in the driver |
| 3454 | * |
| 3455 | * Note: |
| 3456 | * All the version/revision information would only be retrieved after |
| 3457 | * firmware download |
| 3458 | * |
| 3459 | * Return: None |
| 3460 | */ |
| 3461 | void hdd_update_hw_sw_info(struct hdd_context *hdd_ctx); |
| 3462 | |
Dundi Raviteja | 3bcf3a8 | 2018-05-22 13:24:18 +0530 | [diff] [blame] | 3463 | /** |
| 3464 | * hdd_get_nud_stats_cb() - callback api to update the stats received from FW |
| 3465 | * @data: pointer to hdd context. |
| 3466 | * @rsp: pointer to data received from FW. |
| 3467 | * @context: callback context |
| 3468 | * |
| 3469 | * This is called when wlan driver received response event for |
| 3470 | * get arp stats to firmware. |
| 3471 | * |
| 3472 | * Return: None |
| 3473 | */ |
| 3474 | void hdd_get_nud_stats_cb(void *data, struct rsp_stats *rsp, void *context); |
| 3475 | |
Jeff Johnson | b81b2e0 | 2018-06-11 19:13:11 -0700 | [diff] [blame] | 3476 | /** |
| 3477 | * hdd_context_get_mac_handle() - get mac handle from hdd context |
| 3478 | * @hdd_ctx: Global HDD context pointer |
| 3479 | * |
| 3480 | * Retrieves the global MAC handle from the HDD context |
| 3481 | * |
| 3482 | * Return: The global MAC handle (which may be NULL) |
| 3483 | */ |
| 3484 | static inline |
| 3485 | mac_handle_t hdd_context_get_mac_handle(struct hdd_context *hdd_ctx) |
| 3486 | { |
| 3487 | return hdd_ctx ? hdd_ctx->mac_handle : NULL; |
| 3488 | } |
| 3489 | |
| 3490 | /** |
| 3491 | * hdd_adapter_get_mac_handle() - get mac handle from hdd adapter |
| 3492 | * @adapter: HDD adapter pointer |
| 3493 | * |
| 3494 | * Retrieves the global MAC handle given an HDD adapter |
| 3495 | * |
| 3496 | * Return: The global MAC handle (which may be NULL) |
| 3497 | */ |
| 3498 | static inline |
| 3499 | mac_handle_t hdd_adapter_get_mac_handle(struct hdd_adapter *adapter) |
| 3500 | { |
| 3501 | return adapter ? |
| 3502 | hdd_context_get_mac_handle(adapter->hdd_ctx) : NULL; |
| 3503 | } |
| 3504 | |
Jeff Johnson | ea70b94 | 2018-07-02 09:42:31 -0700 | [diff] [blame] | 3505 | /** |
| 3506 | * hdd_handle_to_context() - turn an HDD handle into an HDD context |
| 3507 | * @hdd_handle: HDD handle to be converted |
| 3508 | * |
| 3509 | * Return: HDD context referenced by @hdd_handle |
| 3510 | */ |
| 3511 | static inline |
| 3512 | struct hdd_context *hdd_handle_to_context(hdd_handle_t hdd_handle) |
| 3513 | { |
| 3514 | return (struct hdd_context *)hdd_handle; |
| 3515 | } |
Ashish Kumar Dhanotiya | 3f78e68 | 2018-03-14 11:19:27 +0530 | [diff] [blame] | 3516 | |
| 3517 | /** |
| 3518 | * wlan_hdd_free_cache_channels() - Free the cache channels list |
| 3519 | * @hdd_ctx: Pointer to HDD context |
| 3520 | * |
| 3521 | * Return: None |
| 3522 | */ |
| 3523 | void wlan_hdd_free_cache_channels(struct hdd_context *hdd_ctx); |
| 3524 | |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3525 | #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ |