Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
c_hpothu | 002231a | 2015-02-05 14:58:51 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
Kiet Lam | 842dad0 | 2014-02-18 18:44:02 -0800 | [diff] [blame] | 26 | */ |
| 27 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 28 | |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 29 | |
| 30 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 31 | #if !defined( WLAN_HDD_MAIN_H ) |
| 32 | #define WLAN_HDD_MAIN_H |
| 33 | /**=========================================================================== |
| 34 | |
| 35 | \file WLAN_HDD_MAIN_H.h |
| 36 | |
| 37 | \brief Linux HDD Adapter Type |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 38 | |
| 39 | ==========================================================================*/ |
| 40 | |
| 41 | /*--------------------------------------------------------------------------- |
| 42 | Include files |
| 43 | -------------------------------------------------------------------------*/ |
| 44 | |
| 45 | #include <linux/netdevice.h> |
| 46 | #include <linux/skbuff.h> |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 47 | #include <net/cfg80211.h> |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 48 | #include <vos_list.h> |
| 49 | #include <vos_types.h> |
| 50 | #include "sirMacProtDef.h" |
| 51 | #include "csrApi.h" |
| 52 | #include <wlan_hdd_assoc.h> |
| 53 | #include <wlan_hdd_dp_utils.h> |
| 54 | #include <wlan_hdd_wmm.h> |
| 55 | #include <wlan_hdd_cfg.h> |
| 56 | #include <linux/spinlock.h> |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 57 | #ifdef WLAN_OPEN_SOURCE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 58 | #include <linux/wakelock.h> |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 59 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 60 | #include <wlan_hdd_ftm.h> |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 61 | #ifdef FEATURE_WLAN_TDLS |
| 62 | #include "wlan_hdd_tdls.h" |
| 63 | #endif |
Rajesh Chauhan | 98a31f8 | 2014-01-06 20:15:25 -0800 | [diff] [blame] | 64 | #include "wlan_hdd_cfg80211.h" |
| 65 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 66 | /*--------------------------------------------------------------------------- |
| 67 | Preprocessor definitions and constants |
| 68 | -------------------------------------------------------------------------*/ |
| 69 | /** Number of attempts to detect/remove card */ |
| 70 | #define LIBRA_CARD_INSERT_DETECT_MAX_COUNT 5 |
| 71 | #define LIBRA_CARD_REMOVE_DETECT_MAX_COUNT 5 |
Kanchanapally, Vidyullatha | ed969c6 | 2015-02-18 11:39:11 +0530 | [diff] [blame] | 72 | |
| 73 | /** Number of Tx Queues. This should be same as the one |
| 74 | * used in TL WLANTL_NUM_TX_QUEUES */ |
| 75 | #define NUM_TX_QUEUES 5 |
| 76 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 77 | /** HDD's internal Tx Queue Length. Needs to be a power of 2 */ |
| 78 | #define HDD_TX_QUEUE_MAX_LEN 128 |
| 79 | /** HDD internal Tx Queue Low Watermark. Net Device TX queue is disabled |
| 80 | * when HDD queue becomes full. This Low watermark is used to enable |
| 81 | * the Net Device queue again */ |
| 82 | #define HDD_TX_QUEUE_LOW_WATER_MARK (HDD_TX_QUEUE_MAX_LEN*3/4) |
| 83 | /** Bytes to reserve in the headroom */ |
| 84 | #define LIBRA_HW_NEEDED_HEADROOM 128 |
| 85 | /** Hdd Tx Time out value */ |
| 86 | #ifdef LIBRA_LINUX_PC |
| 87 | #define HDD_TX_TIMEOUT (8000) |
| 88 | #else |
| 89 | #define HDD_TX_TIMEOUT msecs_to_jiffies(5000) |
| 90 | #endif |
| 91 | /** Hdd Default MTU */ |
| 92 | #define HDD_DEFAULT_MTU (1500) |
Jeff Johnson | 6a81ca4 | 2013-04-05 10:37:08 -0700 | [diff] [blame] | 93 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 94 | /**event flags registered net device*/ |
Jeff Johnson | 6a81ca4 | 2013-04-05 10:37:08 -0700 | [diff] [blame] | 95 | #define NET_DEVICE_REGISTERED (0) |
| 96 | #define SME_SESSION_OPENED (1) |
| 97 | #define INIT_TX_RX_SUCCESS (2) |
| 98 | #define WMM_INIT_DONE (3) |
| 99 | #define SOFTAP_BSS_STARTED (4) |
| 100 | #define DEVICE_IFACE_OPENED (5) |
| 101 | #define TDLS_INIT_DONE (6) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 102 | |
| 103 | /** Maximum time(ms)to wait for disconnect to complete **/ |
Mahesh A Saptasagar | 05a357e | 2014-02-26 16:28:06 +0530 | [diff] [blame] | 104 | #define WLAN_WAIT_TIME_DISCONNECT 2000 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 105 | #define WLAN_WAIT_TIME_STATS 800 |
Siddharth Bhal | 6424617 | 2015-02-27 01:04:37 +0530 | [diff] [blame] | 106 | #define WLAN_WAIT_TIME_FRAME_LOG 2000 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 107 | #define WLAN_WAIT_TIME_POWER 800 |
Sameer Thalappil | da4eb6a | 2013-09-25 11:45:07 -0700 | [diff] [blame] | 108 | #define WLAN_WAIT_TIME_COUNTRY 1000 |
Kiet Lam | 46b8e4e | 2013-11-06 21:49:53 +0530 | [diff] [blame] | 109 | #define WLAN_WAIT_TIME_CHANNEL_UPDATE 600 |
Satyanarayana Dash | 7280601 | 2014-12-02 14:30:08 +0530 | [diff] [blame] | 110 | #define FW_STATE_WAIT_TIME 500 |
| 111 | #define FW_STATE_RSP_LEN 100 |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 112 | /* Amount of time to wait for sme close session callback. |
| 113 | This value should be larger than the timeout used by WDI to wait for |
| 114 | a response from WCNSS */ |
| 115 | #define WLAN_WAIT_TIME_SESSIONOPENCLOSE 15000 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 116 | #define WLAN_WAIT_TIME_ABORTSCAN 2000 |
| 117 | |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 118 | /** Maximum time(ms) to wait for tdls add sta to complete **/ |
| 119 | #define WAIT_TIME_TDLS_ADD_STA 1500 |
| 120 | |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 121 | /** Maximum time(ms) to wait for tdls del sta to complete **/ |
| 122 | #define WAIT_TIME_TDLS_DEL_STA 1500 |
| 123 | |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 124 | /** Maximum time(ms) to wait for Link Establish Req to complete **/ |
| 125 | #define WAIT_TIME_TDLS_LINK_ESTABLISH_REQ 1500 |
| 126 | |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 127 | /** Maximum time(ms) to wait for tdls mgmt to complete **/ |
Gopichand Nakkala | 21c3f9b | 2013-03-23 14:45:55 -0700 | [diff] [blame] | 128 | #define WAIT_TIME_TDLS_MGMT 11000 |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 129 | |
Hoonki Lee | 1462135 | 2013-04-16 17:51:19 -0700 | [diff] [blame] | 130 | /** Maximum time(ms) to wait for tdls initiator to start direct communication **/ |
Gopichand Nakkala | 9b4eee1 | 2013-05-21 16:05:48 +0530 | [diff] [blame] | 131 | #define WAIT_TIME_TDLS_INITIATOR 600 |
Amar Singhal | fddc28c | 2013-09-05 13:03:40 -0700 | [diff] [blame] | 132 | |
| 133 | /* Maximum time to get linux regulatory entry settings */ |
Amar Singhal | a49cbc5 | 2013-10-08 18:37:44 -0700 | [diff] [blame] | 134 | #ifdef CONFIG_ENABLE_LINUX_REG |
Amar Singhal | fddc28c | 2013-09-05 13:03:40 -0700 | [diff] [blame] | 135 | #define LINUX_REG_WAIT_TIME 300 |
Amar Singhal | a49cbc5 | 2013-10-08 18:37:44 -0700 | [diff] [blame] | 136 | #else |
| 137 | #define CRDA_WAIT_TIME 300 |
| 138 | #endif |
Madan Mohan Koyyalamudi | c3a240c | 2012-09-28 15:34:08 -0700 | [diff] [blame] | 139 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 140 | /* Scan Req Timeout */ |
| 141 | #define WLAN_WAIT_TIME_SCAN_REQ 100 |
| 142 | |
| 143 | #define MAX_NUMBER_OF_ADAPTERS 4 |
| 144 | |
| 145 | #define MAX_CFG_STRING_LEN 255 |
| 146 | |
| 147 | #define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] |
| 148 | /** Mac Address string **/ |
| 149 | #define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x" |
Arif Hussain | ed66764 | 2013-10-27 23:01:14 -0700 | [diff] [blame] | 150 | #define MAC_ADDRESS_STR_LEN 18 /* Including null terminator */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 151 | #define MAX_GENIE_LEN 255 |
| 152 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 153 | #define WLAN_CHIP_VERSION "WCNSS" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 154 | |
| 155 | #define hddLog(level, args...) VOS_TRACE( VOS_MODULE_ID_HDD, level, ## args) |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 156 | #define ENTER() VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Enter:%s", __func__) |
| 157 | #define EXIT() VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Exit:%s", __func__) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 158 | |
| 159 | #define WLAN_HDD_GET_PRIV_PTR(__dev__) (hdd_adapter_t*)(netdev_priv((__dev__))) |
| 160 | |
| 161 | #define MAX_EXIT_ATTEMPTS_DURING_LOGP 20 |
| 162 | |
| 163 | #define MAX_NO_OF_2_4_CHANNELS 14 |
| 164 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 165 | #define WLAN_HDD_PUBLIC_ACTION_FRAME 4 |
| 166 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET 24 |
vamsi | 9bd92b7 | 2013-12-26 14:11:29 +0530 | [diff] [blame] | 167 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_BODY_OFFSET 24 |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 168 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET 30 |
vamsi | 9bd92b7 | 2013-12-26 14:11:29 +0530 | [diff] [blame] | 169 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_CATEGORY_OFFSET 0 |
| 170 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_ACTION_OFFSET 1 |
| 171 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_OFFSET 2 |
| 172 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OUI_TYPE_OFFSET 5 |
| 173 | #define WLAN_HDD_VENDOR_SPECIFIC_ACTION 0x09 |
| 174 | #define WLAN_HDD_WFA_OUI 0x506F9A |
| 175 | #define WLAN_HDD_WFA_P2P_OUI_TYPE 0x09 |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 176 | #define WLAN_HDD_P2P_SOCIAL_CHANNELS 3 |
Madan Mohan Koyyalamudi | 8d50f31 | 2012-11-27 15:48:57 -0800 | [diff] [blame] | 177 | #define WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN 1 |
Ahmad Kholaif | e5ec2cd | 2014-03-19 13:22:04 +0530 | [diff] [blame] | 178 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_SUB_TYPE_OFFSET 6 |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 179 | |
Gopichand Nakkala | 1f7a64f | 2013-04-01 18:37:17 +0530 | [diff] [blame] | 180 | #define WLAN_HDD_IS_SOCIAL_CHANNEL(center_freq) \ |
| 181 | (((center_freq) == 2412) || ((center_freq) == 2437) || ((center_freq) == 2462)) |
| 182 | |
Madan Mohan Koyyalamudi | 7127826 | 2013-04-12 22:00:48 +0530 | [diff] [blame] | 183 | #define WLAN_HDD_CHANNEL_IN_UNII_1_BAND(center_freq) \ |
| 184 | (((center_freq) == 5180 ) || ((center_freq) == 5200) \ |
| 185 | || ((center_freq) == 5220) || ((center_freq) == 5240)) |
| 186 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 187 | #ifdef WLAN_FEATURE_11W |
| 188 | #define WLAN_HDD_SA_QUERY_ACTION_FRAME 8 |
| 189 | #endif |
| 190 | |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 191 | #define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14 |
| 192 | #define WLAN_HDD_TDLS_ACTION_FRAME 12 |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 193 | #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK |
Sameer Thalappil | 84b14ff | 2013-06-12 16:02:52 -0700 | [diff] [blame] | 194 | #define HDD_WAKE_LOCK_DURATION 50 //in msecs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 195 | #endif |
| 196 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 197 | #define WLAN_HDD_QOS_ACTION_FRAME 1 |
| 198 | #define WLAN_HDD_QOS_MAP_CONFIGURE 4 |
Amar Singhal | 6144c00 | 2013-05-03 16:11:42 -0700 | [diff] [blame] | 199 | #define HDD_SAP_WAKE_LOCK_DURATION 10000 //in msecs |
Madan Mohan Koyyalamudi | 69fc3ad | 2012-11-28 16:04:56 -0800 | [diff] [blame] | 200 | |
Sameer Thalappil | 451ebb9 | 2013-06-28 15:49:58 -0700 | [diff] [blame] | 201 | #define HDD_MOD_EXIT_SSR_MAX_RETRIES 30 |
| 202 | |
Sunil Ravi | a72c399 | 2013-01-31 06:12:22 -0800 | [diff] [blame] | 203 | /* Maximum number of interfaces allowed(STA, P2P Device, P2P Interface) */ |
| 204 | #define WLAN_MAX_INTERFACES 3 |
| 205 | |
Gopichand Nakkala | 870cbae | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 206 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 207 | #define GTK_OFFLOAD_ENABLE 0 |
| 208 | #define GTK_OFFLOAD_DISABLE 1 |
| 209 | #endif |
| 210 | |
Madan Mohan Koyyalamudi | 1d16f46 | 2013-08-27 16:25:34 +0530 | [diff] [blame] | 211 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 212 | #define HDD_PNO_SCAN_TIMERS_SET_ONE 1 |
| 213 | /* value should not be greater than PNO_MAX_SCAN_TIMERS */ |
| 214 | #define HDD_PNO_SCAN_TIMERS_SET_MULTIPLE 6 |
Hanumantha Reddy Pothula | 06e87b2 | 2015-03-02 18:02:23 +0530 | [diff] [blame] | 215 | #define WLAN_WAIT_TIME_PNO 2000 |
Madan Mohan Koyyalamudi | 1d16f46 | 2013-08-27 16:25:34 +0530 | [diff] [blame] | 216 | #endif |
| 217 | |
Arif Hussain | 0273cba | 2014-01-07 20:58:29 -0800 | [diff] [blame] | 218 | #define MAX_USER_COMMAND_SIZE 4096 |
| 219 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 220 | #define HDD_MAC_ADDR_LEN 6 |
| 221 | typedef v_U8_t tWlanHddMacAddr[HDD_MAC_ADDR_LEN]; |
| 222 | |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 223 | #ifdef FEATURE_WLAN_BATCH_SCAN |
| 224 | #define HDD_BATCH_SCAN_VERSION (17) |
| 225 | #define HDD_SET_BATCH_SCAN_DEFAULT_FREQ (30)/*batch scan frequency default 30s*/ |
| 226 | #define HDD_SET_BATCH_SCAN_BEST_NETWORK (16)/*best network default value*/ |
| 227 | #define HDD_SET_BATCH_SCAN_DEFAULT_BAND (0)/*auto means both 2.4GHz and 5GHz*/ |
| 228 | #define HDD_SET_BATCH_SCAN_24GHz_BAND_ONLY (1)/*only 2.4GHz band*/ |
| 229 | #define HDD_SET_BATCH_SCAN_5GHz_BAND_ONLY (2)/*only 5GHz band*/ |
| 230 | #define HDD_SET_BATCH_SCAN_REQ_TIME_OUT (15000) /*Batch scan req timeout in ms*/ |
| 231 | #define HDD_GET_BATCH_SCAN_RSP_TIME_OUT (15000) /*Batch scan req timeout in ms*/ |
| 232 | #define HDD_BATCH_SCAN_AP_META_INFO_SIZE (150) /*AP meta info size in string*/ |
| 233 | |
| 234 | #define MIN(a, b) (a > b ? b : a) |
| 235 | |
| 236 | #endif |
Jeff Johnson | 72a4051 | 2013-12-19 10:14:15 -0800 | [diff] [blame] | 237 | /* |
| 238 | * Generic asynchronous request/response support |
| 239 | * |
| 240 | * Many of the APIs supported by HDD require a call to SME to |
| 241 | * perform an action or to retrieve some data. In most cases SME |
| 242 | * performs the operation asynchronously, and will execute a provided |
| 243 | * callback function when the request has completed. In order to |
| 244 | * synchronize this the HDD API allocates a context which is then |
| 245 | * passed to SME, and which is then, in turn, passed back to the |
| 246 | * callback function when the operation completes. The callback |
| 247 | * function then sets a completion variable inside the context which |
| 248 | * the HDD API is waiting on. In an ideal world the HDD API would |
| 249 | * wait forever (or at least for a long time) for the response to be |
| 250 | * received and for the completion variable to be set. However in |
| 251 | * most cases these HDD APIs are being invoked in the context of a |
| 252 | * userspace thread which has invoked either a cfg80211 API or a |
| 253 | * wireless extensions ioctl and which has taken the kernel rtnl_lock. |
| 254 | * Since this lock is used to synchronize many of the kernel tasks, we |
| 255 | * do not want to hold it for a long time. In addition we do not want |
| 256 | * to block userspace threads (such as the wpa supplicant's main |
| 257 | * thread) for an extended time. Therefore we only block for a short |
| 258 | * time waiting for the response before we timeout. This means that |
| 259 | * it is possible for the HDD API to timeout, and for the callback to |
| 260 | * be invoked afterwards. In order for the callback function to |
| 261 | * determine if the HDD API is still waiting, a magic value is also |
| 262 | * stored in the shared context. Only if the context has a valid |
| 263 | * magic will the callback routine do any work. In order to further |
| 264 | * synchronize these activities a spinlock is used so that if any HDD |
| 265 | * API timeout coincides with its callback, the operations of the two |
| 266 | * threads will be serialized. |
| 267 | */ |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 268 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 269 | struct statsContext |
| 270 | { |
| 271 | struct completion completion; |
| 272 | hdd_adapter_t *pAdapter; |
| 273 | unsigned int magic; |
| 274 | }; |
| 275 | |
Siddharth Bhal | 6424617 | 2015-02-27 01:04:37 +0530 | [diff] [blame] | 276 | struct getFrameLogCtx |
| 277 | { |
| 278 | struct completion completion; |
| 279 | hdd_adapter_t *pAdapter; |
| 280 | unsigned int magic; |
| 281 | }; |
| 282 | |
Jeff Johnson | 72a4051 | 2013-12-19 10:14:15 -0800 | [diff] [blame] | 283 | extern spinlock_t hdd_context_lock; |
| 284 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 285 | #define STATS_CONTEXT_MAGIC 0x53544154 //STAT |
Jeff Johnson | 72a4051 | 2013-12-19 10:14:15 -0800 | [diff] [blame] | 286 | #define RSSI_CONTEXT_MAGIC 0x52535349 //RSSI |
| 287 | #define POWER_CONTEXT_MAGIC 0x504F5752 //POWR |
| 288 | #define SNR_CONTEXT_MAGIC 0x534E5200 //SNR |
c_hpothu | 9236791 | 2014-05-01 15:18:17 +0530 | [diff] [blame] | 289 | #define BCN_MISS_RATE_CONTEXT_MAGIC 0x513F5753 |
Satyanarayana Dash | 7280601 | 2014-12-02 14:30:08 +0530 | [diff] [blame] | 290 | #define FW_STATS_CONTEXT_MAGIC 0x5022474E //FW STATS |
Siddharth Bhal | 6424617 | 2015-02-27 01:04:37 +0530 | [diff] [blame] | 291 | #define GET_FRAME_LOG_MAGIC 0x464c4f47 //FLOG |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 292 | |
Ganesh Kondabattini | 2d7c7f0 | 2014-09-04 22:21:39 +0530 | [diff] [blame] | 293 | /* |
| 294 | * Driver miracast parameters 0-Disabled |
| 295 | * 1-Source, 2-Sink |
| 296 | */ |
| 297 | #define WLAN_HDD_DRIVER_MIRACAST_CFG_MIN_VAL 0 |
| 298 | #define WLAN_HDD_DRIVER_MIRACAST_CFG_MAX_VAL 2 |
| 299 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 300 | typedef struct hdd_tx_rx_stats_s |
| 301 | { |
| 302 | // start_xmit stats |
| 303 | __u32 txXmitCalled; |
| 304 | __u32 txXmitDropped; |
| 305 | __u32 txXmitBackPressured; |
| 306 | __u32 txXmitQueued; |
| 307 | __u32 txXmitClassifiedAC[NUM_TX_QUEUES]; |
| 308 | __u32 txXmitDroppedAC[NUM_TX_QUEUES]; |
| 309 | __u32 txXmitBackPressuredAC[NUM_TX_QUEUES]; |
| 310 | __u32 txXmitQueuedAC[NUM_TX_QUEUES]; |
| 311 | // fetch_cbk stats |
| 312 | __u32 txFetched; |
| 313 | __u32 txFetchedAC[NUM_TX_QUEUES]; |
| 314 | __u32 txFetchEmpty; |
| 315 | __u32 txFetchLowResources; |
| 316 | __u32 txFetchDequeueError; |
| 317 | __u32 txFetchDequeued; |
| 318 | __u32 txFetchDequeuedAC[NUM_TX_QUEUES]; |
| 319 | __u32 txFetchDePressured; |
| 320 | __u32 txFetchDePressuredAC[NUM_TX_QUEUES]; |
| 321 | // complete_cbk_stats |
| 322 | __u32 txCompleted; |
| 323 | // flush stats |
| 324 | __u32 txFlushed; |
| 325 | __u32 txFlushedAC[NUM_TX_QUEUES]; |
Ravi Joshi | 4191463 | 2013-10-21 23:02:21 -0700 | [diff] [blame] | 326 | // Deque depressure stats |
| 327 | __u32 txDequeDePressured; |
| 328 | __u32 txDequeDePressuredAC[NUM_TX_QUEUES]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 329 | // rx stats |
| 330 | __u32 rxChains; |
| 331 | __u32 rxPackets; |
| 332 | __u32 rxDropped; |
| 333 | __u32 rxDelivered; |
| 334 | __u32 rxRefused; |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 335 | __u32 pkt_tx_count; //TX pkt Counter used for dynamic splitscan |
| 336 | __u32 pkt_rx_count; //RX pkt Counter used for dynamic splitscan |
Dino Mycle | 3b9536d | 2014-07-09 22:05:24 +0530 | [diff] [blame] | 337 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
| 338 | __u32 txMcast[WIFI_AC_MAX]; |
| 339 | #endif |
Mihir Shete | f347369 | 2014-06-27 15:13:20 +0530 | [diff] [blame] | 340 | // tx timeout stats |
| 341 | __u32 txTimeoutCount; |
| 342 | __u32 continuousTxTimeoutCount; |
Mukul Sharma | 42b3d43 | 2014-10-16 16:13:40 +0530 | [diff] [blame] | 343 | v_ULONG_t jiffiesLastTxTimeOut;//Store time when last txtime out occur |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 344 | } hdd_tx_rx_stats_t; |
| 345 | |
| 346 | typedef struct hdd_chip_reset_stats_s |
| 347 | { |
| 348 | __u32 totalLogpResets; |
| 349 | __u32 totalCMD53Failures; |
| 350 | __u32 totalMutexReadFailures; |
| 351 | __u32 totalMIFErrorFailures; |
| 352 | __u32 totalFWHearbeatFailures; |
| 353 | __u32 totalUnknownExceptions; |
| 354 | } hdd_chip_reset_stats_t; |
| 355 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 356 | #ifdef WLAN_FEATURE_11W |
| 357 | typedef struct hdd_pmf_stats_s |
| 358 | { |
| 359 | uint8 numUnprotDeauthRx; |
| 360 | uint8 numUnprotDisassocRx; |
| 361 | } hdd_pmf_stats_t; |
| 362 | #endif |
| 363 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 364 | typedef struct hdd_stats_s |
| 365 | { |
| 366 | tCsrSummaryStatsInfo summary_stat; |
| 367 | tCsrGlobalClassAStatsInfo ClassA_stat; |
| 368 | tCsrGlobalClassBStatsInfo ClassB_stat; |
| 369 | tCsrGlobalClassCStatsInfo ClassC_stat; |
| 370 | tCsrGlobalClassDStatsInfo ClassD_stat; |
| 371 | tCsrPerStaStatsInfo perStaStats; |
| 372 | hdd_tx_rx_stats_t hddTxRxStats; |
| 373 | hdd_chip_reset_stats_t hddChipResetStats; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 374 | #ifdef WLAN_FEATURE_11W |
| 375 | hdd_pmf_stats_t hddPmfStats; |
| 376 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 377 | } hdd_stats_t; |
| 378 | |
| 379 | typedef enum |
| 380 | { |
| 381 | HDD_ROAM_STATE_NONE, |
| 382 | |
| 383 | // Issuing a disconnect due to transition into low power states. |
| 384 | HDD_ROAM_STATE_DISCONNECTING_POWER, |
| 385 | |
| 386 | // move to this state when HDD sets a key with SME/CSR. Note this is |
| 387 | // an important state to get right because we will get calls into our SME |
| 388 | // callback routine for SetKey activity that we did not initiate! |
| 389 | HDD_ROAM_STATE_SETTING_KEY, |
| 390 | } HDD_ROAM_STATE; |
| 391 | |
| 392 | typedef enum |
| 393 | { |
| 394 | eHDD_SUSPEND_NONE = 0, |
| 395 | eHDD_SUSPEND_DEEP_SLEEP, |
| 396 | eHDD_SUSPEND_STANDBY, |
| 397 | } hdd_ps_state_t; |
| 398 | |
| 399 | typedef struct roaming_info_s |
| 400 | { |
| 401 | HDD_ROAM_STATE roamingState; |
| 402 | vos_event_t roamingEvent; |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 403 | |
| 404 | tWlanHddMacAddr bssid; |
| 405 | tWlanHddMacAddr peerMac; |
| 406 | tANI_U32 roamId; |
| 407 | eRoamCmdStatus roamStatus; |
| 408 | v_BOOL_t deferKeyComplete; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 409 | |
| 410 | } roaming_info_t; |
| 411 | |
| 412 | #ifdef FEATURE_WLAN_WAPI |
| 413 | /* Define WAPI macros for Length, BKID count etc*/ |
| 414 | #define MAX_WPI_KEY_LENGTH 16 |
| 415 | #define MAX_NUM_PN 16 |
| 416 | #define MAC_ADDR_LEN 6 |
| 417 | #define MAX_ADDR_INDEX 12 |
| 418 | #define MAX_NUM_AKM_SUITES 16 |
| 419 | #define MAX_NUM_UNI_SUITES 16 |
| 420 | #define MAX_NUM_BKIDS 16 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 421 | |
| 422 | /** WAPI AUTH mode definition */ |
| 423 | enum _WAPIAuthMode |
| 424 | { |
| 425 | WAPI_AUTH_MODE_OPEN = 0, |
| 426 | WAPI_AUTH_MODE_PSK = 1, |
| 427 | WAPI_AUTH_MODE_CERT |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 428 | } __packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 429 | typedef enum _WAPIAuthMode WAPIAuthMode; |
| 430 | |
| 431 | /** WAPI Work mode structure definition */ |
| 432 | #define WZC_ORIGINAL 0 |
| 433 | #define WAPI_EXTENTION 1 |
| 434 | |
| 435 | struct _WAPI_FUNCTION_MODE |
| 436 | { |
| 437 | unsigned char wapiMode; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 438 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 439 | |
| 440 | typedef struct _WAPI_FUNCTION_MODE WAPI_FUNCTION_MODE; |
| 441 | |
| 442 | typedef struct _WAPI_BKID |
| 443 | { |
| 444 | v_U8_t bkid[16]; |
| 445 | }WAPI_BKID, *pWAPI_BKID; |
| 446 | |
| 447 | /** WAPI Association information structure definition */ |
| 448 | struct _WAPI_AssocInfo |
| 449 | { |
| 450 | v_U8_t elementID; |
| 451 | v_U8_t length; |
| 452 | v_U16_t version; |
| 453 | v_U16_t akmSuiteCount; |
| 454 | v_U32_t akmSuite[MAX_NUM_AKM_SUITES]; |
| 455 | v_U16_t unicastSuiteCount; |
| 456 | v_U32_t unicastSuite[MAX_NUM_UNI_SUITES]; |
| 457 | v_U32_t multicastSuite; |
| 458 | v_U16_t wapiCability; |
| 459 | v_U16_t bkidCount; |
| 460 | WAPI_BKID bkidList[MAX_NUM_BKIDS]; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 461 | } __packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 462 | |
| 463 | typedef struct _WAPI_AssocInfo WAPI_AssocInfo; |
| 464 | typedef struct _WAPI_AssocInfo *pWAPI_IEAssocInfo; |
| 465 | |
| 466 | /** WAPI KEY Type definition */ |
| 467 | enum _WAPIKeyType |
| 468 | { |
| 469 | PAIRWISE_KEY, //0 |
| 470 | GROUP_KEY //1 |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 471 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 472 | typedef enum _WAPIKeyType WAPIKeyType; |
| 473 | |
| 474 | /** WAPI KEY Direction definition */ |
| 475 | enum _KEY_DIRECTION |
| 476 | { |
| 477 | None, |
| 478 | Rx, |
| 479 | Tx, |
| 480 | Rx_Tx |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 481 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 482 | |
| 483 | typedef enum _KEY_DIRECTION WAPI_KEY_DIRECTION; |
| 484 | |
| 485 | /** WAPI KEY stucture definition */ |
| 486 | struct WLAN_WAPI_KEY |
| 487 | { |
| 488 | WAPIKeyType keyType; |
| 489 | WAPI_KEY_DIRECTION keyDirection; /*reserved for future use*/ |
| 490 | v_U8_t keyId; |
| 491 | v_U8_t addrIndex[MAX_ADDR_INDEX]; /*reserved for future use*/ |
| 492 | int wpiekLen; |
| 493 | v_U8_t wpiek[MAX_WPI_KEY_LENGTH]; |
| 494 | int wpickLen; |
| 495 | v_U8_t wpick[MAX_WPI_KEY_LENGTH]; |
| 496 | v_U8_t pn[MAX_NUM_PN]; /*reserved for future use*/ |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 497 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 498 | |
| 499 | typedef struct WLAN_WAPI_KEY WLAN_WAPI_KEY; |
| 500 | typedef struct WLAN_WAPI_KEY *pWLAN_WAPI_KEY; |
| 501 | |
| 502 | #define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) |
vamsi | 9bd92b7 | 2013-12-26 14:11:29 +0530 | [diff] [blame] | 503 | #define WPA_GET_BE24(a) ((u32) ( (a[0] << 16) | (a[1] << 8) | a[2])) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 504 | #define WLAN_EID_WAPI 68 |
| 505 | #define WAPI_PSK_AKM_SUITE 0x02721400 |
| 506 | #define WAPI_CERT_AKM_SUITE 0x01721400 |
| 507 | |
| 508 | /** WAPI BKID List stucture definition */ |
| 509 | struct _WLAN_BKID_LIST |
| 510 | { |
| 511 | v_U32_t length; |
| 512 | v_U32_t BKIDCount; |
| 513 | WAPI_BKID BKID[1]; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 514 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 515 | |
| 516 | typedef struct _WLAN_BKID_LIST WLAN_BKID_LIST; |
| 517 | typedef struct _WLAN_BKID_LIST *pWLAN_BKID_LIST; |
| 518 | |
| 519 | |
| 520 | /** WAPI Information stucture definition */ |
| 521 | struct hdd_wapi_info_s |
| 522 | { |
| 523 | v_U32_t nWapiMode; |
| 524 | v_BOOL_t fIsWapiSta; |
| 525 | v_MACADDR_t cachedMacAddr; |
| 526 | v_UCHAR_t wapiAuthMode; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 527 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 528 | typedef struct hdd_wapi_info_s hdd_wapi_info_t; |
| 529 | #endif /* FEATURE_WLAN_WAPI */ |
| 530 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 531 | typedef struct beacon_data_s { |
| 532 | u8 *head, *tail; |
| 533 | int head_len, tail_len; |
| 534 | int dtim_period; |
| 535 | } beacon_data_t; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 536 | |
| 537 | typedef enum device_mode |
| 538 | { /* MAINTAIN 1 - 1 CORRESPONDENCE WITH tVOS_CON_MODE*/ |
| 539 | WLAN_HDD_INFRA_STATION, |
| 540 | WLAN_HDD_SOFTAP, |
| 541 | WLAN_HDD_P2P_CLIENT, |
| 542 | WLAN_HDD_P2P_GO, |
Jeff Johnson | 88ba774 | 2013-02-27 14:36:02 -0800 | [diff] [blame] | 543 | WLAN_HDD_MONITOR, |
| 544 | WLAN_HDD_FTM, |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 545 | WLAN_HDD_IBSS, |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 546 | WLAN_HDD_P2P_DEVICE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 547 | }device_mode_t; |
| 548 | |
| 549 | typedef enum rem_on_channel_request_type |
| 550 | { |
| 551 | REMAIN_ON_CHANNEL_REQUEST, |
| 552 | OFF_CHANNEL_ACTION_TX, |
| 553 | }rem_on_channel_request_type_t; |
| 554 | |
| 555 | /* Thermal mitigation Level Enum Type */ |
| 556 | typedef enum |
| 557 | { |
| 558 | WLAN_HDD_TM_LEVEL_0, |
| 559 | WLAN_HDD_TM_LEVEL_1, |
| 560 | WLAN_HDD_TM_LEVEL_2, |
| 561 | WLAN_HDD_TM_LEVEL_3, |
| 562 | WLAN_HDD_TM_LEVEL_4, |
| 563 | WLAN_HDD_TM_LEVEL_MAX |
| 564 | } WLAN_TmLevelEnumType; |
| 565 | |
Mihir Shete | 1815629 | 2014-03-11 15:38:30 +0530 | [diff] [blame] | 566 | typedef enum |
| 567 | { |
| 568 | WLAN_HDD_NO_LOAD_UNLOAD_IN_PROGRESS = 0 , |
| 569 | WLAN_HDD_LOAD_IN_PROGRESS = 1<<0, |
| 570 | WLAN_HDD_UNLOAD_IN_PROGRESS = 1<<1, |
| 571 | }load_unload_sequence; |
| 572 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 573 | /* Driver Action based on thermal mitigation level structure */ |
| 574 | typedef struct |
| 575 | { |
| 576 | v_BOOL_t ampduEnable; |
| 577 | v_BOOL_t enterImps; |
| 578 | v_U32_t txSleepDuration; |
| 579 | v_U32_t txOperationDuration; |
| 580 | v_U32_t txBlockFrameCountThreshold; |
| 581 | } hdd_tmLevelAction_t; |
| 582 | |
| 583 | /* Thermal Mitigation control context structure */ |
| 584 | typedef struct |
| 585 | { |
| 586 | WLAN_TmLevelEnumType currentTmLevel; |
| 587 | hdd_tmLevelAction_t tmAction; |
| 588 | vos_timer_t txSleepTimer; |
| 589 | struct mutex tmOperationLock; |
| 590 | vos_event_t setTmDoneEvent; |
| 591 | v_U32_t txFrameCount; |
| 592 | v_TIME_t lastblockTs; |
| 593 | v_TIME_t lastOpenTs; |
| 594 | struct netdev_queue *blockedQueue; |
Leo Chang | 50bbd25 | 2013-04-25 14:58:01 -0700 | [diff] [blame] | 595 | v_BOOL_t qBlocked; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 596 | } hdd_thermal_mitigation_info_t; |
Kaushik, Sushant | 7005e37 | 2014-04-08 11:36:54 +0530 | [diff] [blame] | 597 | typedef struct action_pkt_buffer |
| 598 | { |
| 599 | tANI_U8* frame_ptr; |
| 600 | tANI_U32 frame_length; |
| 601 | tANI_U16 freq; |
| 602 | }action_pkt_buffer_t; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 603 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 604 | typedef struct hdd_remain_on_chan_ctx |
| 605 | { |
| 606 | struct net_device *dev; |
| 607 | struct ieee80211_channel chan; |
| 608 | enum nl80211_channel_type chan_type; |
| 609 | unsigned int duration; |
| 610 | u64 cookie; |
| 611 | rem_on_channel_request_type_t rem_on_chan_request; |
Kaushik, Sushant | 7005e37 | 2014-04-08 11:36:54 +0530 | [diff] [blame] | 612 | vos_timer_t hdd_remain_on_chan_timer; |
| 613 | action_pkt_buffer_t action_pkt_buff; |
| 614 | v_U32_t hdd_remain_on_chan_cancel_in_progress; |
Sushant Kaushik | 5ad9b7b | 2014-05-21 21:09:43 +0530 | [diff] [blame] | 615 | tANI_BOOLEAN is_pending_roc_cancelled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 616 | }hdd_remain_on_chan_ctx_t; |
| 617 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 618 | typedef enum{ |
| 619 | HDD_IDLE, |
| 620 | HDD_PD_REQ_ACK_PENDING, |
| 621 | HDD_GO_NEG_REQ_ACK_PENDING, |
| 622 | HDD_INVALID_STATE, |
| 623 | }eP2PActionFrameState; |
| 624 | |
| 625 | typedef enum { |
| 626 | WLAN_HDD_GO_NEG_REQ, |
| 627 | WLAN_HDD_GO_NEG_RESP, |
| 628 | WLAN_HDD_GO_NEG_CNF, |
| 629 | WLAN_HDD_INVITATION_REQ, |
| 630 | WLAN_HDD_INVITATION_RESP, |
| 631 | WLAN_HDD_DEV_DIS_REQ, |
| 632 | WLAN_HDD_DEV_DIS_RESP, |
| 633 | WLAN_HDD_PROV_DIS_REQ, |
| 634 | WLAN_HDD_PROV_DIS_RESP, |
Mukul Sharma | 1e5d0b7 | 2014-07-01 19:22:21 +0530 | [diff] [blame] | 635 | WLAN_HDD_ACTION_FRM_TYPE_MAX = 255, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 636 | }tActionFrmType; |
| 637 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 638 | typedef struct hdd_cfg80211_state_s |
| 639 | { |
| 640 | tANI_U16 current_freq; |
| 641 | u64 action_cookie; |
| 642 | tANI_U8 *buf; |
| 643 | size_t len; |
| 644 | struct sk_buff *skb; |
| 645 | hdd_remain_on_chan_ctx_t* remain_on_chan_ctx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 646 | eP2PActionFrameState actionFrmState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 647 | }hdd_cfg80211_state_t; |
| 648 | |
Madan Mohan Koyyalamudi | b5da533 | 2012-10-15 17:23:21 -0700 | [diff] [blame] | 649 | |
| 650 | typedef enum{ |
| 651 | HDD_SSR_NOT_REQUIRED, |
| 652 | HDD_SSR_REQUIRED, |
| 653 | HDD_SSR_DISABLED, |
| 654 | }e_hdd_ssr_required; |
| 655 | |
Katya Nigam | 77fcf58 | 2015-02-09 16:48:24 +0530 | [diff] [blame] | 656 | /*--------------------------------------------------------------------------- |
| 657 | hdd_ibss_peer_info_params_t |
| 658 | ---------------------------------------------------------------------------*/ |
| 659 | typedef struct |
| 660 | { |
| 661 | v_U8_t staIdx; //StaIdx |
| 662 | v_U32_t txRate; //Current Tx Rate |
| 663 | v_U32_t mcsIndex; //MCS Index |
| 664 | v_U32_t txRateFlags; //TxRate Flags |
| 665 | v_S7_t rssi; //RSSI |
| 666 | }hdd_ibss_peer_info_params_t; |
| 667 | |
| 668 | typedef struct { |
| 669 | /** The station entry is used or not */ |
| 670 | v_BOOL_t isUsed; |
| 671 | |
| 672 | /** Station ID reported back from HAL. Broadcast |
| 673 | * uses station ID zero by default. */ |
| 674 | v_U8_t ucSTAId; |
| 675 | |
| 676 | /** MAC address of the station */ |
| 677 | v_MACADDR_t macAddrSTA; |
| 678 | |
| 679 | /** Current Station state so HDD knows how to deal with packet |
| 680 | * queue. Most recent states used to change TL STA state. */ |
| 681 | WLANTL_STAStateType tlSTAState; |
| 682 | |
| 683 | /** Transmit queues for each AC (VO,VI,BE etc). */ |
| 684 | hdd_list_t wmm_tx_queue[NUM_TX_QUEUES]; |
| 685 | |
| 686 | /** Might need to differentiate queue depth in contention case */ |
| 687 | v_U16_t aTxQueueDepth[NUM_TX_QUEUES]; |
| 688 | |
| 689 | /**Track whether OS TX queue has been disabled.*/ |
| 690 | v_BOOL_t txSuspended[NUM_TX_QUEUES]; |
| 691 | |
| 692 | /** Track QoS status of station */ |
| 693 | v_BOOL_t isQosEnabled; |
| 694 | |
| 695 | /** The station entry for which Deauth is in progress */ |
| 696 | v_BOOL_t isDeauthInProgress; |
| 697 | |
| 698 | } hdd_ibss_station_info_t; |
| 699 | |
| 700 | typedef struct |
| 701 | { |
| 702 | /** Request status */ |
| 703 | v_U32_t status; |
| 704 | |
| 705 | /** Number of peers */ |
| 706 | v_U8_t numIBSSPeers; |
| 707 | |
| 708 | /* IBSS Station table */ |
| 709 | hdd_ibss_station_info_t ibssStaInfo[HDD_MAX_NUM_IBSS_STA]; |
| 710 | |
| 711 | /** Peer Info parameters */ |
| 712 | hdd_ibss_peer_info_params_t ibssPeerList[HDD_MAX_NUM_IBSS_STA]; |
| 713 | }hdd_ibss_peer_info_t; |
| 714 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 715 | struct hdd_station_ctx |
| 716 | { |
| 717 | /** Handle to the Wireless Extension State */ |
| 718 | hdd_wext_state_t WextState; |
| 719 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 720 | #ifdef FEATURE_WLAN_TDLS |
| 721 | tdlsCtx_t *pHddTdlsCtx; |
| 722 | #endif |
| 723 | |
| 724 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 725 | /**Connection information*/ |
| 726 | connection_info_t conn_info; |
| 727 | |
| 728 | roaming_info_t roam_info; |
| 729 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 730 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_ESE) || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 731 | int ft_carrier_on; |
| 732 | #endif |
Gopichand Nakkala | 870cbae | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 733 | |
| 734 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 735 | tSirGtkOffloadParams gtkOffloadReqParams; |
Gopichand Nakkala | 870cbae | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 736 | #endif |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 737 | /*Increment whenever ibss New peer joins and departs the network */ |
| 738 | int ibss_sta_generation; |
Shailender Karmuchi | 642e981 | 2013-05-30 14:34:49 -0700 | [diff] [blame] | 739 | |
| 740 | /*Save the wep/wpa-none keys*/ |
| 741 | tCsrRoamSetKey ibss_enc_key; |
Srinivas Girigowda | 66c05eb | 2013-07-14 13:06:01 -0700 | [diff] [blame] | 742 | |
Katya Nigam | 77fcf58 | 2015-02-09 16:48:24 +0530 | [diff] [blame] | 743 | hdd_ibss_peer_info_t ibss_peer_info; |
| 744 | |
Srinivas Girigowda | 66c05eb | 2013-07-14 13:06:01 -0700 | [diff] [blame] | 745 | v_BOOL_t hdd_ReassocScenario; |
Agarwal Ashish | 3da9524 | 2014-05-21 14:57:17 +0530 | [diff] [blame] | 746 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 747 | }; |
| 748 | |
| 749 | #define BSS_STOP 0 |
| 750 | #define BSS_START 1 |
| 751 | typedef struct hdd_hostapd_state_s |
| 752 | { |
| 753 | int bssState; |
| 754 | vos_event_t vosEvent; |
| 755 | VOS_STATUS vosStatus; |
| 756 | v_BOOL_t bCommit; |
| 757 | |
| 758 | } hdd_hostapd_state_t; |
| 759 | |
| 760 | |
| 761 | /* |
| 762 | * Per station structure kept in HDD for multiple station support for SoftAP |
| 763 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 764 | |
| 765 | struct hdd_ap_ctx_s |
| 766 | { |
| 767 | hdd_hostapd_state_t HostapdState; |
| 768 | |
| 769 | // Memory differentiation mode is enabled |
| 770 | //v_U16_t uMemoryDiffThreshold; |
| 771 | //v_U8_t uNumActiveAC; |
| 772 | //v_U8_t uActiveACMask; |
| 773 | //v_U8_t aTxQueueLimit[NUM_TX_QUEUES]; |
| 774 | |
| 775 | /** Packet Count to update uNumActiveAC and uActiveACMask */ |
| 776 | //v_U16_t uUpdatePktCount; |
| 777 | |
| 778 | /** Station ID assigned after BSS starts */ |
| 779 | v_U8_t uBCStaId; |
| 780 | |
| 781 | v_U8_t uPrivacy; // The privacy bits of configuration |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 782 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 783 | tSirWPSPBCProbeReq WPSPBCProbeReq; |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 784 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 785 | tsap_Config_t sapConfig; |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 786 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 787 | struct semaphore semWpsPBCOverlapInd; |
| 788 | |
| 789 | v_BOOL_t apDisableIntraBssFwd; |
| 790 | |
| 791 | vos_timer_t hdd_ap_inactivity_timer; |
| 792 | |
| 793 | v_U8_t operatingChannel; |
| 794 | |
| 795 | v_BOOL_t uIsAuthenticated; |
| 796 | |
| 797 | eCsrEncryptionType ucEncryptType; |
| 798 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 799 | //This will point to group key data, if it is received before start bss. |
| 800 | tCsrRoamSetKey groupKey; |
| 801 | // This will have WEP key data, if it is received before start bss |
| 802 | tCsrRoamSetKey wepKey[CSR_MAX_NUM_KEY]; |
| 803 | |
| 804 | beacon_data_t *beacon; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 805 | }; |
| 806 | |
Katya Nigam | e7b69a8 | 2015-04-28 15:24:06 +0530 | [diff] [blame] | 807 | #define NUM_FILTERS_SUPPORTED 1 |
| 808 | struct filter |
| 809 | { |
| 810 | v_MACADDR_t macAddr; |
| 811 | v_BOOL_t isA1filter; |
| 812 | v_BOOL_t isA2filter; |
| 813 | v_BOOL_t isA3filter; |
| 814 | }; |
| 815 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 816 | struct hdd_mon_ctx_s |
| 817 | { |
Katya Nigam | e7b69a8 | 2015-04-28 15:24:06 +0530 | [diff] [blame] | 818 | /* start or stop */ |
| 819 | v_BOOL_t state; |
| 820 | /*Conversion of packet required or not*/ |
| 821 | v_BOOL_t is80211to803ConReq; |
| 822 | v_U32_t ChannelNo; |
| 823 | v_U32_t ChannelBW; |
| 824 | v_BOOL_t crcCheckEnabled; |
| 825 | v_U8_t numOfMacFilters; |
| 826 | struct filter mmFilters[NUM_FILTERS_SUPPORTED]; |
| 827 | v_U64_t typeSubtypeBitmap; |
| 828 | v_U64_t rsvd; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 829 | }; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 830 | |
| 831 | typedef struct hdd_scaninfo_s |
| 832 | { |
| 833 | /* The scan id */ |
| 834 | v_U32_t scanId; |
| 835 | |
| 836 | /* The scan pending */ |
| 837 | v_U32_t mScanPending; |
| 838 | |
Kiet Lam | ac06e2c | 2013-10-23 16:25:07 +0530 | [diff] [blame] | 839 | /* Counter for mScanPending so that the scan pending |
| 840 | error log is not printed for more than 5 times */ |
| 841 | v_U32_t mScanPendingCounter; |
| 842 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 843 | /* Client Wait Scan Result */ |
| 844 | v_U32_t waitScanResult; |
| 845 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 846 | /* Additional IE for scan */ |
| 847 | tSirAddie scanAddIE; |
| 848 | |
| 849 | /* Scan mode*/ |
| 850 | tSirScanType scan_mode; |
| 851 | |
| 852 | /* Scan Completion Event */ |
| 853 | struct completion scan_req_completion_event; |
| 854 | |
Madan Mohan Koyyalamudi | f4e8100 | 2012-11-13 10:46:38 -0800 | [diff] [blame] | 855 | /* completion variable for abortscan */ |
| 856 | struct completion abortscan_event_var; |
| 857 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 858 | vos_event_t scan_finished_event; |
| 859 | |
| 860 | hdd_scan_pending_option_e scan_pending_option; |
Kaushik, Sushant | 4975a57 | 2014-10-21 16:07:48 +0530 | [diff] [blame] | 861 | tANI_U8 sessionId; |
Agarwal Ashish | bd3e10b | 2014-11-24 19:19:46 +0530 | [diff] [blame] | 862 | /* time to store last station scan done. */ |
| 863 | v_TIME_t last_scan_timestamp; |
| 864 | tANI_U8 last_scan_channelList[WNI_CFG_VALID_CHANNEL_LIST_LEN]; |
| 865 | tANI_U8 last_scan_numChannels; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 866 | |
| 867 | }hdd_scaninfo_t; |
| 868 | |
Siddharth Bhal | 34d48ae | 2014-03-26 17:42:21 +0530 | [diff] [blame] | 869 | /* Changing value from 10 to 240, as later is |
| 870 | supported by wcnss */ |
| 871 | #define WLAN_HDD_MAX_MC_ADDR_LIST 240 |
Gopichand Nakkala | 0f27681 | 2013-02-24 14:45:51 +0530 | [diff] [blame] | 872 | |
| 873 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 874 | typedef struct multicast_addr_list |
| 875 | { |
| 876 | v_U8_t isFilterApplied; |
| 877 | v_U8_t mc_cnt; |
| 878 | v_U8_t addr[WLAN_HDD_MAX_MC_ADDR_LIST][ETH_ALEN]; |
| 879 | } t_multicast_add_list; |
| 880 | #endif |
| 881 | |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 882 | #ifdef FEATURE_WLAN_BATCH_SCAN |
| 883 | |
| 884 | /*Batch scan repsonse AP info*/ |
| 885 | typedef struct |
| 886 | { |
| 887 | /*Batch ID*/ |
| 888 | tANI_U32 batchId; |
| 889 | /*is it last AP in GET BATCH SCAN RSP*/ |
| 890 | v_BOOL_t isLastAp; |
| 891 | /*BSSID*/ |
| 892 | tANI_U8 bssid[SIR_MAC_ADDR_LEN]; |
| 893 | /*SSID*/ |
Rajeev Kumar | 1f7759a | 2014-01-23 15:21:47 -0800 | [diff] [blame] | 894 | tANI_U8 ssid[SIR_MAX_SSID_SIZE + 1]; |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 895 | /*Channel*/ |
| 896 | tANI_U8 ch; |
| 897 | /*RSSI or Level*/ |
c_hpothu | be95520 | 2014-05-22 18:07:00 +0530 | [diff] [blame] | 898 | tANI_S8 rssi; |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 899 | /*Age*/ |
| 900 | tANI_U32 age; |
| 901 | }tHDDbatchScanRspApInfo; |
| 902 | |
| 903 | /*Batch scan response list*/ |
| 904 | struct tHDDBatchScanRspList |
| 905 | { |
| 906 | tHDDbatchScanRspApInfo ApInfo; |
| 907 | struct tHDDBatchScanRspList *pNext; |
| 908 | }; |
| 909 | |
| 910 | typedef struct tHDDBatchScanRspList tHddBatchScanRsp; |
Rajeev Kumar | 20140c1 | 2013-10-21 19:39:02 -0700 | [diff] [blame] | 911 | |
| 912 | /*Batch Scan state*/ |
| 913 | typedef enum |
| 914 | { |
| 915 | /*Batch scan is started this means WLS_BATCHING SET command is issued |
| 916 | from framework*/ |
| 917 | eHDD_BATCH_SCAN_STATE_STARTED, |
| 918 | |
| 919 | /*Batch scan is stopped this means WLS_BATCHING STOP command is issued |
| 920 | from framework*/ |
| 921 | eHDD_BATCH_SCAN_STATE_STOPPED, |
| 922 | |
| 923 | eHDD_BATCH_SCAN_STATE_MAX, |
| 924 | } eHDD_BATCH_SCAN_STATE; |
| 925 | |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 926 | #endif |
| 927 | |
Satyanarayana Dash | 7280601 | 2014-12-02 14:30:08 +0530 | [diff] [blame] | 928 | typedef struct |
| 929 | { |
| 930 | struct completion completion; |
| 931 | tANI_U32 magic; |
| 932 | hdd_adapter_t *pAdapter; |
| 933 | }fwStatsContext_t; |
| 934 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 935 | #define WLAN_HDD_ADAPTER_MAGIC 0x574c414e //ASCII "WLAN" |
Agarwal Ashish | 3da9524 | 2014-05-21 14:57:17 +0530 | [diff] [blame] | 936 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 937 | struct hdd_adapter_s |
| 938 | { |
| 939 | void *pHddCtx; |
| 940 | |
| 941 | device_mode_t device_mode; |
| 942 | |
| 943 | /** Handle to the network device */ |
| 944 | struct net_device *dev; |
Vinay Krishna Eranna | d5b2be2 | 2013-12-01 17:00:15 +0530 | [diff] [blame] | 945 | |
| 946 | #ifdef WLAN_NS_OFFLOAD |
| 947 | /** IPv6 notifier callback for handling NS offload on change in IP */ |
Vinay Krishna Eranna | d5b2be2 | 2013-12-01 17:00:15 +0530 | [diff] [blame] | 948 | struct work_struct ipv6NotifierWorkQueue; |
| 949 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 950 | |
Vinay Krishna Eranna | 4d055d4 | 2013-12-17 17:02:01 +0530 | [diff] [blame] | 951 | /** IPv4 notifier callback for handling ARP offload on change in IP */ |
Vinay Krishna Eranna | 4d055d4 | 2013-12-17 17:02:01 +0530 | [diff] [blame] | 952 | struct work_struct ipv4NotifierWorkQueue; |
| 953 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 954 | //TODO Move this to sta Ctx |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 955 | struct wireless_dev wdev ; |
| 956 | struct cfg80211_scan_request *request ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 957 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 958 | /** ops checks if Opportunistic Power Save is Enable or Not |
| 959 | * ctw stores ctWindow value once we receive Opps command from |
| 960 | * wpa_supplicant then using ctWindow value we need to Enable |
| 961 | * Opportunistic Power Save |
| 962 | */ |
| 963 | tANI_U8 ops; |
| 964 | tANI_U32 ctw; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 965 | |
| 966 | /** Current MAC Address for the adapter */ |
| 967 | v_MACADDR_t macAddressCurrent; |
| 968 | |
| 969 | /**Event Flags*/ |
| 970 | unsigned long event_flags; |
| 971 | |
| 972 | /**Device TX/RX statistics*/ |
| 973 | struct net_device_stats stats; |
| 974 | /** HDD statistics*/ |
| 975 | hdd_stats_t hdd_stats; |
| 976 | /**Mib information*/ |
| 977 | sHddMib_t hdd_mib; |
| 978 | |
| 979 | tANI_U8 sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 980 | |
| 981 | /* Completion variable for session close */ |
| 982 | struct completion session_close_comp_var; |
| 983 | |
| 984 | /* Completion variable for session open */ |
| 985 | struct completion session_open_comp_var; |
| 986 | |
| 987 | //TODO: move these to sta ctx. These may not be used in AP |
| 988 | /** completion variable for disconnect callback */ |
| 989 | struct completion disconnect_comp_var; |
| 990 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 991 | /** Completion of change country code */ |
| 992 | struct completion change_country_code; |
| 993 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 994 | /* completion variable for Linkup Event */ |
| 995 | struct completion linkup_event_var; |
| 996 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 997 | /* completion variable for cancel remain on channel Event */ |
| 998 | struct completion cancel_rem_on_chan_var; |
| 999 | |
Vinay Krishna Eranna | f0e523b | 2014-03-01 21:00:16 +0530 | [diff] [blame] | 1000 | /** completion variable for PNO req callback */ |
| 1001 | struct completion pno_comp_var; |
| 1002 | int pno_req_status; |
| 1003 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1004 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) |
| 1005 | /* completion variable for off channel remain on channel Event */ |
| 1006 | struct completion offchannel_tx_event; |
| 1007 | #endif |
| 1008 | /* Completion variable for action frame */ |
| 1009 | struct completion tx_action_cnf_event; |
| 1010 | /* Completion variable for remain on channel ready */ |
| 1011 | struct completion rem_on_chan_ready_event; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1012 | |
Jeff Johnson | 9efb9aa | 2013-03-15 13:59:27 -0700 | [diff] [blame] | 1013 | /* Completion variable for Upper Layer Authentication */ |
| 1014 | struct completion ula_complete; |
| 1015 | |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 1016 | #ifdef FEATURE_WLAN_TDLS |
| 1017 | struct completion tdls_add_station_comp; |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 1018 | struct completion tdls_del_station_comp; |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 1019 | struct completion tdls_mgmt_comp; |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1020 | struct completion tdls_link_establish_req_comp; |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 1021 | eHalStatus tdlsAddStaStatus; |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 1022 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1023 | /* Track whether the linkup handling is needed */ |
| 1024 | v_BOOL_t isLinkUpSvcNeeded; |
| 1025 | |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 1026 | /* Mgmt Frames TX completion status code */ |
| 1027 | tANI_U32 mgmtTxCompletionStatus; |
| 1028 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1029 | /************************************************************* |
| 1030 | * Tx Queues |
| 1031 | */ |
| 1032 | /** Transmit queues for each AC (VO,VI,BE etc) */ |
| 1033 | hdd_list_t wmm_tx_queue[NUM_TX_QUEUES]; |
| 1034 | /**Track whether VOS is in a low resource state*/ |
| 1035 | v_BOOL_t isVosOutOfResource; |
Madan Mohan Koyyalamudi | fd3b7a9 | 2013-10-10 15:02:58 +0530 | [diff] [blame] | 1036 | |
| 1037 | /**Track whether 3/4th of resources are used */ |
| 1038 | v_BOOL_t isVosLowResource; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1039 | |
| 1040 | /**Track whether OS TX queue has been disabled.*/ |
| 1041 | v_BOOL_t isTxSuspended[NUM_TX_QUEUES]; |
| 1042 | |
| 1043 | /** WMM Status */ |
| 1044 | hdd_wmm_status_t hddWmmStatus; |
| 1045 | /************************************************************* |
| 1046 | */ |
| 1047 | /************************************************************* |
| 1048 | * TODO - Remove it later |
| 1049 | */ |
| 1050 | /** Multiple station supports */ |
| 1051 | /** Per-station structure */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1052 | //v_U8_t uNumActiveStation; |
| 1053 | |
| 1054 | v_U16_t aTxQueueLimit[NUM_TX_QUEUES]; |
| 1055 | /************************************************************* |
| 1056 | */ |
| 1057 | |
| 1058 | #ifdef FEATURE_WLAN_WAPI |
| 1059 | hdd_wapi_info_t wapi_info; |
| 1060 | #endif |
| 1061 | |
| 1062 | v_S7_t rssi; |
Madan Mohan Koyyalamudi | d9383fd | 2013-08-13 09:27:30 +0530 | [diff] [blame] | 1063 | |
| 1064 | tANI_U8 snr; |
| 1065 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1066 | struct work_struct monTxWorkQueue; |
| 1067 | struct sk_buff *skb_to_tx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1068 | |
| 1069 | union { |
| 1070 | hdd_station_ctx_t station; |
| 1071 | hdd_ap_ctx_t ap; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1072 | hdd_mon_ctx_t monitor; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1073 | }sessionCtx; |
| 1074 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1075 | hdd_cfg80211_state_t cfg80211State; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1076 | |
Gopichand Nakkala | 0f27681 | 2013-02-24 14:45:51 +0530 | [diff] [blame] | 1077 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 1078 | t_multicast_add_list mc_addr_list; |
| 1079 | #endif |
| 1080 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1081 | //Magic cookie for adapter sanity verification |
| 1082 | v_U32_t magic; |
| 1083 | v_BOOL_t higherDtimTransition; |
Madan Mohan Koyyalamudi | d9383fd | 2013-08-13 09:27:30 +0530 | [diff] [blame] | 1084 | v_BOOL_t survey_idx; |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 1085 | |
| 1086 | #ifdef FEATURE_WLAN_BATCH_SCAN |
| 1087 | /*Completion variable for set batch scan request*/ |
| 1088 | struct completion hdd_set_batch_scan_req_var; |
| 1089 | /*Completion variable for get batch scan request*/ |
| 1090 | struct completion hdd_get_batch_scan_req_var; |
| 1091 | /*HDD batch scan lock*/ |
| 1092 | struct mutex hdd_batch_scan_lock; |
| 1093 | /*HDD set batch scan request*/ |
| 1094 | tSirSetBatchScanReq hddSetBatchScanReq; |
| 1095 | /*HDD set batch scan response*/ |
| 1096 | tSirSetBatchScanRsp hddSetBatchScanRsp; |
| 1097 | /*HDD stop batch scan indication*/ |
| 1098 | tSirStopBatchScanInd hddStopBatchScanInd; |
| 1099 | /*HDD get batch scan request*/ |
| 1100 | tSirTriggerBatchScanResultInd hddTriggerBatchScanResultInd; |
| 1101 | /*Batched scan reponse queue: new batch scan results added at the tail |
| 1102 | and old batch scan results are deleted from head*/ |
| 1103 | tHddBatchScanRsp *pBatchScanRsp; |
| 1104 | /*No of scans in batch scan rsp(MSCAN)*/ |
| 1105 | v_U32_t numScanList; |
| 1106 | /*isTruncated = 1 batch scan rsp is truncated |
| 1107 | isTruncated = 0 batch scan rsp is complete*/ |
| 1108 | v_BOOL_t isTruncated; |
| 1109 | /*Wait for get batch scan response from FW or not*/ |
| 1110 | volatile v_BOOL_t hdd_wait_for_get_batch_scan_rsp; |
| 1111 | /*Wait for set batch scan response from FW or not*/ |
| 1112 | volatile v_BOOL_t hdd_wait_for_set_batch_scan_rsp; |
| 1113 | /*Previous batch scan ID*/ |
| 1114 | v_U32_t prev_batch_id; |
Rajeev Kumar | 20140c1 | 2013-10-21 19:39:02 -0700 | [diff] [blame] | 1115 | /*Batch scan state*/ |
| 1116 | eHDD_BATCH_SCAN_STATE batchScanState; |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 1117 | #endif |
| 1118 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1119 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1120 | tAniTrafStrmMetrics tsmStats; |
| 1121 | #endif |
Kiet Lam | f040f47 | 2013-11-20 21:15:23 +0530 | [diff] [blame] | 1122 | /* Flag to ensure PSB is configured through framework */ |
| 1123 | v_U8_t psbChanged; |
| 1124 | /* UAPSD psb value configured through framework */ |
| 1125 | v_U8_t configuredPsb; |
Kaushik, Sushant | 7005e37 | 2014-04-08 11:36:54 +0530 | [diff] [blame] | 1126 | v_BOOL_t is_roc_inprogress; |
c_hpothu | 44ff4e0 | 2014-05-08 00:13:57 +0530 | [diff] [blame] | 1127 | v_U32_t maxRateFlags; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 1128 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
| 1129 | v_BOOL_t isLinkLayerStatsSet; |
| 1130 | #endif |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 1131 | /* DSCP to UP QoS Mapping */ |
| 1132 | sme_QosWmmUpType hddWmmDscpToUpMap[WLAN_HDD_MAX_DSCP+1]; |
Agarwal Ashish | 47d1811 | 2014-08-04 19:55:07 +0530 | [diff] [blame] | 1133 | /* Lock for active sessions while processing deauth/Disassoc */ |
| 1134 | spinlock_t lock_for_active_session; |
Abhishek Singh | 08aa776 | 2014-12-16 13:59:03 +0530 | [diff] [blame] | 1135 | tSirFwStatsResult fwStatsRsp; |
Ganesh Kondabattini | babfb49 | 2014-12-17 20:25:29 +0530 | [diff] [blame] | 1136 | |
| 1137 | /* Time stamp for last completed RoC request */ |
| 1138 | v_TIME_t lastRocTs; |
| 1139 | |
| 1140 | /* work queue to defer the back to back p2p_listen */ |
| 1141 | struct delayed_work roc_work; |
Deepthi Gowri | 22d0875 | 2015-02-05 15:07:40 +0530 | [diff] [blame] | 1142 | |
| 1143 | /* Time stamp for start RoC request */ |
| 1144 | v_TIME_t startRocTs; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1145 | }; |
| 1146 | |
Madan Mohan Koyyalamudi | a53c4dc | 2012-11-13 10:35:42 -0800 | [diff] [blame] | 1147 | #define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station) |
Katya Nigam | e7b69a8 | 2015-04-28 15:24:06 +0530 | [diff] [blame] | 1148 | #define WLAN_HDD_GET_MONITOR_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.monitor) |
Madan Mohan Koyyalamudi | a53c4dc | 2012-11-13 10:35:42 -0800 | [diff] [blame] | 1149 | #define WLAN_HDD_GET_AP_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap) |
| 1150 | #define WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.station.WextState) |
| 1151 | #define WLAN_HDD_GET_CTX(pAdapter) ((hdd_context_t*)pAdapter->pHddCtx) |
| 1152 | #define WLAN_HDD_GET_HAL_CTX(pAdapter) (((hdd_context_t*)(pAdapter->pHddCtx))->hHal) |
| 1153 | #define WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap.HostapdState) |
| 1154 | #define WLAN_HDD_GET_CFG_STATE_PTR(pAdapter) (&(pAdapter)->cfg80211State) |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 1155 | #ifdef FEATURE_WLAN_TDLS |
Madan Mohan Koyyalamudi | 8174692 | 2013-07-17 14:38:51 +0530 | [diff] [blame] | 1156 | #define WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter) \ |
Gopichand Nakkala | 40ab275 | 2013-04-04 20:11:36 +0530 | [diff] [blame] | 1157 | (((WLAN_HDD_INFRA_STATION != pAdapter->device_mode) && \ |
Madan Mohan Koyyalamudi | 8174692 | 2013-07-17 14:38:51 +0530 | [diff] [blame] | 1158 | (WLAN_HDD_P2P_CLIENT != pAdapter->device_mode)) ? 0 : 1) |
| 1159 | #define WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter) \ |
| 1160 | ((WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter)) ? \ |
| 1161 | (tdlsCtx_t*)(pAdapter)->sessionCtx.station.pHddTdlsCtx : NULL) |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 1162 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1163 | |
| 1164 | typedef struct hdd_adapter_list_node |
| 1165 | { |
| 1166 | hdd_list_node_t node; // MUST be first element |
| 1167 | hdd_adapter_t *pAdapter; |
| 1168 | }hdd_adapter_list_node_t; |
| 1169 | |
| 1170 | typedef struct hdd_priv_data_s |
| 1171 | { |
| 1172 | tANI_U8 *buf; |
| 1173 | int used_len; |
| 1174 | int total_len; |
| 1175 | }hdd_priv_data_t; |
| 1176 | |
Leo Chang | 64d68bc | 2013-06-04 15:40:52 -0700 | [diff] [blame] | 1177 | typedef struct |
| 1178 | { |
| 1179 | vos_timer_t trafficTimer; |
| 1180 | atomic_t isActiveMode; |
| 1181 | v_U8_t isInitialized; |
| 1182 | vos_lock_t trafficLock; |
| 1183 | v_TIME_t lastFrameTs; |
| 1184 | }hdd_traffic_monitor_t; |
| 1185 | |
c_hpothu | 9236791 | 2014-05-01 15:18:17 +0530 | [diff] [blame] | 1186 | typedef struct |
| 1187 | { |
| 1188 | struct completion completion; |
| 1189 | tANI_U32 magic; |
| 1190 | }bcnMissRateContext_t; |
| 1191 | |
Siddharth Bhal | a3a5cb4 | 2014-09-29 21:13:13 +0530 | [diff] [blame] | 1192 | typedef struct |
| 1193 | { |
Siddharth Bhal | 7697221 | 2014-10-15 16:22:51 +0530 | [diff] [blame] | 1194 | v_MACADDR_t randomMacAddr; |
| 1195 | v_U8_t isReqDeferred; |
| 1196 | v_U8_t isEnabled; |
| 1197 | struct mutex macSpoofingLock; |
Siddharth Bhal | a3a5cb4 | 2014-09-29 21:13:13 +0530 | [diff] [blame] | 1198 | }macAddrSpoof_t; |
| 1199 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1200 | /** Adapter stucture definition */ |
| 1201 | |
| 1202 | struct hdd_context_s |
| 1203 | { |
| 1204 | /** Global VOS context */ |
| 1205 | v_CONTEXT_t pvosContext; |
| 1206 | |
| 1207 | /** HAL handle...*/ |
| 1208 | tHalHandle hHal; |
| 1209 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1210 | struct wiphy *wiphy ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1211 | //TODO Remove this from here. |
| 1212 | |
| 1213 | hdd_list_t hddAdapters; //List of adapters |
| 1214 | /* One per STA: 1 for RX_BCMC_STA_ID and 1 for SAP_SELF_STA_ID*/ |
| 1215 | hdd_adapter_t *sta_to_adapter[WLAN_MAX_STA_COUNT + 3]; //One per sta. For quick reference. |
| 1216 | |
| 1217 | /** Pointer for firmware image data */ |
| 1218 | const struct firmware *fw; |
| 1219 | |
| 1220 | /** Pointer for configuration data */ |
| 1221 | const struct firmware *cfg; |
| 1222 | |
| 1223 | /** Pointer for nv data */ |
| 1224 | const struct firmware *nv; |
| 1225 | |
| 1226 | /** Pointer to the parent device */ |
| 1227 | struct device *parent_dev; |
| 1228 | |
| 1229 | pid_t pid_sdio_claimed; |
| 1230 | atomic_t sdio_claim_count; |
| 1231 | |
| 1232 | /** Config values read from qcom_cfg.ini file */ |
| 1233 | hdd_config_t *cfg_ini; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1234 | wlan_hdd_ftm_status_t ftm; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1235 | /** completion variable for full power callback */ |
| 1236 | struct completion full_pwr_comp_var; |
| 1237 | /** completion variable for Request BMPS callback */ |
| 1238 | struct completion req_bmps_comp_var; |
| 1239 | |
| 1240 | /** completion variable for standby callback */ |
| 1241 | struct completion standby_comp_var; |
| 1242 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1243 | /* Completion variable to indicate Rx Thread Suspended */ |
| 1244 | struct completion rx_sus_event_var; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1245 | |
| 1246 | /* Completion variable to indicate Tx Thread Suspended */ |
| 1247 | struct completion tx_sus_event_var; |
| 1248 | |
| 1249 | /* Completion variable to indicate Mc Thread Suspended */ |
| 1250 | struct completion mc_sus_event_var; |
| 1251 | |
Amar Singhal | fddc28c | 2013-09-05 13:03:40 -0700 | [diff] [blame] | 1252 | /* Completion variable for regulatory hint */ |
Amar Singhal | a49cbc5 | 2013-10-08 18:37:44 -0700 | [diff] [blame] | 1253 | #ifdef CONFIG_ENABLE_LINUX_REG |
Amar Singhal | fddc28c | 2013-09-05 13:03:40 -0700 | [diff] [blame] | 1254 | struct completion linux_reg_req; |
Amar Singhal | a49cbc5 | 2013-10-08 18:37:44 -0700 | [diff] [blame] | 1255 | #else |
| 1256 | struct completion driver_crda_req; |
| 1257 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1258 | |
Kiet Lam | 46b8e4e | 2013-11-06 21:49:53 +0530 | [diff] [blame] | 1259 | /* Completion variable to indicate updation of channel */ |
| 1260 | struct completion wiphy_channel_update_event; |
| 1261 | |
| 1262 | v_BOOL_t nEnableStrictRegulatoryForFCC; |
| 1263 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1264 | v_BOOL_t isWlanSuspended; |
| 1265 | |
| 1266 | v_BOOL_t isTxThreadSuspended; |
| 1267 | |
| 1268 | v_BOOL_t isMcThreadSuspended; |
| 1269 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1270 | v_BOOL_t isRxThreadSuspended; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1271 | |
| 1272 | volatile v_BOOL_t isLogpInProgress; |
| 1273 | |
Arun Kumar Khandavalli | e0b046d | 2014-03-01 21:54:25 +0530 | [diff] [blame] | 1274 | struct completion ssr_comp_var; |
| 1275 | |
Mihir Shete | 1815629 | 2014-03-11 15:38:30 +0530 | [diff] [blame] | 1276 | v_U8_t isLoadUnloadInProgress; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1277 | |
| 1278 | /**Track whether driver has been suspended.*/ |
| 1279 | hdd_ps_state_t hdd_ps_state; |
| 1280 | |
| 1281 | /* Track whether Mcast/Bcast Filter is enabled.*/ |
| 1282 | v_BOOL_t hdd_mcastbcast_filter_set; |
| 1283 | |
| 1284 | /* Track whether ignore DTIM is enabled*/ |
| 1285 | v_BOOL_t hdd_ignore_dtim_enabled; |
| 1286 | v_U32_t hdd_actual_ignore_DTIM_value; |
| 1287 | v_U32_t hdd_actual_LI_value; |
| 1288 | |
| 1289 | |
| 1290 | v_BOOL_t hdd_wlan_suspended; |
| 1291 | |
| 1292 | spinlock_t filter_lock; |
| 1293 | |
| 1294 | /* Lock to avoid race condtion during start/stop bss*/ |
| 1295 | struct mutex sap_lock; |
Mahesh A Saptasagar | 6062794 | 2014-10-13 13:55:14 +0530 | [diff] [blame] | 1296 | |
| 1297 | /* Lock to avoid race condtion between ROC timeout and |
| 1298 | cancel callbacks*/ |
| 1299 | struct mutex roc_lock; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1300 | /** ptt Process ID*/ |
| 1301 | v_SINT_t ptt_pid; |
Leo Chang | 9e64608 | 2013-08-02 11:20:21 -0700 | [diff] [blame] | 1302 | #ifdef WLAN_KD_READY_NOTIFIER |
| 1303 | v_BOOL_t kd_nl_init; |
| 1304 | #endif /* WLAN_KD_READY_NOTIFIER */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1305 | v_U8_t change_iface; |
| 1306 | |
| 1307 | /** Concurrency Parameters*/ |
| 1308 | tVOS_CONCURRENCY_MODE concurrency_mode; |
| 1309 | |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 1310 | v_U8_t no_of_open_sessions[VOS_MAX_NO_OF_MODE]; |
| 1311 | v_U8_t no_of_active_sessions[VOS_MAX_NO_OF_MODE]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1312 | |
| 1313 | hdd_chip_reset_stats_t hddChipResetStats; |
| 1314 | /* Number of times riva restarted */ |
| 1315 | v_U32_t hddRivaResetStats; |
| 1316 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1317 | /* Can we allow AMP connection right now*/ |
| 1318 | v_BOOL_t isAmpAllowed; |
| 1319 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1320 | /** P2P Device MAC Address for the adapter */ |
| 1321 | v_MACADDR_t p2pDeviceAddress; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1322 | |
| 1323 | /* Thermal mitigation information */ |
| 1324 | hdd_thermal_mitigation_info_t tmInfo; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1325 | |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 1326 | #ifdef WLAN_OPEN_SOURCE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1327 | #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK |
| 1328 | struct wake_lock rx_wake_lock; |
| 1329 | #endif |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 1330 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1331 | |
| 1332 | /* |
| 1333 | * Framework initiated driver restarting |
| 1334 | * hdd_reload_timer : Restart retry timer |
| 1335 | * isRestartInProgress: Restart in progress |
| 1336 | * hdd_restart_retries: Restart retries |
| 1337 | * |
| 1338 | */ |
| 1339 | vos_timer_t hdd_restart_timer; |
| 1340 | atomic_t isRestartInProgress; |
| 1341 | u_int8_t hdd_restart_retries; |
| 1342 | |
Madan Mohan Koyyalamudi | 2a1ba77 | 2012-10-11 14:59:06 -0700 | [diff] [blame] | 1343 | hdd_scaninfo_t scan_info; |
Gopichand Nakkala | f7e53c5 | 2013-01-07 14:52:52 -0800 | [diff] [blame] | 1344 | |
Madan Mohan Koyyalamudi | 543172b | 2012-12-05 16:40:18 -0800 | [diff] [blame] | 1345 | /*is_dyanmic_channel_range_set is set to 1 when Softap_set_channel_range |
Gopichand Nakkala | f7e53c5 | 2013-01-07 14:52:52 -0800 | [diff] [blame] | 1346 | is invoked*/ |
Madan Mohan Koyyalamudi | 543172b | 2012-12-05 16:40:18 -0800 | [diff] [blame] | 1347 | v_BOOL_t is_dynamic_channel_range_set; |
Madan Mohan Koyyalamudi | 69fc3ad | 2012-11-28 16:04:56 -0800 | [diff] [blame] | 1348 | |
Gopichand Nakkala | 1bc04f1 | 2013-02-28 14:29:23 -0800 | [diff] [blame] | 1349 | #ifdef WLAN_OPEN_SOURCE |
Madan Mohan Koyyalamudi | 69fc3ad | 2012-11-28 16:04:56 -0800 | [diff] [blame] | 1350 | struct wake_lock sap_wake_lock; |
Gopichand Nakkala | 1bc04f1 | 2013-02-28 14:29:23 -0800 | [diff] [blame] | 1351 | #endif |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 1352 | |
| 1353 | #ifdef FEATURE_WLAN_TDLS |
| 1354 | eTDLSSupportMode tdls_mode; |
Hoonki Lee | 2751190 | 2013-03-14 18:19:06 -0700 | [diff] [blame] | 1355 | eTDLSSupportMode tdls_mode_last; |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 1356 | tdlsConnInfo_t tdlsConnInfo[HDD_MAX_NUM_TDLS_STA]; |
| 1357 | /* TDLS peer connected count */ |
| 1358 | tANI_U16 connected_peer_count; |
Hoonki Lee | 93e67ff | 2013-03-19 15:49:25 -0700 | [diff] [blame] | 1359 | tdls_scan_context_t tdls_scan_ctxt; |
Sunil Dutt | 41de4e2 | 2013-11-14 18:09:02 +0530 | [diff] [blame] | 1360 | /* Lock to avoid race condition during TDLS operations*/ |
| 1361 | struct mutex tdls_lock; |
Pradeep Reddy POTTETI | f0569d7 | 2014-12-13 16:54:03 +0530 | [diff] [blame] | 1362 | v_BOOL_t is_tdls_btc_enabled; |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 1363 | #endif |
Madan Mohan Koyyalamudi | 2602b20 | 2013-08-29 01:15:12 +0530 | [diff] [blame] | 1364 | |
Leo Chang | 64d68bc | 2013-06-04 15:40:52 -0700 | [diff] [blame] | 1365 | hdd_traffic_monitor_t traffic_monitor; |
Gopichand Nakkala | b8f0f1a | 2013-05-23 18:19:48 +0530 | [diff] [blame] | 1366 | |
| 1367 | /* MC/BC Filter state variable |
| 1368 | * This always contains the value that is currently |
| 1369 | * configured |
| 1370 | * */ |
| 1371 | v_U8_t configuredMcastBcastFilter; |
Gopichand Nakkala | 8c0386c | 2013-07-09 23:31:37 +0530 | [diff] [blame] | 1372 | |
Amar Singhal | 49fdfd5 | 2013-08-13 13:25:12 -0700 | [diff] [blame] | 1373 | v_U8_t sus_res_mcastbcast_filter; |
Yue Ma | 0d4891e | 2013-08-06 17:01:45 -0700 | [diff] [blame] | 1374 | |
Amar Singhal | d53568e | 2013-09-26 11:03:45 -0700 | [diff] [blame] | 1375 | v_BOOL_t sus_res_mcastbcast_filter_valid; |
| 1376 | |
Yue Ma | 0d4891e | 2013-08-06 17:01:45 -0700 | [diff] [blame] | 1377 | /* debugfs entry */ |
| 1378 | struct dentry *debugfs_phy; |
Kamath Vinayak | 4000c9a | 2013-08-23 14:24:27 +0530 | [diff] [blame] | 1379 | |
| 1380 | /* Use below lock to protect access to isSchedScanUpdatePending |
| 1381 | * since it will be accessed in two different contexts. |
| 1382 | */ |
| 1383 | spinlock_t schedScan_lock; |
| 1384 | |
| 1385 | // Flag keeps track of wiphy suspend/resume |
| 1386 | v_BOOL_t isWiphySuspended; |
| 1387 | |
| 1388 | // Indicates about pending sched_scan results |
| 1389 | v_BOOL_t isSchedScanUpdatePending; |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 1390 | /* |
| 1391 | * TX_rx_pkt_count_timer |
| 1392 | */ |
| 1393 | vos_timer_t tx_rx_trafficTmr; |
| 1394 | v_U8_t drvr_miracast; |
| 1395 | v_U8_t issplitscan_enabled; |
Pradeep Reddy POTTETI | edaeb5f | 2014-05-22 23:34:41 +0530 | [diff] [blame] | 1396 | v_U8_t isTdlsScanCoexistence; |
Tushnim Bhattacharyya | 71ccecc | 2013-10-14 16:22:56 -0700 | [diff] [blame] | 1397 | |
| 1398 | /* VHT80 allowed*/ |
| 1399 | v_BOOL_t isVHT80Allowed; |
| 1400 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 1401 | #ifdef FEATURE_WLAN_CH_AVOID |
| 1402 | v_U16_t unsafeChannelCount; |
| 1403 | v_U16_t unsafeChannelList[NUM_20MHZ_RF_CHANNELS]; |
| 1404 | v_U16_t safeChannelList[NUM_20MHZ_RF_CHANNELS]; |
| 1405 | #endif /* FEATURE_WLAN_CH_AVOID */ |
c_hpothu | 9b781ba | 2013-12-30 20:57:45 +0530 | [diff] [blame] | 1406 | |
| 1407 | v_BOOL_t btCoexModeSet; |
c_hpothu | 37f2131 | 2014-04-09 21:49:54 +0530 | [diff] [blame] | 1408 | v_BOOL_t isPnoEnable; |
Siddharth Bhal | a3a5cb4 | 2014-09-29 21:13:13 +0530 | [diff] [blame] | 1409 | macAddrSpoof_t spoofMacAddr; |
Agarwal Ashish | 738843c | 2014-09-25 12:27:56 +0530 | [diff] [blame] | 1410 | /* flag to decide if driver need to scan DFS channels or not */ |
| 1411 | v_BOOL_t disable_dfs_flag; |
Vinay Krishna Eranna | f97ef5c | 2014-12-26 17:47:19 +0530 | [diff] [blame] | 1412 | |
| 1413 | #ifdef WLAN_NS_OFFLOAD |
| 1414 | /* |
| 1415 | * IPv6 notifier callback for handling NS offload on change in IP |
| 1416 | */ |
| 1417 | struct notifier_block ipv6_notifier; |
| 1418 | #endif |
| 1419 | |
| 1420 | /* IPv4 notifier callback for handling ARP offload on change in |
| 1421 | * IP |
| 1422 | */ |
| 1423 | struct notifier_block ipv4_notifier; |
Mukul Sharma | 1fd6efd | 2015-02-14 00:29:14 +0530 | [diff] [blame] | 1424 | //Lock to avoid race condition during wmm operations |
| 1425 | struct mutex wmmLock; |
Siddharth Bhal | b7c421c | 2015-02-27 00:26:09 +0530 | [diff] [blame] | 1426 | v_BOOL_t mgmt_frame_logging; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1427 | }; |
| 1428 | |
| 1429 | |
Mihir Shete | 1815629 | 2014-03-11 15:38:30 +0530 | [diff] [blame] | 1430 | #define WLAN_HDD_IS_LOAD_IN_PROGRESS(pHddCtx) \ |
| 1431 | (pHddCtx->isLoadUnloadInProgress & WLAN_HDD_LOAD_IN_PROGRESS) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1432 | |
Mihir Shete | 1815629 | 2014-03-11 15:38:30 +0530 | [diff] [blame] | 1433 | #define WLAN_HDD_IS_UNLOAD_IN_PROGRESS(pHddCtx) \ |
| 1434 | (pHddCtx->isLoadUnloadInProgress & WLAN_HDD_UNLOAD_IN_PROGRESS) |
| 1435 | |
| 1436 | #define WLAN_HDD_IS_LOAD_UNLOAD_IN_PROGRESS(pHddCtx) \ |
| 1437 | (pHddCtx->isLoadUnloadInProgress & \ |
Mihir Shete | 4ba11ac | 2014-04-11 20:04:01 +0530 | [diff] [blame] | 1438 | (WLAN_HDD_LOAD_IN_PROGRESS | WLAN_HDD_UNLOAD_IN_PROGRESS)) |
Siddharth Bhal | b7c421c | 2015-02-27 00:26:09 +0530 | [diff] [blame] | 1439 | |
| 1440 | /* Logging of both Mgmt and Data pkts are supported by HW in both TX & RX. |
| 1441 | * But only support for logging of Mgmt pkts is supported from host driver. |
| 1442 | */ |
| 1443 | typedef enum |
| 1444 | { |
| 1445 | WLAN_FRAME_LOGGING_FRAMETYPE_DATA, |
| 1446 | WLAN_FRAME_LOGGING_FRAMETYPE_MGMT, |
| 1447 | } WLAN_FRAME_LOGGING_FRAMETYPE; |
| 1448 | |
| 1449 | // Only first 64/128 bytes of Mgmt/Data pkts can be logged. |
| 1450 | typedef enum |
| 1451 | { |
| 1452 | WLAN_MGMT_LOGGING_FRAMESIZE_64BYTES = 64, |
| 1453 | WLAN_MGMT_LOGGING_FRAMESIZE_128BYTES = 128, |
| 1454 | } WLAN_MGMT_LOGGING_FRAMESIZE; |
| 1455 | |
| 1456 | /* In Circular Mode HW buffer will be filled in circular fashion with buffer |
| 1457 | * overwritten when buffer memory is full and new pkt is to be logged. |
| 1458 | * Freeze mode will stop filling the buffer memory when buffer is full and thus |
| 1459 | * no more pkts will logged unless buffer memory is freed. |
| 1460 | */ |
| 1461 | typedef enum |
| 1462 | { |
| 1463 | WLAN_FRAME_LOGGING_BUFFERMODE_CIRCULAR, |
| 1464 | WLAN_FRAME_LOGGING_BUFFERMODE_FREEZE, |
| 1465 | } WLAN_FRAME_LOGGING_BUFFERMODE; |
| 1466 | |
| 1467 | /* WLAN_FRAME_LOG_EN - Enables frame logging in HW |
| 1468 | * WLAN_BMUHW_TRACE_LOG_EN - 8K/16K memory buffer will be used for logging |
| 1469 | * WLAN_QXDM_LOG_EN - FW QXDM logs will be routed through host driver |
| 1470 | * WLAN_DPU_TXP_LOG_EN - pkts will be logged at both DPU and TXP HW block. |
| 1471 | */ |
| 1472 | typedef enum |
| 1473 | { |
| 1474 | WLAN_FRAME_LOG_EN = 1<<0, |
| 1475 | WLAN_BMUHW_TRACE_LOG_EN = 1<<1, |
| 1476 | WLAN_QXDM_LOG_EN = 1<<2, |
| 1477 | WLAN_DPU_TXP_LOG_EN = 1<<3, |
| 1478 | } WLAN_ENABLE_HW_FW_LOG_TYPE; |
| 1479 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1480 | /*--------------------------------------------------------------------------- |
| 1481 | Function declarations and documenation |
Sushant Kaushik | 8bc7df2 | 2014-04-09 17:55:29 +0530 | [diff] [blame] | 1482 | -------------------------------------------------------------------------*/ |
| 1483 | const char * hdd_device_modetoString(v_U8_t device_mode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1484 | VOS_STATUS hdd_get_front_adapter( hdd_context_t *pHddCtx, |
| 1485 | hdd_adapter_list_node_t** ppAdapterNode); |
| 1486 | |
| 1487 | VOS_STATUS hdd_get_next_adapter( hdd_context_t *pHddCtx, |
| 1488 | hdd_adapter_list_node_t* pAdapterNode, |
| 1489 | hdd_adapter_list_node_t** pNextAdapterNode); |
| 1490 | |
| 1491 | VOS_STATUS hdd_remove_adapter( hdd_context_t *pHddCtx, |
| 1492 | hdd_adapter_list_node_t* pAdapterNode); |
| 1493 | |
| 1494 | VOS_STATUS hdd_remove_front_adapter( hdd_context_t *pHddCtx, |
| 1495 | hdd_adapter_list_node_t** ppAdapterNode); |
| 1496 | |
| 1497 | VOS_STATUS hdd_add_adapter_back( hdd_context_t *pHddCtx, |
| 1498 | hdd_adapter_list_node_t* pAdapterNode); |
| 1499 | |
| 1500 | VOS_STATUS hdd_add_adapter_front( hdd_context_t *pHddCtx, |
| 1501 | hdd_adapter_list_node_t* pAdapterNode); |
| 1502 | |
| 1503 | hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, |
Jeff Johnson | eed415b | 2013-01-18 16:11:20 -0800 | [diff] [blame] | 1504 | const char* name, tSirMacAddr macAddr, |
| 1505 | tANI_U8 rtnl_held ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1506 | VOS_STATUS hdd_close_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, tANI_U8 rtnl_held ); |
| 1507 | VOS_STATUS hdd_close_all_adapters( hdd_context_t *pHddCtx ); |
| 1508 | VOS_STATUS hdd_stop_all_adapters( hdd_context_t *pHddCtx ); |
| 1509 | VOS_STATUS hdd_reset_all_adapters( hdd_context_t *pHddCtx ); |
| 1510 | VOS_STATUS hdd_start_all_adapters( hdd_context_t *pHddCtx ); |
| 1511 | VOS_STATUS hdd_reconnect_all_adapters( hdd_context_t *pHddCtx ); |
Sudhir Sattayappa Kohalli | 90e4c75 | 2013-03-21 14:25:04 -0700 | [diff] [blame] | 1512 | void hdd_dump_concurrency_info(hdd_context_t *pHddCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1513 | hdd_adapter_t * hdd_get_adapter_by_name( hdd_context_t *pHddCtx, tANI_U8 *name ); |
| 1514 | hdd_adapter_t * hdd_get_adapter_by_macaddr( hdd_context_t *pHddCtx, tSirMacAddr macAddr ); |
| 1515 | hdd_adapter_t * hdd_get_mon_adapter( hdd_context_t *pHddCtx ); |
| 1516 | VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter ); |
| 1517 | hdd_adapter_t * hdd_get_adapter( hdd_context_t *pHddCtx, device_mode_t mode ); |
c_hpothu | 002231a | 2015-02-05 14:58:51 +0530 | [diff] [blame] | 1518 | void hdd_deinit_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, tANI_U8 rtnl_held ); |
Agarwal Ashish | 3a38bd1 | 2014-06-12 15:16:52 +0530 | [diff] [blame] | 1519 | VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, |
| 1520 | const v_BOOL_t bCloseSession ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1521 | void hdd_set_station_ops( struct net_device *pWlanDev ); |
| 1522 | tANI_U8* wlan_hdd_get_intf_addr(hdd_context_t* pHddCtx); |
| 1523 | void wlan_hdd_release_intf_addr(hdd_context_t* pHddCtx, tANI_U8* releaseAddr); |
| 1524 | v_U8_t hdd_get_operating_channel( hdd_context_t *pHddCtx, device_mode_t mode ); |
Katya Nigam | f0511f6 | 2015-05-05 16:40:57 +0530 | [diff] [blame^] | 1525 | void wlan_hdd_mon_set_typesubtype( hdd_mon_ctx_t *pMonCtx,int type); |
| 1526 | VOS_STATUS wlan_hdd_mon_poststartmsg( hdd_mon_ctx_t *pMonCtx ); |
| 1527 | void wlan_hdd_mon_poststopmsg( void ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1528 | void hdd_set_conparam ( v_UINT_t newParam ); |
| 1529 | tVOS_CON_MODE hdd_get_conparam( void ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1530 | |
| 1531 | void wlan_hdd_enable_deepsleep(v_VOID_t * pVosContext); |
Sushant Kaushik | abb7ee6 | 2014-07-18 16:20:12 +0530 | [diff] [blame] | 1532 | v_BOOL_t wlan_hdd_is_GO_power_collapse_allowed(hdd_context_t* pHddCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1533 | v_BOOL_t hdd_is_apps_power_collapse_allowed(hdd_context_t* pHddCtx); |
Madan Mohan Koyyalamudi | c72a4d6 | 2012-11-08 14:59:34 -0800 | [diff] [blame] | 1534 | v_BOOL_t hdd_is_suspend_notify_allowed(hdd_context_t* pHddCtx); |
c_hpothu | a3d45d5 | 2015-01-05 14:11:17 +0530 | [diff] [blame] | 1535 | tSirAbortScanStatus hdd_abort_mac_scan(hdd_context_t* pHddCtx, |
| 1536 | tANI_U8 sessionId, |
| 1537 | eCsrAbortReason reason); |
Siddharth Bhal | 7697221 | 2014-10-15 16:22:51 +0530 | [diff] [blame] | 1538 | VOS_STATUS hdd_processSpoofMacAddrRequest(hdd_context_t *pHddCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1539 | void hdd_cleanup_actionframe( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ); |
Amar Singhal | fddc28c | 2013-09-05 13:03:40 -0700 | [diff] [blame] | 1540 | |
Yunsen Wang | e3ba1fb | 2013-04-05 15:04:43 -0700 | [diff] [blame] | 1541 | void crda_regulatory_entry_default(v_U8_t *countryCode, int domain_id); |
Agarwal Ashish | 51325b5 | 2014-06-16 16:50:49 +0530 | [diff] [blame] | 1542 | void wlan_hdd_set_concurrency_mode(hdd_context_t *pHddCtx, |
| 1543 | tVOS_CON_MODE mode); |
| 1544 | void wlan_hdd_clear_concurrency_mode(hdd_context_t *pHddCtx, |
| 1545 | tVOS_CON_MODE mode); |
| 1546 | void wlan_hdd_incr_active_session(hdd_context_t *pHddCtx, |
| 1547 | tVOS_CON_MODE mode); |
| 1548 | void wlan_hdd_decr_active_session(hdd_context_t *pHddCtx, |
| 1549 | tVOS_CON_MODE mode); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1550 | void wlan_hdd_reset_prob_rspies(hdd_adapter_t* pHostapdAdapter); |
| 1551 | void hdd_prevent_suspend(void); |
| 1552 | void hdd_allow_suspend(void); |
Mahesh A Saptasagar | b9c5040 | 2014-01-16 15:49:22 +0530 | [diff] [blame] | 1553 | void hdd_prevent_suspend_timeout(v_U32_t timeout); |
Madan Mohan Koyyalamudi | b5da533 | 2012-10-15 17:23:21 -0700 | [diff] [blame] | 1554 | bool hdd_is_ssr_required(void); |
| 1555 | void hdd_set_ssr_required(e_hdd_ssr_required value); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1556 | |
| 1557 | VOS_STATUS hdd_enable_bmps_imps(hdd_context_t *pHddCtx); |
| 1558 | VOS_STATUS hdd_disable_bmps_imps(hdd_context_t *pHddCtx, tANI_U8 session_type); |
| 1559 | |
Madan Mohan Koyyalamudi | 7127826 | 2013-04-12 22:00:48 +0530 | [diff] [blame] | 1560 | void wlan_hdd_cfg80211_update_reg_info(struct wiphy *wiphy); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1561 | VOS_STATUS wlan_hdd_restart_driver(hdd_context_t *pHddCtx); |
Madan Mohan Koyyalamudi | 8612ec9 | 2012-09-28 15:53:07 -0700 | [diff] [blame] | 1562 | void hdd_exchange_version_and_caps(hdd_context_t *pHddCtx); |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 1563 | void hdd_set_pwrparams(hdd_context_t *pHddCtx); |
| 1564 | void hdd_reset_pwrparams(hdd_context_t *pHddCtx); |
Gopichand Nakkala | f502e2b | 2013-05-24 18:34:25 +0530 | [diff] [blame] | 1565 | int wlan_hdd_validate_context(hdd_context_t *pHddCtx); |
Srinivas Girigowda | 0c69aee | 2013-10-09 17:21:01 -0700 | [diff] [blame] | 1566 | v_BOOL_t hdd_is_valid_mac_address(const tANI_U8* pMacAddr); |
Sudhir Sattayappa Kohalli | b1d8c3a | 2013-06-18 14:47:20 -0700 | [diff] [blame] | 1567 | VOS_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *pHddCtx); |
Agarwal Ashish | 57e8437 | 2014-12-05 18:26:53 +0530 | [diff] [blame] | 1568 | VOS_STATUS hdd_is_any_session_connected(hdd_context_t *pHddCtx); |
Vinay Krishna Eranna | 4d055d4 | 2013-12-17 17:02:01 +0530 | [diff] [blame] | 1569 | void hdd_ipv4_notifier_work_queue(struct work_struct *work); |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 1570 | v_BOOL_t hdd_isConnectionInProgress( hdd_context_t *pHddCtx); |
Katya Nigam | 1fd2440 | 2015-02-16 14:52:19 +0530 | [diff] [blame] | 1571 | void hdd_set_ibss_ops(hdd_adapter_t *pAdapter); |
Gopichand Nakkala | 227c7f3 | 2013-06-26 22:44:57 +0530 | [diff] [blame] | 1572 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 1573 | int wlan_hdd_setIPv6Filter(hdd_context_t *pHddCtx, tANI_U8 filterType, tANI_U8 sessionId); |
| 1574 | #endif |
Vinay Krishna Eranna | d5b2be2 | 2013-12-01 17:00:15 +0530 | [diff] [blame] | 1575 | |
| 1576 | #ifdef WLAN_NS_OFFLOAD |
| 1577 | void hdd_ipv6_notifier_work_queue(struct work_struct *work); |
| 1578 | #endif |
| 1579 | |
Tushnim Bhattacharyya | 71ccecc | 2013-10-14 16:22:56 -0700 | [diff] [blame] | 1580 | #ifdef CONFIG_ENABLE_LINUX_REG |
| 1581 | void hdd_checkandupdate_phymode( hdd_context_t *pHddCtx); |
| 1582 | #endif |
Kiet Lam | f040f47 | 2013-11-20 21:15:23 +0530 | [diff] [blame] | 1583 | int hdd_wmmps_helper(hdd_adapter_t *pAdapter, tANI_U8 *ptr); |
Rajeev Kumar | 8b37329 | 2014-01-08 20:36:55 -0800 | [diff] [blame] | 1584 | |
| 1585 | #ifdef FEATURE_WLAN_BATCH_SCAN |
| 1586 | /**--------------------------------------------------------------------------- |
| 1587 | |
| 1588 | \brief hdd_handle_batch_scan_ioctl () - This function handles WLS_BATCHING |
| 1589 | IOCTLs from user space. Following BATCH SCAN DEV IOCTs are handled: |
| 1590 | WLS_BATCHING VERSION |
| 1591 | WLS_BATCHING SET |
| 1592 | WLS_BATCHING GET |
| 1593 | WLS_BATCHING STOP |
| 1594 | |
| 1595 | \param - pAdapter Pointer to HDD adapter |
| 1596 | \param - pPrivdata Pointer to priv_data |
| 1597 | \param - command Pointer to command |
| 1598 | |
| 1599 | \return - 0 for success -EFAULT for failure |
| 1600 | |
| 1601 | --------------------------------------------------------------------------*/ |
| 1602 | |
| 1603 | int hdd_handle_batch_scan_ioctl |
| 1604 | ( |
| 1605 | hdd_adapter_t *pAdapter, |
| 1606 | hdd_priv_data_t *pPrivdata, |
| 1607 | tANI_U8 *command |
| 1608 | ); |
Kiet Lam | 3494745 | 2014-01-21 23:23:40 -0800 | [diff] [blame] | 1609 | |
| 1610 | /**--------------------------------------------------------------------------- |
| 1611 | |
| 1612 | \brief hdd_deinit_batch_scan () - This function cleans up batch scan data |
| 1613 | structures |
| 1614 | |
| 1615 | \param - pAdapter Pointer to HDD adapter |
| 1616 | |
| 1617 | \return - None |
| 1618 | |
| 1619 | --------------------------------------------------------------------------*/ |
| 1620 | |
| 1621 | void hdd_deinit_batch_scan(hdd_adapter_t *pAdapter); |
| 1622 | |
Rajeev Kumar | 8b37329 | 2014-01-08 20:36:55 -0800 | [diff] [blame] | 1623 | #endif /*End of FEATURE_WLAN_BATCH_SCAN*/ |
Neelansh Mittal | edafed2 | 2014-09-04 18:54:39 +0530 | [diff] [blame] | 1624 | void wlan_hdd_send_svc_nlink_msg(int type, void *data, int len); |
Rajeev Kumar | 8b37329 | 2014-01-08 20:36:55 -0800 | [diff] [blame] | 1625 | |
Vinay Krishna Eranna | facf5e2 | 2014-02-24 13:16:25 +0530 | [diff] [blame] | 1626 | boolean hdd_is_5g_supported(hdd_context_t * pHddCtx); |
| 1627 | |
Mahesh A Saptasagar | 2395ee6 | 2014-05-21 19:12:21 +0530 | [diff] [blame] | 1628 | int wlan_hdd_scan_abort(hdd_adapter_t *pAdapter); |
| 1629 | |
Mihir Shete | 0420645 | 2014-11-20 17:50:58 +0530 | [diff] [blame] | 1630 | #ifdef CONFIG_ENABLE_LINUX_REG |
Agarwal Ashish | 6db9d53 | 2014-09-30 18:19:10 +0530 | [diff] [blame] | 1631 | VOS_STATUS wlan_hdd_init_channels_for_cc(hdd_context_t *pHddCtx, driver_load_type init ); |
Mihir Shete | 0420645 | 2014-11-20 17:50:58 +0530 | [diff] [blame] | 1632 | #endif |
c_hpothu | 225aa7c | 2014-10-22 17:45:13 +0530 | [diff] [blame] | 1633 | |
| 1634 | VOS_STATUS wlan_hdd_cancel_remain_on_channel(hdd_context_t *pHddCtx); |
Mihir Shete | 0be2877 | 2015-02-17 18:42:14 +0530 | [diff] [blame] | 1635 | hdd_remain_on_chan_ctx_t *hdd_get_remain_on_channel_ctx(hdd_context_t *pHddCtx); |
c_hpothu | 225aa7c | 2014-10-22 17:45:13 +0530 | [diff] [blame] | 1636 | |
Padma, Santhosh Kumar | 778d838 | 2015-03-04 17:41:22 +0530 | [diff] [blame] | 1637 | VOS_STATUS wlan_hdd_handle_dfs_chan_scan(hdd_context_t *pHddCtx, |
| 1638 | tANI_U8 dfsScanMode); |
| 1639 | |
Mihir Shete | e2ae82a | 2015-03-16 14:08:49 +0530 | [diff] [blame] | 1640 | v_U8_t hdd_is_fw_logging_enabled(void); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1641 | #endif // end #if !defined( WLAN_HDD_MAIN_H ) |