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