Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, 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 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 24 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 25 | * |
| 26 | * |
| 27 | * Permission to use, copy, modify, and/or distribute this software for |
| 28 | * any purpose with or without fee is hereby granted, provided that the |
| 29 | * above copyright notice and this permission notice appear in all |
| 30 | * copies. |
| 31 | * |
| 32 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 33 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 35 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 36 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 37 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 38 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 39 | * PERFORMANCE OF THIS SOFTWARE. |
| 40 | */ |
| 41 | |
| 42 | #if !defined( WLAN_HDD_MAIN_H ) |
| 43 | #define WLAN_HDD_MAIN_H |
| 44 | /**=========================================================================== |
| 45 | |
| 46 | \file WLAN_HDD_MAIN_H.h |
| 47 | |
| 48 | \brief Linux HDD Adapter Type |
| 49 | Copyright 2008 (c) Qualcomm, Incorporated. |
| 50 | All Rights Reserved. |
| 51 | Qualcomm Confidential and Proprietary. |
| 52 | |
| 53 | ==========================================================================*/ |
| 54 | |
| 55 | /*--------------------------------------------------------------------------- |
| 56 | Include files |
| 57 | -------------------------------------------------------------------------*/ |
| 58 | |
| 59 | #include <linux/netdevice.h> |
| 60 | #include <linux/skbuff.h> |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 61 | #include <net/cfg80211.h> |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 62 | #include <vos_list.h> |
| 63 | #include <vos_types.h> |
| 64 | #include "sirMacProtDef.h" |
| 65 | #include "csrApi.h" |
| 66 | #include <wlan_hdd_assoc.h> |
| 67 | #include <wlan_hdd_dp_utils.h> |
| 68 | #include <wlan_hdd_wmm.h> |
| 69 | #include <wlan_hdd_cfg.h> |
| 70 | #include <linux/spinlock.h> |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 71 | #ifdef WLAN_OPEN_SOURCE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 72 | #include <linux/wakelock.h> |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 73 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 74 | #include <wlan_hdd_ftm.h> |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 75 | #ifdef FEATURE_WLAN_TDLS |
| 76 | #include "wlan_hdd_tdls.h" |
| 77 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 78 | /*--------------------------------------------------------------------------- |
| 79 | Preprocessor definitions and constants |
| 80 | -------------------------------------------------------------------------*/ |
| 81 | /** Number of attempts to detect/remove card */ |
| 82 | #define LIBRA_CARD_INSERT_DETECT_MAX_COUNT 5 |
| 83 | #define LIBRA_CARD_REMOVE_DETECT_MAX_COUNT 5 |
| 84 | /** Number of Tx Queues */ |
| 85 | #define NUM_TX_QUEUES 4 |
| 86 | /** Queue length specified to OS in the net_device */ |
| 87 | #define NET_DEV_TX_QUEUE_LEN 100 |
| 88 | /** HDD's internal Tx Queue Length. Needs to be a power of 2 */ |
| 89 | #define HDD_TX_QUEUE_MAX_LEN 128 |
| 90 | /** HDD internal Tx Queue Low Watermark. Net Device TX queue is disabled |
| 91 | * when HDD queue becomes full. This Low watermark is used to enable |
| 92 | * the Net Device queue again */ |
| 93 | #define HDD_TX_QUEUE_LOW_WATER_MARK (HDD_TX_QUEUE_MAX_LEN*3/4) |
| 94 | /** Bytes to reserve in the headroom */ |
| 95 | #define LIBRA_HW_NEEDED_HEADROOM 128 |
| 96 | /** Hdd Tx Time out value */ |
| 97 | #ifdef LIBRA_LINUX_PC |
| 98 | #define HDD_TX_TIMEOUT (8000) |
| 99 | #else |
| 100 | #define HDD_TX_TIMEOUT msecs_to_jiffies(5000) |
| 101 | #endif |
| 102 | /** Hdd Default MTU */ |
| 103 | #define HDD_DEFAULT_MTU (1500) |
Jeff Johnson | 6a81ca4 | 2013-04-05 10:37:08 -0700 | [diff] [blame] | 104 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 105 | /**event flags registered net device*/ |
Jeff Johnson | 6a81ca4 | 2013-04-05 10:37:08 -0700 | [diff] [blame] | 106 | #define NET_DEVICE_REGISTERED (0) |
| 107 | #define SME_SESSION_OPENED (1) |
| 108 | #define INIT_TX_RX_SUCCESS (2) |
| 109 | #define WMM_INIT_DONE (3) |
| 110 | #define SOFTAP_BSS_STARTED (4) |
| 111 | #define DEVICE_IFACE_OPENED (5) |
| 112 | #define TDLS_INIT_DONE (6) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 113 | |
| 114 | /** Maximum time(ms)to wait for disconnect to complete **/ |
| 115 | #define WLAN_WAIT_TIME_DISCONNECT 500 |
| 116 | #define WLAN_WAIT_TIME_STATS 800 |
| 117 | #define WLAN_WAIT_TIME_POWER 800 |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 118 | /* Amount of time to wait for sme close session callback. |
| 119 | This value should be larger than the timeout used by WDI to wait for |
| 120 | a response from WCNSS */ |
| 121 | #define WLAN_WAIT_TIME_SESSIONOPENCLOSE 15000 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 122 | #define WLAN_WAIT_TIME_ABORTSCAN 2000 |
| 123 | |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 124 | /** Maximum time(ms) to wait for tdls add sta to complete **/ |
| 125 | #define WAIT_TIME_TDLS_ADD_STA 1500 |
| 126 | |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 127 | /** Maximum time(ms) to wait for tdls del sta to complete **/ |
| 128 | #define WAIT_TIME_TDLS_DEL_STA 1500 |
| 129 | |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 130 | /** Maximum time(ms) to wait for Link Establish Req to complete **/ |
| 131 | #define WAIT_TIME_TDLS_LINK_ESTABLISH_REQ 1500 |
| 132 | |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 133 | /** Maximum time(ms) to wait for tdls mgmt to complete **/ |
Gopichand Nakkala | 21c3f9b | 2013-03-23 14:45:55 -0700 | [diff] [blame] | 134 | #define WAIT_TIME_TDLS_MGMT 11000 |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 135 | |
Hoonki Lee | 1462135 | 2013-04-16 17:51:19 -0700 | [diff] [blame] | 136 | /** Maximum time(ms) to wait for tdls initiator to start direct communication **/ |
Gopichand Nakkala | 9b4eee1 | 2013-05-21 16:05:48 +0530 | [diff] [blame] | 137 | #define WAIT_TIME_TDLS_INITIATOR 600 |
Madan Mohan Koyyalamudi | c3a240c | 2012-09-28 15:34:08 -0700 | [diff] [blame] | 138 | /* Maximum time to get crda entry settings */ |
| 139 | #define CRDA_WAIT_TIME 300 |
| 140 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 141 | /* Scan Req Timeout */ |
| 142 | #define WLAN_WAIT_TIME_SCAN_REQ 100 |
| 143 | |
| 144 | #define MAX_NUMBER_OF_ADAPTERS 4 |
| 145 | |
| 146 | #define MAX_CFG_STRING_LEN 255 |
| 147 | |
| 148 | #define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] |
| 149 | /** Mac Address string **/ |
| 150 | #define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x" |
| 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 |
| 167 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET 30 |
| 168 | #define WLAN_HDD_P2P_SOCIAL_CHANNELS 3 |
Madan Mohan Koyyalamudi | 8d50f31 | 2012-11-27 15:48:57 -0800 | [diff] [blame] | 169 | #define WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN 1 |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 170 | |
Gopichand Nakkala | 1f7a64f | 2013-04-01 18:37:17 +0530 | [diff] [blame] | 171 | #define WLAN_HDD_IS_SOCIAL_CHANNEL(center_freq) \ |
| 172 | (((center_freq) == 2412) || ((center_freq) == 2437) || ((center_freq) == 2462)) |
| 173 | |
Madan Mohan Koyyalamudi | 7127826 | 2013-04-12 22:00:48 +0530 | [diff] [blame] | 174 | #define WLAN_HDD_CHANNEL_IN_UNII_1_BAND(center_freq) \ |
| 175 | (((center_freq) == 5180 ) || ((center_freq) == 5200) \ |
| 176 | || ((center_freq) == 5220) || ((center_freq) == 5240)) |
| 177 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 178 | #ifdef WLAN_FEATURE_11W |
| 179 | #define WLAN_HDD_SA_QUERY_ACTION_FRAME 8 |
| 180 | #endif |
| 181 | |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 182 | #define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14 |
| 183 | #define WLAN_HDD_TDLS_ACTION_FRAME 12 |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 184 | #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK |
Sameer Thalappil | 84b14ff | 2013-06-12 16:02:52 -0700 | [diff] [blame] | 185 | #define HDD_WAKE_LOCK_DURATION 50 //in msecs |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 186 | #endif |
| 187 | |
Amar Singhal | 6144c00 | 2013-05-03 16:11:42 -0700 | [diff] [blame] | 188 | #define HDD_SAP_WAKE_LOCK_DURATION 10000 //in msecs |
Madan Mohan Koyyalamudi | 69fc3ad | 2012-11-28 16:04:56 -0800 | [diff] [blame] | 189 | |
Sameer Thalappil | 451ebb9 | 2013-06-28 15:49:58 -0700 | [diff] [blame] | 190 | #define HDD_MOD_EXIT_SSR_MAX_RETRIES 30 |
| 191 | |
Sunil Ravi | a72c399 | 2013-01-31 06:12:22 -0800 | [diff] [blame] | 192 | /* Maximum number of interfaces allowed(STA, P2P Device, P2P Interface) */ |
| 193 | #define WLAN_MAX_INTERFACES 3 |
| 194 | |
Gopichand Nakkala | 870cbae | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 195 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 196 | #define GTK_OFFLOAD_ENABLE 0 |
| 197 | #define GTK_OFFLOAD_DISABLE 1 |
| 198 | #endif |
| 199 | |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 200 | #define HDD_MAC_ADDR_LEN 6 |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 201 | #define HDD_ROAM_SCAN_CHANNEL_SWITCH_TIME 3 |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 202 | typedef v_U8_t tWlanHddMacAddr[HDD_MAC_ADDR_LEN]; |
| 203 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 204 | typedef struct hdd_tx_rx_stats_s |
| 205 | { |
| 206 | // start_xmit stats |
| 207 | __u32 txXmitCalled; |
| 208 | __u32 txXmitDropped; |
| 209 | __u32 txXmitBackPressured; |
| 210 | __u32 txXmitQueued; |
| 211 | __u32 txXmitClassifiedAC[NUM_TX_QUEUES]; |
| 212 | __u32 txXmitDroppedAC[NUM_TX_QUEUES]; |
| 213 | __u32 txXmitBackPressuredAC[NUM_TX_QUEUES]; |
| 214 | __u32 txXmitQueuedAC[NUM_TX_QUEUES]; |
| 215 | // fetch_cbk stats |
| 216 | __u32 txFetched; |
| 217 | __u32 txFetchedAC[NUM_TX_QUEUES]; |
| 218 | __u32 txFetchEmpty; |
| 219 | __u32 txFetchLowResources; |
| 220 | __u32 txFetchDequeueError; |
| 221 | __u32 txFetchDequeued; |
| 222 | __u32 txFetchDequeuedAC[NUM_TX_QUEUES]; |
| 223 | __u32 txFetchDePressured; |
| 224 | __u32 txFetchDePressuredAC[NUM_TX_QUEUES]; |
| 225 | // complete_cbk_stats |
| 226 | __u32 txCompleted; |
| 227 | // flush stats |
| 228 | __u32 txFlushed; |
| 229 | __u32 txFlushedAC[NUM_TX_QUEUES]; |
| 230 | // rx stats |
| 231 | __u32 rxChains; |
| 232 | __u32 rxPackets; |
| 233 | __u32 rxDropped; |
| 234 | __u32 rxDelivered; |
| 235 | __u32 rxRefused; |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 236 | __u32 pkt_tx_count; //TX pkt Counter used for dynamic splitscan |
| 237 | __u32 pkt_rx_count; //RX pkt Counter used for dynamic splitscan |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 238 | } hdd_tx_rx_stats_t; |
| 239 | |
| 240 | typedef struct hdd_chip_reset_stats_s |
| 241 | { |
| 242 | __u32 totalLogpResets; |
| 243 | __u32 totalCMD53Failures; |
| 244 | __u32 totalMutexReadFailures; |
| 245 | __u32 totalMIFErrorFailures; |
| 246 | __u32 totalFWHearbeatFailures; |
| 247 | __u32 totalUnknownExceptions; |
| 248 | } hdd_chip_reset_stats_t; |
| 249 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 250 | #ifdef WLAN_FEATURE_11W |
| 251 | typedef struct hdd_pmf_stats_s |
| 252 | { |
| 253 | uint8 numUnprotDeauthRx; |
| 254 | uint8 numUnprotDisassocRx; |
| 255 | } hdd_pmf_stats_t; |
| 256 | #endif |
| 257 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 258 | typedef struct hdd_stats_s |
| 259 | { |
| 260 | tCsrSummaryStatsInfo summary_stat; |
| 261 | tCsrGlobalClassAStatsInfo ClassA_stat; |
| 262 | tCsrGlobalClassBStatsInfo ClassB_stat; |
| 263 | tCsrGlobalClassCStatsInfo ClassC_stat; |
| 264 | tCsrGlobalClassDStatsInfo ClassD_stat; |
| 265 | tCsrPerStaStatsInfo perStaStats; |
| 266 | hdd_tx_rx_stats_t hddTxRxStats; |
| 267 | hdd_chip_reset_stats_t hddChipResetStats; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 268 | #ifdef WLAN_FEATURE_11W |
| 269 | hdd_pmf_stats_t hddPmfStats; |
| 270 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 271 | } hdd_stats_t; |
| 272 | |
| 273 | typedef enum |
| 274 | { |
| 275 | HDD_ROAM_STATE_NONE, |
| 276 | |
| 277 | // Issuing a disconnect due to transition into low power states. |
| 278 | HDD_ROAM_STATE_DISCONNECTING_POWER, |
| 279 | |
| 280 | // move to this state when HDD sets a key with SME/CSR. Note this is |
| 281 | // an important state to get right because we will get calls into our SME |
| 282 | // callback routine for SetKey activity that we did not initiate! |
| 283 | HDD_ROAM_STATE_SETTING_KEY, |
| 284 | } HDD_ROAM_STATE; |
| 285 | |
| 286 | typedef enum |
| 287 | { |
| 288 | eHDD_SUSPEND_NONE = 0, |
| 289 | eHDD_SUSPEND_DEEP_SLEEP, |
| 290 | eHDD_SUSPEND_STANDBY, |
| 291 | } hdd_ps_state_t; |
| 292 | |
| 293 | typedef struct roaming_info_s |
| 294 | { |
| 295 | HDD_ROAM_STATE roamingState; |
| 296 | vos_event_t roamingEvent; |
Gopichand Nakkala | 3d29592 | 2013-05-07 16:19:14 +0530 | [diff] [blame] | 297 | |
| 298 | tWlanHddMacAddr bssid; |
| 299 | tWlanHddMacAddr peerMac; |
| 300 | tANI_U32 roamId; |
| 301 | eRoamCmdStatus roamStatus; |
| 302 | v_BOOL_t deferKeyComplete; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 303 | |
| 304 | } roaming_info_t; |
| 305 | |
| 306 | #ifdef FEATURE_WLAN_WAPI |
| 307 | /* Define WAPI macros for Length, BKID count etc*/ |
| 308 | #define MAX_WPI_KEY_LENGTH 16 |
| 309 | #define MAX_NUM_PN 16 |
| 310 | #define MAC_ADDR_LEN 6 |
| 311 | #define MAX_ADDR_INDEX 12 |
| 312 | #define MAX_NUM_AKM_SUITES 16 |
| 313 | #define MAX_NUM_UNI_SUITES 16 |
| 314 | #define MAX_NUM_BKIDS 16 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 315 | |
| 316 | /** WAPI AUTH mode definition */ |
| 317 | enum _WAPIAuthMode |
| 318 | { |
| 319 | WAPI_AUTH_MODE_OPEN = 0, |
| 320 | WAPI_AUTH_MODE_PSK = 1, |
| 321 | WAPI_AUTH_MODE_CERT |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 322 | } __packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 323 | typedef enum _WAPIAuthMode WAPIAuthMode; |
| 324 | |
| 325 | /** WAPI Work mode structure definition */ |
| 326 | #define WZC_ORIGINAL 0 |
| 327 | #define WAPI_EXTENTION 1 |
| 328 | |
| 329 | struct _WAPI_FUNCTION_MODE |
| 330 | { |
| 331 | unsigned char wapiMode; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 332 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 333 | |
| 334 | typedef struct _WAPI_FUNCTION_MODE WAPI_FUNCTION_MODE; |
| 335 | |
| 336 | typedef struct _WAPI_BKID |
| 337 | { |
| 338 | v_U8_t bkid[16]; |
| 339 | }WAPI_BKID, *pWAPI_BKID; |
| 340 | |
| 341 | /** WAPI Association information structure definition */ |
| 342 | struct _WAPI_AssocInfo |
| 343 | { |
| 344 | v_U8_t elementID; |
| 345 | v_U8_t length; |
| 346 | v_U16_t version; |
| 347 | v_U16_t akmSuiteCount; |
| 348 | v_U32_t akmSuite[MAX_NUM_AKM_SUITES]; |
| 349 | v_U16_t unicastSuiteCount; |
| 350 | v_U32_t unicastSuite[MAX_NUM_UNI_SUITES]; |
| 351 | v_U32_t multicastSuite; |
| 352 | v_U16_t wapiCability; |
| 353 | v_U16_t bkidCount; |
| 354 | WAPI_BKID bkidList[MAX_NUM_BKIDS]; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 355 | } __packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 356 | |
| 357 | typedef struct _WAPI_AssocInfo WAPI_AssocInfo; |
| 358 | typedef struct _WAPI_AssocInfo *pWAPI_IEAssocInfo; |
| 359 | |
| 360 | /** WAPI KEY Type definition */ |
| 361 | enum _WAPIKeyType |
| 362 | { |
| 363 | PAIRWISE_KEY, //0 |
| 364 | GROUP_KEY //1 |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 365 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 366 | typedef enum _WAPIKeyType WAPIKeyType; |
| 367 | |
| 368 | /** WAPI KEY Direction definition */ |
| 369 | enum _KEY_DIRECTION |
| 370 | { |
| 371 | None, |
| 372 | Rx, |
| 373 | Tx, |
| 374 | Rx_Tx |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 375 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 376 | |
| 377 | typedef enum _KEY_DIRECTION WAPI_KEY_DIRECTION; |
| 378 | |
| 379 | /** WAPI KEY stucture definition */ |
| 380 | struct WLAN_WAPI_KEY |
| 381 | { |
| 382 | WAPIKeyType keyType; |
| 383 | WAPI_KEY_DIRECTION keyDirection; /*reserved for future use*/ |
| 384 | v_U8_t keyId; |
| 385 | v_U8_t addrIndex[MAX_ADDR_INDEX]; /*reserved for future use*/ |
| 386 | int wpiekLen; |
| 387 | v_U8_t wpiek[MAX_WPI_KEY_LENGTH]; |
| 388 | int wpickLen; |
| 389 | v_U8_t wpick[MAX_WPI_KEY_LENGTH]; |
| 390 | v_U8_t pn[MAX_NUM_PN]; /*reserved for future use*/ |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 391 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 392 | |
| 393 | typedef struct WLAN_WAPI_KEY WLAN_WAPI_KEY; |
| 394 | typedef struct WLAN_WAPI_KEY *pWLAN_WAPI_KEY; |
| 395 | |
| 396 | #define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) |
| 397 | #define WLAN_EID_WAPI 68 |
| 398 | #define WAPI_PSK_AKM_SUITE 0x02721400 |
| 399 | #define WAPI_CERT_AKM_SUITE 0x01721400 |
| 400 | |
| 401 | /** WAPI BKID List stucture definition */ |
| 402 | struct _WLAN_BKID_LIST |
| 403 | { |
| 404 | v_U32_t length; |
| 405 | v_U32_t BKIDCount; |
| 406 | WAPI_BKID BKID[1]; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 407 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 408 | |
| 409 | typedef struct _WLAN_BKID_LIST WLAN_BKID_LIST; |
| 410 | typedef struct _WLAN_BKID_LIST *pWLAN_BKID_LIST; |
| 411 | |
| 412 | |
| 413 | /** WAPI Information stucture definition */ |
| 414 | struct hdd_wapi_info_s |
| 415 | { |
| 416 | v_U32_t nWapiMode; |
| 417 | v_BOOL_t fIsWapiSta; |
| 418 | v_MACADDR_t cachedMacAddr; |
| 419 | v_UCHAR_t wapiAuthMode; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 420 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 421 | typedef struct hdd_wapi_info_s hdd_wapi_info_t; |
| 422 | #endif /* FEATURE_WLAN_WAPI */ |
| 423 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 424 | typedef struct beacon_data_s { |
| 425 | u8 *head, *tail; |
| 426 | int head_len, tail_len; |
| 427 | int dtim_period; |
| 428 | } beacon_data_t; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 429 | |
| 430 | typedef enum device_mode |
| 431 | { /* MAINTAIN 1 - 1 CORRESPONDENCE WITH tVOS_CON_MODE*/ |
| 432 | WLAN_HDD_INFRA_STATION, |
| 433 | WLAN_HDD_SOFTAP, |
| 434 | WLAN_HDD_P2P_CLIENT, |
| 435 | WLAN_HDD_P2P_GO, |
Jeff Johnson | 88ba774 | 2013-02-27 14:36:02 -0800 | [diff] [blame] | 436 | WLAN_HDD_MONITOR, |
| 437 | WLAN_HDD_FTM, |
Shailender Karmuchi | a734f33 | 2013-04-19 14:02:48 -0700 | [diff] [blame] | 438 | WLAN_HDD_IBSS, |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 439 | WLAN_HDD_P2P_DEVICE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 440 | }device_mode_t; |
| 441 | |
| 442 | typedef enum rem_on_channel_request_type |
| 443 | { |
| 444 | REMAIN_ON_CHANNEL_REQUEST, |
| 445 | OFF_CHANNEL_ACTION_TX, |
| 446 | }rem_on_channel_request_type_t; |
| 447 | |
| 448 | /* Thermal mitigation Level Enum Type */ |
| 449 | typedef enum |
| 450 | { |
| 451 | WLAN_HDD_TM_LEVEL_0, |
| 452 | WLAN_HDD_TM_LEVEL_1, |
| 453 | WLAN_HDD_TM_LEVEL_2, |
| 454 | WLAN_HDD_TM_LEVEL_3, |
| 455 | WLAN_HDD_TM_LEVEL_4, |
| 456 | WLAN_HDD_TM_LEVEL_MAX |
| 457 | } WLAN_TmLevelEnumType; |
| 458 | |
| 459 | /* Driver Action based on thermal mitigation level structure */ |
| 460 | typedef struct |
| 461 | { |
| 462 | v_BOOL_t ampduEnable; |
| 463 | v_BOOL_t enterImps; |
| 464 | v_U32_t txSleepDuration; |
| 465 | v_U32_t txOperationDuration; |
| 466 | v_U32_t txBlockFrameCountThreshold; |
| 467 | } hdd_tmLevelAction_t; |
| 468 | |
| 469 | /* Thermal Mitigation control context structure */ |
| 470 | typedef struct |
| 471 | { |
| 472 | WLAN_TmLevelEnumType currentTmLevel; |
| 473 | hdd_tmLevelAction_t tmAction; |
| 474 | vos_timer_t txSleepTimer; |
| 475 | struct mutex tmOperationLock; |
| 476 | vos_event_t setTmDoneEvent; |
| 477 | v_U32_t txFrameCount; |
| 478 | v_TIME_t lastblockTs; |
| 479 | v_TIME_t lastOpenTs; |
| 480 | struct netdev_queue *blockedQueue; |
Leo Chang | 50bbd25 | 2013-04-25 14:58:01 -0700 | [diff] [blame] | 481 | v_BOOL_t qBlocked; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 482 | } hdd_thermal_mitigation_info_t; |
| 483 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 484 | typedef struct hdd_remain_on_chan_ctx |
| 485 | { |
| 486 | struct net_device *dev; |
| 487 | struct ieee80211_channel chan; |
| 488 | enum nl80211_channel_type chan_type; |
| 489 | unsigned int duration; |
| 490 | u64 cookie; |
| 491 | rem_on_channel_request_type_t rem_on_chan_request; |
| 492 | }hdd_remain_on_chan_ctx_t; |
| 493 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 494 | typedef enum{ |
| 495 | HDD_IDLE, |
| 496 | HDD_PD_REQ_ACK_PENDING, |
| 497 | HDD_GO_NEG_REQ_ACK_PENDING, |
| 498 | HDD_INVALID_STATE, |
| 499 | }eP2PActionFrameState; |
| 500 | |
| 501 | typedef enum { |
| 502 | WLAN_HDD_GO_NEG_REQ, |
| 503 | WLAN_HDD_GO_NEG_RESP, |
| 504 | WLAN_HDD_GO_NEG_CNF, |
| 505 | WLAN_HDD_INVITATION_REQ, |
| 506 | WLAN_HDD_INVITATION_RESP, |
| 507 | WLAN_HDD_DEV_DIS_REQ, |
| 508 | WLAN_HDD_DEV_DIS_RESP, |
| 509 | WLAN_HDD_PROV_DIS_REQ, |
| 510 | WLAN_HDD_PROV_DIS_RESP, |
| 511 | }tActionFrmType; |
| 512 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 513 | typedef struct hdd_cfg80211_state_s |
| 514 | { |
| 515 | tANI_U16 current_freq; |
| 516 | u64 action_cookie; |
| 517 | tANI_U8 *buf; |
| 518 | size_t len; |
| 519 | struct sk_buff *skb; |
| 520 | hdd_remain_on_chan_ctx_t* remain_on_chan_ctx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 521 | eP2PActionFrameState actionFrmState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 522 | }hdd_cfg80211_state_t; |
| 523 | |
Madan Mohan Koyyalamudi | b5da533 | 2012-10-15 17:23:21 -0700 | [diff] [blame] | 524 | |
| 525 | typedef enum{ |
| 526 | HDD_SSR_NOT_REQUIRED, |
| 527 | HDD_SSR_REQUIRED, |
| 528 | HDD_SSR_DISABLED, |
| 529 | }e_hdd_ssr_required; |
| 530 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 531 | struct hdd_station_ctx |
| 532 | { |
| 533 | /** Handle to the Wireless Extension State */ |
| 534 | hdd_wext_state_t WextState; |
| 535 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 536 | #ifdef FEATURE_WLAN_TDLS |
| 537 | tdlsCtx_t *pHddTdlsCtx; |
| 538 | #endif |
| 539 | |
| 540 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 541 | /**Connection information*/ |
| 542 | connection_info_t conn_info; |
| 543 | |
| 544 | roaming_info_t roam_info; |
| 545 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 546 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 547 | int ft_carrier_on; |
| 548 | #endif |
Gopichand Nakkala | 870cbae | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 549 | |
| 550 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 551 | tSirGtkOffloadParams gtkOffloadReqParams; |
Gopichand Nakkala | 870cbae | 2013-03-15 21:16:09 +0530 | [diff] [blame] | 552 | #endif |
Shailender Karmuchi | 15cd067 | 2013-05-15 19:50:04 -0700 | [diff] [blame] | 553 | /*Increment whenever ibss New peer joins and departs the network */ |
| 554 | int ibss_sta_generation; |
Shailender Karmuchi | 642e981 | 2013-05-30 14:34:49 -0700 | [diff] [blame] | 555 | |
| 556 | /*Save the wep/wpa-none keys*/ |
| 557 | tCsrRoamSetKey ibss_enc_key; |
Srinivas Girigowda | 66c05eb | 2013-07-14 13:06:01 -0700 | [diff] [blame] | 558 | |
| 559 | v_BOOL_t hdd_ReassocScenario; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 560 | }; |
| 561 | |
| 562 | #define BSS_STOP 0 |
| 563 | #define BSS_START 1 |
| 564 | typedef struct hdd_hostapd_state_s |
| 565 | { |
| 566 | int bssState; |
| 567 | vos_event_t vosEvent; |
| 568 | VOS_STATUS vosStatus; |
| 569 | v_BOOL_t bCommit; |
| 570 | |
| 571 | } hdd_hostapd_state_t; |
| 572 | |
| 573 | |
| 574 | /* |
| 575 | * Per station structure kept in HDD for multiple station support for SoftAP |
| 576 | */ |
| 577 | typedef struct { |
| 578 | /** The station entry is used or not */ |
| 579 | v_BOOL_t isUsed; |
| 580 | |
| 581 | /** Station ID reported back from HAL (through SAP). Broadcast |
| 582 | * uses station ID zero by default in both libra and volans. */ |
| 583 | v_U8_t ucSTAId; |
| 584 | |
| 585 | /** MAC address of the station */ |
| 586 | v_MACADDR_t macAddrSTA; |
| 587 | |
| 588 | /** Current Station state so HDD knows how to deal with packet |
| 589 | * queue. Most recent states used to change TL STA state. */ |
| 590 | WLANTL_STAStateType tlSTAState; |
| 591 | |
| 592 | /** Transmit queues for each AC (VO,VI,BE etc). */ |
| 593 | hdd_list_t wmm_tx_queue[NUM_TX_QUEUES]; |
| 594 | |
| 595 | /** Might need to differentiate queue depth in contention case */ |
| 596 | v_U16_t aTxQueueDepth[NUM_TX_QUEUES]; |
| 597 | |
| 598 | /**Track whether OS TX queue has been disabled.*/ |
| 599 | v_BOOL_t txSuspended[NUM_TX_QUEUES]; |
| 600 | |
| 601 | /** Track QoS status of station */ |
| 602 | v_BOOL_t isQosEnabled; |
| 603 | |
Madan Mohan Koyyalamudi | cd78499 | 2013-01-11 15:30:36 -0800 | [diff] [blame] | 604 | /** The station entry for which Deauth is in progress */ |
| 605 | v_BOOL_t isDeauthInProgress; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 606 | } hdd_station_info_t; |
| 607 | |
| 608 | struct hdd_ap_ctx_s |
| 609 | { |
| 610 | hdd_hostapd_state_t HostapdState; |
| 611 | |
| 612 | // Memory differentiation mode is enabled |
| 613 | //v_U16_t uMemoryDiffThreshold; |
| 614 | //v_U8_t uNumActiveAC; |
| 615 | //v_U8_t uActiveACMask; |
| 616 | //v_U8_t aTxQueueLimit[NUM_TX_QUEUES]; |
| 617 | |
| 618 | /** Packet Count to update uNumActiveAC and uActiveACMask */ |
| 619 | //v_U16_t uUpdatePktCount; |
| 620 | |
| 621 | /** Station ID assigned after BSS starts */ |
| 622 | v_U8_t uBCStaId; |
| 623 | |
| 624 | v_U8_t uPrivacy; // The privacy bits of configuration |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 625 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 626 | tSirWPSPBCProbeReq WPSPBCProbeReq; |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 627 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 628 | tsap_Config_t sapConfig; |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 629 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 630 | struct semaphore semWpsPBCOverlapInd; |
| 631 | |
| 632 | v_BOOL_t apDisableIntraBssFwd; |
| 633 | |
| 634 | vos_timer_t hdd_ap_inactivity_timer; |
| 635 | |
| 636 | v_U8_t operatingChannel; |
| 637 | |
| 638 | v_BOOL_t uIsAuthenticated; |
| 639 | |
| 640 | eCsrEncryptionType ucEncryptType; |
| 641 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 642 | //This will point to group key data, if it is received before start bss. |
| 643 | tCsrRoamSetKey groupKey; |
| 644 | // This will have WEP key data, if it is received before start bss |
| 645 | tCsrRoamSetKey wepKey[CSR_MAX_NUM_KEY]; |
| 646 | |
| 647 | beacon_data_t *beacon; |
Leo Chang | 614d207 | 2013-08-22 14:59:44 -0700 | [diff] [blame] | 648 | |
| 649 | //Elements for setting MC rate with SAP mode |
| 650 | v_U32_t targetMCRate; |
| 651 | v_U32_t getStasCookie; |
| 652 | tSap_Event getStasEventBuffer; |
| 653 | tSap_AssocMacAddr *assocStasBuffer; |
| 654 | struct completion sap_get_associated_stas_complete; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 655 | }; |
| 656 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 657 | struct hdd_mon_ctx_s |
| 658 | { |
| 659 | hdd_adapter_t *pAdapterForTx; |
| 660 | }; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 661 | |
| 662 | typedef struct hdd_scaninfo_s |
| 663 | { |
| 664 | /* The scan id */ |
| 665 | v_U32_t scanId; |
| 666 | |
| 667 | /* The scan pending */ |
| 668 | v_U32_t mScanPending; |
| 669 | |
| 670 | /* Client Wait Scan Result */ |
| 671 | v_U32_t waitScanResult; |
| 672 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 673 | /* Additional IE for scan */ |
| 674 | tSirAddie scanAddIE; |
| 675 | |
| 676 | /* Scan mode*/ |
| 677 | tSirScanType scan_mode; |
| 678 | |
| 679 | /* Scan Completion Event */ |
| 680 | struct completion scan_req_completion_event; |
| 681 | |
Madan Mohan Koyyalamudi | f4e8100 | 2012-11-13 10:46:38 -0800 | [diff] [blame] | 682 | /* completion variable for abortscan */ |
| 683 | struct completion abortscan_event_var; |
| 684 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 685 | vos_event_t scan_finished_event; |
| 686 | |
| 687 | hdd_scan_pending_option_e scan_pending_option; |
| 688 | |
| 689 | }hdd_scaninfo_t; |
| 690 | |
Gopichand Nakkala | 0f27681 | 2013-02-24 14:45:51 +0530 | [diff] [blame] | 691 | #define WLAN_HDD_MAX_MC_ADDR_LIST 10 |
| 692 | |
| 693 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 694 | typedef struct multicast_addr_list |
| 695 | { |
| 696 | v_U8_t isFilterApplied; |
| 697 | v_U8_t mc_cnt; |
| 698 | v_U8_t addr[WLAN_HDD_MAX_MC_ADDR_LIST][ETH_ALEN]; |
| 699 | } t_multicast_add_list; |
| 700 | #endif |
| 701 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 702 | #define WLAN_HDD_ADAPTER_MAGIC 0x574c414e //ASCII "WLAN" |
| 703 | struct hdd_adapter_s |
| 704 | { |
| 705 | void *pHddCtx; |
| 706 | |
| 707 | device_mode_t device_mode; |
| 708 | |
| 709 | /** Handle to the network device */ |
| 710 | struct net_device *dev; |
| 711 | |
| 712 | //TODO Move this to sta Ctx |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 713 | struct wireless_dev wdev ; |
| 714 | struct cfg80211_scan_request *request ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 715 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 716 | /** ops checks if Opportunistic Power Save is Enable or Not |
| 717 | * ctw stores ctWindow value once we receive Opps command from |
| 718 | * wpa_supplicant then using ctWindow value we need to Enable |
| 719 | * Opportunistic Power Save |
| 720 | */ |
| 721 | tANI_U8 ops; |
| 722 | tANI_U32 ctw; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 723 | |
| 724 | /** Current MAC Address for the adapter */ |
| 725 | v_MACADDR_t macAddressCurrent; |
| 726 | |
| 727 | /**Event Flags*/ |
| 728 | unsigned long event_flags; |
| 729 | |
| 730 | /**Device TX/RX statistics*/ |
| 731 | struct net_device_stats stats; |
| 732 | /** HDD statistics*/ |
| 733 | hdd_stats_t hdd_stats; |
| 734 | /**Mib information*/ |
| 735 | sHddMib_t hdd_mib; |
| 736 | |
| 737 | tANI_U8 sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 738 | |
| 739 | /* Completion variable for session close */ |
| 740 | struct completion session_close_comp_var; |
| 741 | |
| 742 | /* Completion variable for session open */ |
| 743 | struct completion session_open_comp_var; |
| 744 | |
| 745 | //TODO: move these to sta ctx. These may not be used in AP |
| 746 | /** completion variable for disconnect callback */ |
| 747 | struct completion disconnect_comp_var; |
| 748 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 749 | /** Completion of change country code */ |
| 750 | struct completion change_country_code; |
| 751 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 752 | /* completion variable for Linkup Event */ |
| 753 | struct completion linkup_event_var; |
| 754 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 755 | /* completion variable for cancel remain on channel Event */ |
| 756 | struct completion cancel_rem_on_chan_var; |
| 757 | |
| 758 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) |
| 759 | /* completion variable for off channel remain on channel Event */ |
| 760 | struct completion offchannel_tx_event; |
| 761 | #endif |
| 762 | /* Completion variable for action frame */ |
| 763 | struct completion tx_action_cnf_event; |
| 764 | /* Completion variable for remain on channel ready */ |
| 765 | struct completion rem_on_chan_ready_event; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 766 | |
Jeff Johnson | 9efb9aa | 2013-03-15 13:59:27 -0700 | [diff] [blame] | 767 | /* Completion variable for Upper Layer Authentication */ |
| 768 | struct completion ula_complete; |
| 769 | |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 770 | #ifdef FEATURE_WLAN_TDLS |
| 771 | struct completion tdls_add_station_comp; |
Gopichand Nakkala | e7cbc5d | 2013-03-27 21:09:23 -0700 | [diff] [blame] | 772 | struct completion tdls_del_station_comp; |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 773 | struct completion tdls_mgmt_comp; |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 774 | struct completion tdls_link_establish_req_comp; |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 775 | eHalStatus tdlsAddStaStatus; |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 776 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 777 | /* Track whether the linkup handling is needed */ |
| 778 | v_BOOL_t isLinkUpSvcNeeded; |
| 779 | |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 780 | /* Mgmt Frames TX completion status code */ |
| 781 | tANI_U32 mgmtTxCompletionStatus; |
| 782 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 783 | /************************************************************* |
| 784 | * Tx Queues |
| 785 | */ |
| 786 | /** Transmit queues for each AC (VO,VI,BE etc) */ |
| 787 | hdd_list_t wmm_tx_queue[NUM_TX_QUEUES]; |
| 788 | /**Track whether VOS is in a low resource state*/ |
| 789 | v_BOOL_t isVosOutOfResource; |
| 790 | |
| 791 | /**Track whether OS TX queue has been disabled.*/ |
| 792 | v_BOOL_t isTxSuspended[NUM_TX_QUEUES]; |
| 793 | |
| 794 | /** WMM Status */ |
| 795 | hdd_wmm_status_t hddWmmStatus; |
| 796 | /************************************************************* |
| 797 | */ |
| 798 | /************************************************************* |
| 799 | * TODO - Remove it later |
| 800 | */ |
| 801 | /** Multiple station supports */ |
| 802 | /** Per-station structure */ |
| 803 | spinlock_t staInfo_lock; //To protect access to station Info |
| 804 | hdd_station_info_t aStaInfo[WLAN_MAX_STA_COUNT]; |
| 805 | //v_U8_t uNumActiveStation; |
| 806 | |
| 807 | v_U16_t aTxQueueLimit[NUM_TX_QUEUES]; |
| 808 | /************************************************************* |
| 809 | */ |
| 810 | |
| 811 | #ifdef FEATURE_WLAN_WAPI |
| 812 | hdd_wapi_info_t wapi_info; |
| 813 | #endif |
| 814 | |
| 815 | v_S7_t rssi; |
Madan Mohan Koyyalamudi | d9383fd | 2013-08-13 09:27:30 +0530 | [diff] [blame] | 816 | |
| 817 | tANI_U8 snr; |
| 818 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 819 | struct work_struct monTxWorkQueue; |
| 820 | struct sk_buff *skb_to_tx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 821 | |
| 822 | union { |
| 823 | hdd_station_ctx_t station; |
| 824 | hdd_ap_ctx_t ap; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 825 | hdd_mon_ctx_t monitor; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 826 | }sessionCtx; |
| 827 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 828 | hdd_cfg80211_state_t cfg80211State; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 829 | |
Gopichand Nakkala | 0f27681 | 2013-02-24 14:45:51 +0530 | [diff] [blame] | 830 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 831 | t_multicast_add_list mc_addr_list; |
| 832 | #endif |
| 833 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 834 | //Magic cookie for adapter sanity verification |
| 835 | v_U32_t magic; |
| 836 | v_BOOL_t higherDtimTransition; |
Madan Mohan Koyyalamudi | d9383fd | 2013-08-13 09:27:30 +0530 | [diff] [blame] | 837 | v_BOOL_t survey_idx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 838 | }; |
| 839 | |
Madan Mohan Koyyalamudi | a53c4dc | 2012-11-13 10:35:42 -0800 | [diff] [blame] | 840 | #define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station) |
| 841 | #define WLAN_HDD_GET_AP_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap) |
| 842 | #define WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.station.WextState) |
| 843 | #define WLAN_HDD_GET_CTX(pAdapter) ((hdd_context_t*)pAdapter->pHddCtx) |
| 844 | #define WLAN_HDD_GET_HAL_CTX(pAdapter) (((hdd_context_t*)(pAdapter->pHddCtx))->hHal) |
| 845 | #define WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap.HostapdState) |
| 846 | #define WLAN_HDD_GET_CFG_STATE_PTR(pAdapter) (&(pAdapter)->cfg80211State) |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 847 | #ifdef FEATURE_WLAN_TDLS |
Madan Mohan Koyyalamudi | 8174692 | 2013-07-17 14:38:51 +0530 | [diff] [blame] | 848 | #define WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter) \ |
Gopichand Nakkala | 40ab275 | 2013-04-04 20:11:36 +0530 | [diff] [blame] | 849 | (((WLAN_HDD_INFRA_STATION != pAdapter->device_mode) && \ |
Madan Mohan Koyyalamudi | 8174692 | 2013-07-17 14:38:51 +0530 | [diff] [blame] | 850 | (WLAN_HDD_P2P_CLIENT != pAdapter->device_mode)) ? 0 : 1) |
| 851 | #define WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter) \ |
| 852 | ((WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter)) ? \ |
| 853 | (tdlsCtx_t*)(pAdapter)->sessionCtx.station.pHddTdlsCtx : NULL) |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 854 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 855 | |
| 856 | typedef struct hdd_adapter_list_node |
| 857 | { |
| 858 | hdd_list_node_t node; // MUST be first element |
| 859 | hdd_adapter_t *pAdapter; |
| 860 | }hdd_adapter_list_node_t; |
| 861 | |
| 862 | typedef struct hdd_priv_data_s |
| 863 | { |
| 864 | tANI_U8 *buf; |
| 865 | int used_len; |
| 866 | int total_len; |
| 867 | }hdd_priv_data_t; |
| 868 | |
Leo Chang | 64d68bc | 2013-06-04 15:40:52 -0700 | [diff] [blame] | 869 | typedef struct |
| 870 | { |
| 871 | vos_timer_t trafficTimer; |
| 872 | atomic_t isActiveMode; |
| 873 | v_U8_t isInitialized; |
| 874 | vos_lock_t trafficLock; |
| 875 | v_TIME_t lastFrameTs; |
| 876 | }hdd_traffic_monitor_t; |
| 877 | |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 878 | #ifdef FEATURE_WLAN_LPHB |
| 879 | typedef struct |
| 880 | { |
| 881 | v_U8_t enable; |
| 882 | v_U8_t item; |
| 883 | v_U8_t session; |
| 884 | } lphbEnableStruct; |
| 885 | #endif /* FEATURE_WLAN_LPHB */ |
| 886 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 887 | /** Adapter stucture definition */ |
| 888 | |
| 889 | struct hdd_context_s |
| 890 | { |
| 891 | /** Global VOS context */ |
| 892 | v_CONTEXT_t pvosContext; |
| 893 | |
| 894 | /** HAL handle...*/ |
| 895 | tHalHandle hHal; |
| 896 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 897 | struct wiphy *wiphy ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 898 | //TODO Remove this from here. |
| 899 | |
| 900 | hdd_list_t hddAdapters; //List of adapters |
| 901 | /* One per STA: 1 for RX_BCMC_STA_ID and 1 for SAP_SELF_STA_ID*/ |
| 902 | hdd_adapter_t *sta_to_adapter[WLAN_MAX_STA_COUNT + 3]; //One per sta. For quick reference. |
| 903 | |
| 904 | /** Pointer for firmware image data */ |
| 905 | const struct firmware *fw; |
| 906 | |
| 907 | /** Pointer for configuration data */ |
| 908 | const struct firmware *cfg; |
| 909 | |
| 910 | /** Pointer for nv data */ |
| 911 | const struct firmware *nv; |
| 912 | |
| 913 | /** Pointer to the parent device */ |
| 914 | struct device *parent_dev; |
| 915 | |
| 916 | pid_t pid_sdio_claimed; |
| 917 | atomic_t sdio_claim_count; |
| 918 | |
| 919 | /** Config values read from qcom_cfg.ini file */ |
| 920 | hdd_config_t *cfg_ini; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 921 | wlan_hdd_ftm_status_t ftm; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 922 | /** completion variable for full power callback */ |
| 923 | struct completion full_pwr_comp_var; |
| 924 | /** completion variable for Request BMPS callback */ |
| 925 | struct completion req_bmps_comp_var; |
| 926 | |
| 927 | /** completion variable for standby callback */ |
| 928 | struct completion standby_comp_var; |
| 929 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 930 | /* Completion variable to indicate Rx Thread Suspended */ |
| 931 | struct completion rx_sus_event_var; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 932 | |
| 933 | /* Completion variable to indicate Tx Thread Suspended */ |
| 934 | struct completion tx_sus_event_var; |
| 935 | |
| 936 | /* Completion variable to indicate Mc Thread Suspended */ |
| 937 | struct completion mc_sus_event_var; |
| 938 | |
Madan Mohan Koyyalamudi | c3a240c | 2012-09-28 15:34:08 -0700 | [diff] [blame] | 939 | /* Completion variable to wlan_hdd_get_crda_regd_entry */ |
| 940 | struct completion driver_crda_req; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 941 | |
| 942 | v_BOOL_t isWlanSuspended; |
| 943 | |
| 944 | v_BOOL_t isTxThreadSuspended; |
| 945 | |
| 946 | v_BOOL_t isMcThreadSuspended; |
| 947 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 948 | v_BOOL_t isRxThreadSuspended; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 949 | |
| 950 | volatile v_BOOL_t isLogpInProgress; |
| 951 | |
| 952 | v_BOOL_t isLoadUnloadInProgress; |
| 953 | |
| 954 | /**Track whether driver has been suspended.*/ |
| 955 | hdd_ps_state_t hdd_ps_state; |
| 956 | |
| 957 | /* Track whether Mcast/Bcast Filter is enabled.*/ |
| 958 | v_BOOL_t hdd_mcastbcast_filter_set; |
| 959 | |
| 960 | /* Track whether ignore DTIM is enabled*/ |
| 961 | v_BOOL_t hdd_ignore_dtim_enabled; |
| 962 | v_U32_t hdd_actual_ignore_DTIM_value; |
| 963 | v_U32_t hdd_actual_LI_value; |
| 964 | |
| 965 | |
| 966 | v_BOOL_t hdd_wlan_suspended; |
| 967 | |
| 968 | spinlock_t filter_lock; |
| 969 | |
| 970 | /* Lock to avoid race condtion during start/stop bss*/ |
| 971 | struct mutex sap_lock; |
| 972 | |
| 973 | /** ptt Process ID*/ |
| 974 | v_SINT_t ptt_pid; |
Leo Chang | 9e64608 | 2013-08-02 11:20:21 -0700 | [diff] [blame] | 975 | #ifdef WLAN_KD_READY_NOTIFIER |
| 976 | v_BOOL_t kd_nl_init; |
| 977 | #endif /* WLAN_KD_READY_NOTIFIER */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 978 | v_U8_t change_iface; |
| 979 | |
| 980 | /** Concurrency Parameters*/ |
| 981 | tVOS_CONCURRENCY_MODE concurrency_mode; |
| 982 | |
Yue Ma | 3ede605 | 2013-08-29 00:33:26 -0700 | [diff] [blame] | 983 | v_U16_t no_of_sessions[VOS_MAX_NO_OF_MODE + 1]; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 984 | |
| 985 | hdd_chip_reset_stats_t hddChipResetStats; |
| 986 | /* Number of times riva restarted */ |
| 987 | v_U32_t hddRivaResetStats; |
| 988 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 989 | /* Can we allow AMP connection right now*/ |
| 990 | v_BOOL_t isAmpAllowed; |
| 991 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 992 | /** P2P Device MAC Address for the adapter */ |
| 993 | v_MACADDR_t p2pDeviceAddress; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 994 | |
| 995 | /* Thermal mitigation information */ |
| 996 | hdd_thermal_mitigation_info_t tmInfo; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 997 | |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 998 | #ifdef WLAN_OPEN_SOURCE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 999 | #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK |
| 1000 | struct wake_lock rx_wake_lock; |
| 1001 | #endif |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 1002 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1003 | |
| 1004 | /* |
| 1005 | * Framework initiated driver restarting |
| 1006 | * hdd_reload_timer : Restart retry timer |
| 1007 | * isRestartInProgress: Restart in progress |
| 1008 | * hdd_restart_retries: Restart retries |
| 1009 | * |
| 1010 | */ |
| 1011 | vos_timer_t hdd_restart_timer; |
| 1012 | atomic_t isRestartInProgress; |
| 1013 | u_int8_t hdd_restart_retries; |
| 1014 | |
Madan Mohan Koyyalamudi | 2a1ba77 | 2012-10-11 14:59:06 -0700 | [diff] [blame] | 1015 | hdd_scaninfo_t scan_info; |
Gopichand Nakkala | f7e53c5 | 2013-01-07 14:52:52 -0800 | [diff] [blame] | 1016 | |
Madan Mohan Koyyalamudi | 543172b | 2012-12-05 16:40:18 -0800 | [diff] [blame] | 1017 | /*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] | 1018 | is invoked*/ |
Madan Mohan Koyyalamudi | 543172b | 2012-12-05 16:40:18 -0800 | [diff] [blame] | 1019 | v_BOOL_t is_dynamic_channel_range_set; |
Madan Mohan Koyyalamudi | 69fc3ad | 2012-11-28 16:04:56 -0800 | [diff] [blame] | 1020 | |
Gopichand Nakkala | 1bc04f1 | 2013-02-28 14:29:23 -0800 | [diff] [blame] | 1021 | #ifdef WLAN_OPEN_SOURCE |
Madan Mohan Koyyalamudi | 69fc3ad | 2012-11-28 16:04:56 -0800 | [diff] [blame] | 1022 | struct wake_lock sap_wake_lock; |
Gopichand Nakkala | 1bc04f1 | 2013-02-28 14:29:23 -0800 | [diff] [blame] | 1023 | #endif |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 1024 | |
| 1025 | #ifdef FEATURE_WLAN_TDLS |
| 1026 | eTDLSSupportMode tdls_mode; |
Hoonki Lee | 2751190 | 2013-03-14 18:19:06 -0700 | [diff] [blame] | 1027 | eTDLSSupportMode tdls_mode_last; |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 1028 | tdlsConnInfo_t tdlsConnInfo[HDD_MAX_NUM_TDLS_STA]; |
| 1029 | /* TDLS peer connected count */ |
| 1030 | tANI_U16 connected_peer_count; |
Hoonki Lee | 93e67ff | 2013-03-19 15:49:25 -0700 | [diff] [blame] | 1031 | tdls_scan_context_t tdls_scan_ctxt; |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 1032 | #endif |
Leo Chang | 64d68bc | 2013-06-04 15:40:52 -0700 | [diff] [blame] | 1033 | hdd_traffic_monitor_t traffic_monitor; |
Gopichand Nakkala | b8f0f1a | 2013-05-23 18:19:48 +0530 | [diff] [blame] | 1034 | |
| 1035 | /* MC/BC Filter state variable |
| 1036 | * This always contains the value that is currently |
| 1037 | * configured |
| 1038 | * */ |
| 1039 | v_U8_t configuredMcastBcastFilter; |
Gopichand Nakkala | 8c0386c | 2013-07-09 23:31:37 +0530 | [diff] [blame] | 1040 | |
Amar Singhal | 49fdfd5 | 2013-08-13 13:25:12 -0700 | [diff] [blame] | 1041 | v_U8_t sus_res_mcastbcast_filter; |
| 1042 | |
Gopichand Nakkala | 8c0386c | 2013-07-09 23:31:37 +0530 | [diff] [blame] | 1043 | vos_timer_t hdd_p2p_go_conn_is_in_progress; |
| 1044 | |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 1045 | #ifdef FEATURE_WLAN_LPHB |
| 1046 | lphbEnableStruct lphbEnableReq; |
| 1047 | #endif /* FEATURE_WLAN_LPHB */ |
Yue Ma | 0d4891e | 2013-08-06 17:01:45 -0700 | [diff] [blame] | 1048 | |
| 1049 | /* debugfs entry */ |
| 1050 | struct dentry *debugfs_phy; |
Kamath Vinayak | 4000c9a | 2013-08-23 14:24:27 +0530 | [diff] [blame] | 1051 | |
| 1052 | /* Use below lock to protect access to isSchedScanUpdatePending |
| 1053 | * since it will be accessed in two different contexts. |
| 1054 | */ |
| 1055 | spinlock_t schedScan_lock; |
| 1056 | |
| 1057 | // Flag keeps track of wiphy suspend/resume |
| 1058 | v_BOOL_t isWiphySuspended; |
| 1059 | |
| 1060 | // Indicates about pending sched_scan results |
| 1061 | v_BOOL_t isSchedScanUpdatePending; |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 1062 | /* |
| 1063 | * TX_rx_pkt_count_timer |
| 1064 | */ |
| 1065 | vos_timer_t tx_rx_trafficTmr; |
| 1066 | v_U8_t drvr_miracast; |
| 1067 | v_U8_t issplitscan_enabled; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1068 | }; |
| 1069 | |
| 1070 | |
| 1071 | |
| 1072 | /*--------------------------------------------------------------------------- |
| 1073 | Function declarations and documenation |
| 1074 | -------------------------------------------------------------------------*/ |
| 1075 | VOS_STATUS hdd_get_front_adapter( hdd_context_t *pHddCtx, |
| 1076 | hdd_adapter_list_node_t** ppAdapterNode); |
| 1077 | |
| 1078 | VOS_STATUS hdd_get_next_adapter( hdd_context_t *pHddCtx, |
| 1079 | hdd_adapter_list_node_t* pAdapterNode, |
| 1080 | hdd_adapter_list_node_t** pNextAdapterNode); |
| 1081 | |
| 1082 | VOS_STATUS hdd_remove_adapter( hdd_context_t *pHddCtx, |
| 1083 | hdd_adapter_list_node_t* pAdapterNode); |
| 1084 | |
| 1085 | VOS_STATUS hdd_remove_front_adapter( hdd_context_t *pHddCtx, |
| 1086 | hdd_adapter_list_node_t** ppAdapterNode); |
| 1087 | |
| 1088 | VOS_STATUS hdd_add_adapter_back( hdd_context_t *pHddCtx, |
| 1089 | hdd_adapter_list_node_t* pAdapterNode); |
| 1090 | |
| 1091 | VOS_STATUS hdd_add_adapter_front( hdd_context_t *pHddCtx, |
| 1092 | hdd_adapter_list_node_t* pAdapterNode); |
| 1093 | |
| 1094 | 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] | 1095 | const char* name, tSirMacAddr macAddr, |
| 1096 | tANI_U8 rtnl_held ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1097 | VOS_STATUS hdd_close_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, tANI_U8 rtnl_held ); |
| 1098 | VOS_STATUS hdd_close_all_adapters( hdd_context_t *pHddCtx ); |
| 1099 | VOS_STATUS hdd_stop_all_adapters( hdd_context_t *pHddCtx ); |
| 1100 | VOS_STATUS hdd_reset_all_adapters( hdd_context_t *pHddCtx ); |
| 1101 | VOS_STATUS hdd_start_all_adapters( hdd_context_t *pHddCtx ); |
| 1102 | VOS_STATUS hdd_reconnect_all_adapters( hdd_context_t *pHddCtx ); |
Sudhir Sattayappa Kohalli | 90e4c75 | 2013-03-21 14:25:04 -0700 | [diff] [blame] | 1103 | void hdd_dump_concurrency_info(hdd_context_t *pHddCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1104 | hdd_adapter_t * hdd_get_adapter_by_name( hdd_context_t *pHddCtx, tANI_U8 *name ); |
| 1105 | hdd_adapter_t * hdd_get_adapter_by_macaddr( hdd_context_t *pHddCtx, tSirMacAddr macAddr ); |
| 1106 | hdd_adapter_t * hdd_get_mon_adapter( hdd_context_t *pHddCtx ); |
| 1107 | VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter ); |
| 1108 | hdd_adapter_t * hdd_get_adapter( hdd_context_t *pHddCtx, device_mode_t mode ); |
| 1109 | void hdd_deinit_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ); |
| 1110 | VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ); |
| 1111 | void hdd_set_station_ops( struct net_device *pWlanDev ); |
| 1112 | tANI_U8* wlan_hdd_get_intf_addr(hdd_context_t* pHddCtx); |
| 1113 | void wlan_hdd_release_intf_addr(hdd_context_t* pHddCtx, tANI_U8* releaseAddr); |
| 1114 | v_U8_t hdd_get_operating_channel( hdd_context_t *pHddCtx, device_mode_t mode ); |
| 1115 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1116 | void hdd_set_conparam ( v_UINT_t newParam ); |
| 1117 | tVOS_CON_MODE hdd_get_conparam( void ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1118 | |
| 1119 | void wlan_hdd_enable_deepsleep(v_VOID_t * pVosContext); |
| 1120 | 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] | 1121 | v_BOOL_t hdd_is_suspend_notify_allowed(hdd_context_t* pHddCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1122 | void hdd_abort_mac_scan(hdd_context_t *pHddCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1123 | void wlan_hdd_set_monitor_tx_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ); |
| 1124 | void hdd_cleanup_actionframe( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ); |
Madan Mohan Koyyalamudi | c3a240c | 2012-09-28 15:34:08 -0700 | [diff] [blame] | 1125 | v_BOOL_t is_crda_regulatory_entry_valid(void); |
Yunsen Wang | e3ba1fb | 2013-04-05 15:04:43 -0700 | [diff] [blame] | 1126 | void crda_regulatory_entry_default(v_U8_t *countryCode, int domain_id); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1127 | void wlan_hdd_set_concurrency_mode(hdd_context_t *pHddCtx, tVOS_CON_MODE mode); |
| 1128 | void wlan_hdd_clear_concurrency_mode(hdd_context_t *pHddCtx, tVOS_CON_MODE mode); |
| 1129 | void wlan_hdd_reset_prob_rspies(hdd_adapter_t* pHostapdAdapter); |
| 1130 | void hdd_prevent_suspend(void); |
| 1131 | void hdd_allow_suspend(void); |
Madan Mohan Koyyalamudi | 10d83a9 | 2012-09-28 15:47:05 -0700 | [diff] [blame] | 1132 | void hdd_allow_suspend_timeout(v_U32_t timeout); |
Madan Mohan Koyyalamudi | b5da533 | 2012-10-15 17:23:21 -0700 | [diff] [blame] | 1133 | bool hdd_is_ssr_required(void); |
| 1134 | void hdd_set_ssr_required(e_hdd_ssr_required value); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1135 | |
| 1136 | VOS_STATUS hdd_enable_bmps_imps(hdd_context_t *pHddCtx); |
| 1137 | VOS_STATUS hdd_disable_bmps_imps(hdd_context_t *pHddCtx, tANI_U8 session_type); |
| 1138 | |
Madan Mohan Koyyalamudi | 7127826 | 2013-04-12 22:00:48 +0530 | [diff] [blame] | 1139 | void wlan_hdd_cfg80211_update_reg_info(struct wiphy *wiphy); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1140 | VOS_STATUS wlan_hdd_restart_driver(hdd_context_t *pHddCtx); |
Madan Mohan Koyyalamudi | 8612ec9 | 2012-09-28 15:53:07 -0700 | [diff] [blame] | 1141 | void hdd_exchange_version_and_caps(hdd_context_t *pHddCtx); |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 1142 | void hdd_set_pwrparams(hdd_context_t *pHddCtx); |
| 1143 | void hdd_reset_pwrparams(hdd_context_t *pHddCtx); |
Gopichand Nakkala | f502e2b | 2013-05-24 18:34:25 +0530 | [diff] [blame] | 1144 | int wlan_hdd_validate_context(hdd_context_t *pHddCtx); |
Sudhir Sattayappa Kohalli | b1d8c3a | 2013-06-18 14:47:20 -0700 | [diff] [blame] | 1145 | VOS_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *pHddCtx); |
Gopichand Nakkala | 227c7f3 | 2013-06-26 22:44:57 +0530 | [diff] [blame] | 1146 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 1147 | int wlan_hdd_setIPv6Filter(hdd_context_t *pHddCtx, tANI_U8 filterType, tANI_U8 sessionId); |
| 1148 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1149 | #endif // end #if !defined( WLAN_HDD_MAIN_H ) |