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