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