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