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