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