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) |
| 104 | /**event flags registered net device*/ |
Madan Mohan Koyyalamudi | a53c4dc | 2012-11-13 10:35:42 -0800 | [diff] [blame] | 105 | #define NET_DEVICE_REGISTERED (1<<0) |
| 106 | #define SME_SESSION_OPENED (1<<1) |
| 107 | #define INIT_TX_RX_SUCCESS (1<<2) |
| 108 | #define WMM_INIT_DONE (1<<3) |
| 109 | #define SOFTAP_BSS_STARTED (1<<4) |
| 110 | #define DEVICE_IFACE_OPENED (1<<5) |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 111 | #define TDLS_INIT_DONE (1<<6) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 112 | |
| 113 | /** Maximum time(ms)to wait for disconnect to complete **/ |
| 114 | #define WLAN_WAIT_TIME_DISCONNECT 500 |
| 115 | #define WLAN_WAIT_TIME_STATS 800 |
| 116 | #define WLAN_WAIT_TIME_POWER 800 |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 117 | /* Amount of time to wait for sme close session callback. |
| 118 | This value should be larger than the timeout used by WDI to wait for |
| 119 | a response from WCNSS */ |
| 120 | #define WLAN_WAIT_TIME_SESSIONOPENCLOSE 15000 |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 121 | #define WLAN_WAIT_TIME_ABORTSCAN 2000 |
| 122 | |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 123 | /** Maximum time(ms) to wait for tdls add sta to complete **/ |
| 124 | #define WAIT_TIME_TDLS_ADD_STA 1500 |
| 125 | |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 126 | /** Maximum time(ms) to wait for tdls mgmt to complete **/ |
Gopichand Nakkala | 21c3f9b | 2013-03-23 14:45:55 -0700 | [diff] [blame] | 127 | #define WAIT_TIME_TDLS_MGMT 11000 |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 128 | |
Madan Mohan Koyyalamudi | c3a240c | 2012-09-28 15:34:08 -0700 | [diff] [blame] | 129 | /* Maximum time to get crda entry settings */ |
| 130 | #define CRDA_WAIT_TIME 300 |
| 131 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 132 | /* Scan Req Timeout */ |
| 133 | #define WLAN_WAIT_TIME_SCAN_REQ 100 |
| 134 | |
| 135 | #define MAX_NUMBER_OF_ADAPTERS 4 |
| 136 | |
| 137 | #define MAX_CFG_STRING_LEN 255 |
| 138 | |
| 139 | #define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] |
| 140 | /** Mac Address string **/ |
| 141 | #define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x" |
| 142 | #define MAX_GENIE_LEN 255 |
| 143 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 144 | #define WLAN_CHIP_VERSION "WCNSS" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 145 | |
| 146 | #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] | 147 | #define ENTER() VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Enter:%s", __func__) |
| 148 | #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] | 149 | |
| 150 | #define WLAN_HDD_GET_PRIV_PTR(__dev__) (hdd_adapter_t*)(netdev_priv((__dev__))) |
| 151 | |
| 152 | #define MAX_EXIT_ATTEMPTS_DURING_LOGP 20 |
| 153 | |
| 154 | #define MAX_NO_OF_2_4_CHANNELS 14 |
| 155 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 156 | #define WLAN_HDD_PUBLIC_ACTION_FRAME 4 |
| 157 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET 24 |
| 158 | #define WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET 30 |
| 159 | #define WLAN_HDD_P2P_SOCIAL_CHANNELS 3 |
Madan Mohan Koyyalamudi | 8d50f31 | 2012-11-27 15:48:57 -0800 | [diff] [blame] | 160 | #define WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN 1 |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 161 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame^] | 162 | #ifdef WLAN_FEATURE_11W |
| 163 | #define WLAN_HDD_SA_QUERY_ACTION_FRAME 8 |
| 164 | #endif |
| 165 | |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 166 | #define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14 |
| 167 | #define WLAN_HDD_TDLS_ACTION_FRAME 12 |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 168 | #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK |
| 169 | #define HDD_WAKE_LOCK_DURATION 50 |
| 170 | #endif |
| 171 | |
Madan Mohan Koyyalamudi | 69fc3ad | 2012-11-28 16:04:56 -0800 | [diff] [blame] | 172 | #define HDD_SAP_WAKE_LOCK_DURATION 10000 //10 sec |
| 173 | |
Sunil Ravi | a72c399 | 2013-01-31 06:12:22 -0800 | [diff] [blame] | 174 | /* Maximum number of interfaces allowed(STA, P2P Device, P2P Interface) */ |
| 175 | #define WLAN_MAX_INTERFACES 3 |
| 176 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 177 | typedef struct hdd_tx_rx_stats_s |
| 178 | { |
| 179 | // start_xmit stats |
| 180 | __u32 txXmitCalled; |
| 181 | __u32 txXmitDropped; |
| 182 | __u32 txXmitBackPressured; |
| 183 | __u32 txXmitQueued; |
| 184 | __u32 txXmitClassifiedAC[NUM_TX_QUEUES]; |
| 185 | __u32 txXmitDroppedAC[NUM_TX_QUEUES]; |
| 186 | __u32 txXmitBackPressuredAC[NUM_TX_QUEUES]; |
| 187 | __u32 txXmitQueuedAC[NUM_TX_QUEUES]; |
| 188 | // fetch_cbk stats |
| 189 | __u32 txFetched; |
| 190 | __u32 txFetchedAC[NUM_TX_QUEUES]; |
| 191 | __u32 txFetchEmpty; |
| 192 | __u32 txFetchLowResources; |
| 193 | __u32 txFetchDequeueError; |
| 194 | __u32 txFetchDequeued; |
| 195 | __u32 txFetchDequeuedAC[NUM_TX_QUEUES]; |
| 196 | __u32 txFetchDePressured; |
| 197 | __u32 txFetchDePressuredAC[NUM_TX_QUEUES]; |
| 198 | // complete_cbk_stats |
| 199 | __u32 txCompleted; |
| 200 | // flush stats |
| 201 | __u32 txFlushed; |
| 202 | __u32 txFlushedAC[NUM_TX_QUEUES]; |
| 203 | // rx stats |
| 204 | __u32 rxChains; |
| 205 | __u32 rxPackets; |
| 206 | __u32 rxDropped; |
| 207 | __u32 rxDelivered; |
| 208 | __u32 rxRefused; |
| 209 | } hdd_tx_rx_stats_t; |
| 210 | |
| 211 | typedef struct hdd_chip_reset_stats_s |
| 212 | { |
| 213 | __u32 totalLogpResets; |
| 214 | __u32 totalCMD53Failures; |
| 215 | __u32 totalMutexReadFailures; |
| 216 | __u32 totalMIFErrorFailures; |
| 217 | __u32 totalFWHearbeatFailures; |
| 218 | __u32 totalUnknownExceptions; |
| 219 | } hdd_chip_reset_stats_t; |
| 220 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame^] | 221 | #ifdef WLAN_FEATURE_11W |
| 222 | typedef struct hdd_pmf_stats_s |
| 223 | { |
| 224 | uint8 numUnprotDeauthRx; |
| 225 | uint8 numUnprotDisassocRx; |
| 226 | } hdd_pmf_stats_t; |
| 227 | #endif |
| 228 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 229 | typedef struct hdd_stats_s |
| 230 | { |
| 231 | tCsrSummaryStatsInfo summary_stat; |
| 232 | tCsrGlobalClassAStatsInfo ClassA_stat; |
| 233 | tCsrGlobalClassBStatsInfo ClassB_stat; |
| 234 | tCsrGlobalClassCStatsInfo ClassC_stat; |
| 235 | tCsrGlobalClassDStatsInfo ClassD_stat; |
| 236 | tCsrPerStaStatsInfo perStaStats; |
| 237 | hdd_tx_rx_stats_t hddTxRxStats; |
| 238 | hdd_chip_reset_stats_t hddChipResetStats; |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame^] | 239 | #ifdef WLAN_FEATURE_11W |
| 240 | hdd_pmf_stats_t hddPmfStats; |
| 241 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 242 | } hdd_stats_t; |
| 243 | |
| 244 | typedef enum |
| 245 | { |
| 246 | HDD_ROAM_STATE_NONE, |
| 247 | |
| 248 | // Issuing a disconnect due to transition into low power states. |
| 249 | HDD_ROAM_STATE_DISCONNECTING_POWER, |
| 250 | |
| 251 | // move to this state when HDD sets a key with SME/CSR. Note this is |
| 252 | // an important state to get right because we will get calls into our SME |
| 253 | // callback routine for SetKey activity that we did not initiate! |
| 254 | HDD_ROAM_STATE_SETTING_KEY, |
| 255 | } HDD_ROAM_STATE; |
| 256 | |
| 257 | typedef enum |
| 258 | { |
| 259 | eHDD_SUSPEND_NONE = 0, |
| 260 | eHDD_SUSPEND_DEEP_SLEEP, |
| 261 | eHDD_SUSPEND_STANDBY, |
| 262 | } hdd_ps_state_t; |
| 263 | |
| 264 | typedef struct roaming_info_s |
| 265 | { |
| 266 | HDD_ROAM_STATE roamingState; |
| 267 | vos_event_t roamingEvent; |
| 268 | |
| 269 | } roaming_info_t; |
| 270 | |
| 271 | #ifdef FEATURE_WLAN_WAPI |
| 272 | /* Define WAPI macros for Length, BKID count etc*/ |
| 273 | #define MAX_WPI_KEY_LENGTH 16 |
| 274 | #define MAX_NUM_PN 16 |
| 275 | #define MAC_ADDR_LEN 6 |
| 276 | #define MAX_ADDR_INDEX 12 |
| 277 | #define MAX_NUM_AKM_SUITES 16 |
| 278 | #define MAX_NUM_UNI_SUITES 16 |
| 279 | #define MAX_NUM_BKIDS 16 |
| 280 | #define HDD_PAIRWISE_WAPI_KEY 0 |
| 281 | #define HDD_GROUP_WAPI_KEY 1 |
| 282 | |
| 283 | /** WAPI AUTH mode definition */ |
| 284 | enum _WAPIAuthMode |
| 285 | { |
| 286 | WAPI_AUTH_MODE_OPEN = 0, |
| 287 | WAPI_AUTH_MODE_PSK = 1, |
| 288 | WAPI_AUTH_MODE_CERT |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 289 | } __packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 290 | typedef enum _WAPIAuthMode WAPIAuthMode; |
| 291 | |
| 292 | /** WAPI Work mode structure definition */ |
| 293 | #define WZC_ORIGINAL 0 |
| 294 | #define WAPI_EXTENTION 1 |
| 295 | |
| 296 | struct _WAPI_FUNCTION_MODE |
| 297 | { |
| 298 | unsigned char wapiMode; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 299 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 300 | |
| 301 | typedef struct _WAPI_FUNCTION_MODE WAPI_FUNCTION_MODE; |
| 302 | |
| 303 | typedef struct _WAPI_BKID |
| 304 | { |
| 305 | v_U8_t bkid[16]; |
| 306 | }WAPI_BKID, *pWAPI_BKID; |
| 307 | |
| 308 | /** WAPI Association information structure definition */ |
| 309 | struct _WAPI_AssocInfo |
| 310 | { |
| 311 | v_U8_t elementID; |
| 312 | v_U8_t length; |
| 313 | v_U16_t version; |
| 314 | v_U16_t akmSuiteCount; |
| 315 | v_U32_t akmSuite[MAX_NUM_AKM_SUITES]; |
| 316 | v_U16_t unicastSuiteCount; |
| 317 | v_U32_t unicastSuite[MAX_NUM_UNI_SUITES]; |
| 318 | v_U32_t multicastSuite; |
| 319 | v_U16_t wapiCability; |
| 320 | v_U16_t bkidCount; |
| 321 | WAPI_BKID bkidList[MAX_NUM_BKIDS]; |
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 | |
| 324 | typedef struct _WAPI_AssocInfo WAPI_AssocInfo; |
| 325 | typedef struct _WAPI_AssocInfo *pWAPI_IEAssocInfo; |
| 326 | |
| 327 | /** WAPI KEY Type definition */ |
| 328 | enum _WAPIKeyType |
| 329 | { |
| 330 | PAIRWISE_KEY, //0 |
| 331 | GROUP_KEY //1 |
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 | typedef enum _WAPIKeyType WAPIKeyType; |
| 334 | |
| 335 | /** WAPI KEY Direction definition */ |
| 336 | enum _KEY_DIRECTION |
| 337 | { |
| 338 | None, |
| 339 | Rx, |
| 340 | Tx, |
| 341 | Rx_Tx |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 342 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 343 | |
| 344 | typedef enum _KEY_DIRECTION WAPI_KEY_DIRECTION; |
| 345 | |
| 346 | /** WAPI KEY stucture definition */ |
| 347 | struct WLAN_WAPI_KEY |
| 348 | { |
| 349 | WAPIKeyType keyType; |
| 350 | WAPI_KEY_DIRECTION keyDirection; /*reserved for future use*/ |
| 351 | v_U8_t keyId; |
| 352 | v_U8_t addrIndex[MAX_ADDR_INDEX]; /*reserved for future use*/ |
| 353 | int wpiekLen; |
| 354 | v_U8_t wpiek[MAX_WPI_KEY_LENGTH]; |
| 355 | int wpickLen; |
| 356 | v_U8_t wpick[MAX_WPI_KEY_LENGTH]; |
| 357 | v_U8_t pn[MAX_NUM_PN]; /*reserved for future use*/ |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 358 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 359 | |
| 360 | typedef struct WLAN_WAPI_KEY WLAN_WAPI_KEY; |
| 361 | typedef struct WLAN_WAPI_KEY *pWLAN_WAPI_KEY; |
| 362 | |
| 363 | #define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0])) |
| 364 | #define WLAN_EID_WAPI 68 |
| 365 | #define WAPI_PSK_AKM_SUITE 0x02721400 |
| 366 | #define WAPI_CERT_AKM_SUITE 0x01721400 |
| 367 | |
| 368 | /** WAPI BKID List stucture definition */ |
| 369 | struct _WLAN_BKID_LIST |
| 370 | { |
| 371 | v_U32_t length; |
| 372 | v_U32_t BKIDCount; |
| 373 | WAPI_BKID BKID[1]; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 374 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 375 | |
| 376 | typedef struct _WLAN_BKID_LIST WLAN_BKID_LIST; |
| 377 | typedef struct _WLAN_BKID_LIST *pWLAN_BKID_LIST; |
| 378 | |
| 379 | |
| 380 | /** WAPI Information stucture definition */ |
| 381 | struct hdd_wapi_info_s |
| 382 | { |
| 383 | v_U32_t nWapiMode; |
| 384 | v_BOOL_t fIsWapiSta; |
| 385 | v_MACADDR_t cachedMacAddr; |
| 386 | v_UCHAR_t wapiAuthMode; |
Madan Mohan Koyyalamudi | 4e31b13 | 2012-11-02 13:13:52 -0700 | [diff] [blame] | 387 | }__packed; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 388 | typedef struct hdd_wapi_info_s hdd_wapi_info_t; |
| 389 | #endif /* FEATURE_WLAN_WAPI */ |
| 390 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 391 | typedef struct beacon_data_s { |
| 392 | u8 *head, *tail; |
| 393 | int head_len, tail_len; |
| 394 | int dtim_period; |
| 395 | } beacon_data_t; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 396 | |
| 397 | typedef enum device_mode |
| 398 | { /* MAINTAIN 1 - 1 CORRESPONDENCE WITH tVOS_CON_MODE*/ |
| 399 | WLAN_HDD_INFRA_STATION, |
| 400 | WLAN_HDD_SOFTAP, |
| 401 | WLAN_HDD_P2P_CLIENT, |
| 402 | WLAN_HDD_P2P_GO, |
Jeff Johnson | 88ba774 | 2013-02-27 14:36:02 -0800 | [diff] [blame] | 403 | WLAN_HDD_MONITOR, |
| 404 | WLAN_HDD_FTM, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 405 | WLAN_HDD_P2P_DEVICE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 406 | }device_mode_t; |
| 407 | |
| 408 | typedef enum rem_on_channel_request_type |
| 409 | { |
| 410 | REMAIN_ON_CHANNEL_REQUEST, |
| 411 | OFF_CHANNEL_ACTION_TX, |
| 412 | }rem_on_channel_request_type_t; |
| 413 | |
| 414 | /* Thermal mitigation Level Enum Type */ |
| 415 | typedef enum |
| 416 | { |
| 417 | WLAN_HDD_TM_LEVEL_0, |
| 418 | WLAN_HDD_TM_LEVEL_1, |
| 419 | WLAN_HDD_TM_LEVEL_2, |
| 420 | WLAN_HDD_TM_LEVEL_3, |
| 421 | WLAN_HDD_TM_LEVEL_4, |
| 422 | WLAN_HDD_TM_LEVEL_MAX |
| 423 | } WLAN_TmLevelEnumType; |
| 424 | |
| 425 | /* Driver Action based on thermal mitigation level structure */ |
| 426 | typedef struct |
| 427 | { |
| 428 | v_BOOL_t ampduEnable; |
| 429 | v_BOOL_t enterImps; |
| 430 | v_U32_t txSleepDuration; |
| 431 | v_U32_t txOperationDuration; |
| 432 | v_U32_t txBlockFrameCountThreshold; |
| 433 | } hdd_tmLevelAction_t; |
| 434 | |
| 435 | /* Thermal Mitigation control context structure */ |
| 436 | typedef struct |
| 437 | { |
| 438 | WLAN_TmLevelEnumType currentTmLevel; |
| 439 | hdd_tmLevelAction_t tmAction; |
| 440 | vos_timer_t txSleepTimer; |
| 441 | struct mutex tmOperationLock; |
| 442 | vos_event_t setTmDoneEvent; |
| 443 | v_U32_t txFrameCount; |
| 444 | v_TIME_t lastblockTs; |
| 445 | v_TIME_t lastOpenTs; |
| 446 | struct netdev_queue *blockedQueue; |
| 447 | } hdd_thermal_mitigation_info_t; |
| 448 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 449 | typedef struct hdd_remain_on_chan_ctx |
| 450 | { |
| 451 | struct net_device *dev; |
| 452 | struct ieee80211_channel chan; |
| 453 | enum nl80211_channel_type chan_type; |
| 454 | unsigned int duration; |
| 455 | u64 cookie; |
| 456 | rem_on_channel_request_type_t rem_on_chan_request; |
| 457 | }hdd_remain_on_chan_ctx_t; |
| 458 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 459 | typedef enum{ |
| 460 | HDD_IDLE, |
| 461 | HDD_PD_REQ_ACK_PENDING, |
| 462 | HDD_GO_NEG_REQ_ACK_PENDING, |
| 463 | HDD_INVALID_STATE, |
| 464 | }eP2PActionFrameState; |
| 465 | |
| 466 | typedef enum { |
| 467 | WLAN_HDD_GO_NEG_REQ, |
| 468 | WLAN_HDD_GO_NEG_RESP, |
| 469 | WLAN_HDD_GO_NEG_CNF, |
| 470 | WLAN_HDD_INVITATION_REQ, |
| 471 | WLAN_HDD_INVITATION_RESP, |
| 472 | WLAN_HDD_DEV_DIS_REQ, |
| 473 | WLAN_HDD_DEV_DIS_RESP, |
| 474 | WLAN_HDD_PROV_DIS_REQ, |
| 475 | WLAN_HDD_PROV_DIS_RESP, |
| 476 | }tActionFrmType; |
| 477 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 478 | typedef struct hdd_cfg80211_state_s |
| 479 | { |
| 480 | tANI_U16 current_freq; |
| 481 | u64 action_cookie; |
| 482 | tANI_U8 *buf; |
| 483 | size_t len; |
| 484 | struct sk_buff *skb; |
| 485 | hdd_remain_on_chan_ctx_t* remain_on_chan_ctx; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 486 | eP2PActionFrameState actionFrmState; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 487 | }hdd_cfg80211_state_t; |
| 488 | |
Madan Mohan Koyyalamudi | b5da533 | 2012-10-15 17:23:21 -0700 | [diff] [blame] | 489 | |
| 490 | typedef enum{ |
| 491 | HDD_SSR_NOT_REQUIRED, |
| 492 | HDD_SSR_REQUIRED, |
| 493 | HDD_SSR_DISABLED, |
| 494 | }e_hdd_ssr_required; |
| 495 | |
| 496 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 497 | struct hdd_station_ctx |
| 498 | { |
| 499 | /** Handle to the Wireless Extension State */ |
| 500 | hdd_wext_state_t WextState; |
| 501 | |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 502 | #ifdef FEATURE_WLAN_TDLS |
| 503 | tdlsCtx_t *pHddTdlsCtx; |
| 504 | #endif |
| 505 | |
| 506 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 507 | /**Connection information*/ |
| 508 | connection_info_t conn_info; |
| 509 | |
| 510 | roaming_info_t roam_info; |
| 511 | |
| 512 | v_BOOL_t bSendDisconnect; |
| 513 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 514 | #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] | 515 | int ft_carrier_on; |
| 516 | #endif |
| 517 | }; |
| 518 | |
| 519 | #define BSS_STOP 0 |
| 520 | #define BSS_START 1 |
| 521 | typedef struct hdd_hostapd_state_s |
| 522 | { |
| 523 | int bssState; |
| 524 | vos_event_t vosEvent; |
| 525 | VOS_STATUS vosStatus; |
| 526 | v_BOOL_t bCommit; |
| 527 | |
| 528 | } hdd_hostapd_state_t; |
| 529 | |
| 530 | |
| 531 | /* |
| 532 | * Per station structure kept in HDD for multiple station support for SoftAP |
| 533 | */ |
| 534 | typedef struct { |
| 535 | /** The station entry is used or not */ |
| 536 | v_BOOL_t isUsed; |
| 537 | |
| 538 | /** Station ID reported back from HAL (through SAP). Broadcast |
| 539 | * uses station ID zero by default in both libra and volans. */ |
| 540 | v_U8_t ucSTAId; |
| 541 | |
| 542 | /** MAC address of the station */ |
| 543 | v_MACADDR_t macAddrSTA; |
| 544 | |
| 545 | /** Current Station state so HDD knows how to deal with packet |
| 546 | * queue. Most recent states used to change TL STA state. */ |
| 547 | WLANTL_STAStateType tlSTAState; |
| 548 | |
| 549 | /** Transmit queues for each AC (VO,VI,BE etc). */ |
| 550 | hdd_list_t wmm_tx_queue[NUM_TX_QUEUES]; |
| 551 | |
| 552 | /** Might need to differentiate queue depth in contention case */ |
| 553 | v_U16_t aTxQueueDepth[NUM_TX_QUEUES]; |
| 554 | |
| 555 | /**Track whether OS TX queue has been disabled.*/ |
| 556 | v_BOOL_t txSuspended[NUM_TX_QUEUES]; |
| 557 | |
| 558 | /** Track QoS status of station */ |
| 559 | v_BOOL_t isQosEnabled; |
| 560 | |
Madan Mohan Koyyalamudi | cd78499 | 2013-01-11 15:30:36 -0800 | [diff] [blame] | 561 | /** The station entry for which Deauth is in progress */ |
| 562 | v_BOOL_t isDeauthInProgress; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 563 | } hdd_station_info_t; |
| 564 | |
| 565 | struct hdd_ap_ctx_s |
| 566 | { |
| 567 | hdd_hostapd_state_t HostapdState; |
| 568 | |
| 569 | // Memory differentiation mode is enabled |
| 570 | //v_U16_t uMemoryDiffThreshold; |
| 571 | //v_U8_t uNumActiveAC; |
| 572 | //v_U8_t uActiveACMask; |
| 573 | //v_U8_t aTxQueueLimit[NUM_TX_QUEUES]; |
| 574 | |
| 575 | /** Packet Count to update uNumActiveAC and uActiveACMask */ |
| 576 | //v_U16_t uUpdatePktCount; |
| 577 | |
| 578 | /** Station ID assigned after BSS starts */ |
| 579 | v_U8_t uBCStaId; |
| 580 | |
| 581 | v_U8_t uPrivacy; // The privacy bits of configuration |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 582 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 583 | tSirWPSPBCProbeReq WPSPBCProbeReq; |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 584 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 585 | tsap_Config_t sapConfig; |
Jeff Johnson | 7dda777 | 2013-02-27 08:36:13 -0800 | [diff] [blame] | 586 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 587 | struct semaphore semWpsPBCOverlapInd; |
| 588 | |
| 589 | v_BOOL_t apDisableIntraBssFwd; |
| 590 | |
| 591 | vos_timer_t hdd_ap_inactivity_timer; |
| 592 | |
| 593 | v_U8_t operatingChannel; |
| 594 | |
| 595 | v_BOOL_t uIsAuthenticated; |
| 596 | |
| 597 | eCsrEncryptionType ucEncryptType; |
| 598 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 599 | //This will point to group key data, if it is received before start bss. |
| 600 | tCsrRoamSetKey groupKey; |
| 601 | // This will have WEP key data, if it is received before start bss |
| 602 | tCsrRoamSetKey wepKey[CSR_MAX_NUM_KEY]; |
| 603 | |
| 604 | beacon_data_t *beacon; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 605 | }; |
| 606 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 607 | struct hdd_mon_ctx_s |
| 608 | { |
| 609 | hdd_adapter_t *pAdapterForTx; |
| 610 | }; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 611 | |
| 612 | typedef struct hdd_scaninfo_s |
| 613 | { |
| 614 | /* The scan id */ |
| 615 | v_U32_t scanId; |
| 616 | |
| 617 | /* The scan pending */ |
| 618 | v_U32_t mScanPending; |
| 619 | |
| 620 | /* Client Wait Scan Result */ |
| 621 | v_U32_t waitScanResult; |
| 622 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 623 | /* Additional IE for scan */ |
| 624 | tSirAddie scanAddIE; |
| 625 | |
| 626 | /* Scan mode*/ |
| 627 | tSirScanType scan_mode; |
| 628 | |
| 629 | /* Scan Completion Event */ |
| 630 | struct completion scan_req_completion_event; |
| 631 | |
Madan Mohan Koyyalamudi | f4e8100 | 2012-11-13 10:46:38 -0800 | [diff] [blame] | 632 | /* completion variable for abortscan */ |
| 633 | struct completion abortscan_event_var; |
| 634 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 635 | vos_event_t scan_finished_event; |
| 636 | |
| 637 | hdd_scan_pending_option_e scan_pending_option; |
| 638 | |
| 639 | }hdd_scaninfo_t; |
| 640 | |
Gopichand Nakkala | 0f27681 | 2013-02-24 14:45:51 +0530 | [diff] [blame] | 641 | #define WLAN_HDD_MAX_MC_ADDR_LIST 10 |
| 642 | |
| 643 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 644 | typedef struct multicast_addr_list |
| 645 | { |
| 646 | v_U8_t isFilterApplied; |
| 647 | v_U8_t mc_cnt; |
| 648 | v_U8_t addr[WLAN_HDD_MAX_MC_ADDR_LIST][ETH_ALEN]; |
| 649 | } t_multicast_add_list; |
| 650 | #endif |
| 651 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 652 | #define WLAN_HDD_ADAPTER_MAGIC 0x574c414e //ASCII "WLAN" |
| 653 | struct hdd_adapter_s |
| 654 | { |
| 655 | void *pHddCtx; |
| 656 | |
| 657 | device_mode_t device_mode; |
| 658 | |
| 659 | /** Handle to the network device */ |
| 660 | struct net_device *dev; |
| 661 | |
| 662 | //TODO Move this to sta Ctx |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 663 | struct wireless_dev wdev ; |
| 664 | struct cfg80211_scan_request *request ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 665 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 666 | /** ops checks if Opportunistic Power Save is Enable or Not |
| 667 | * ctw stores ctWindow value once we receive Opps command from |
| 668 | * wpa_supplicant then using ctWindow value we need to Enable |
| 669 | * Opportunistic Power Save |
| 670 | */ |
| 671 | tANI_U8 ops; |
| 672 | tANI_U32 ctw; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 673 | |
| 674 | /** Current MAC Address for the adapter */ |
| 675 | v_MACADDR_t macAddressCurrent; |
| 676 | |
| 677 | /**Event Flags*/ |
| 678 | unsigned long event_flags; |
| 679 | |
| 680 | /**Device TX/RX statistics*/ |
| 681 | struct net_device_stats stats; |
| 682 | /** HDD statistics*/ |
| 683 | hdd_stats_t hdd_stats; |
| 684 | /**Mib information*/ |
| 685 | sHddMib_t hdd_mib; |
| 686 | |
| 687 | tANI_U8 sessionId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 688 | |
| 689 | /* Completion variable for session close */ |
| 690 | struct completion session_close_comp_var; |
| 691 | |
| 692 | /* Completion variable for session open */ |
| 693 | struct completion session_open_comp_var; |
| 694 | |
| 695 | //TODO: move these to sta ctx. These may not be used in AP |
| 696 | /** completion variable for disconnect callback */ |
| 697 | struct completion disconnect_comp_var; |
| 698 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 699 | /** Completion of change country code */ |
| 700 | struct completion change_country_code; |
| 701 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 702 | /* completion variable for Linkup Event */ |
| 703 | struct completion linkup_event_var; |
| 704 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 705 | /* completion variable for cancel remain on channel Event */ |
| 706 | struct completion cancel_rem_on_chan_var; |
| 707 | |
| 708 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) |
| 709 | /* completion variable for off channel remain on channel Event */ |
| 710 | struct completion offchannel_tx_event; |
| 711 | #endif |
| 712 | /* Completion variable for action frame */ |
| 713 | struct completion tx_action_cnf_event; |
| 714 | /* Completion variable for remain on channel ready */ |
| 715 | struct completion rem_on_chan_ready_event; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 716 | |
Jeff Johnson | 9efb9aa | 2013-03-15 13:59:27 -0700 | [diff] [blame] | 717 | /* Completion variable for Upper Layer Authentication */ |
| 718 | struct completion ula_complete; |
| 719 | |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 720 | #ifdef FEATURE_WLAN_TDLS |
| 721 | struct completion tdls_add_station_comp; |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 722 | struct completion tdls_mgmt_comp; |
| 723 | eHalStatus tdlsAddStaStatus; |
Hoonki Lee | 11f7dda | 2013-02-14 16:55:44 -0800 | [diff] [blame] | 724 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 725 | /* Track whether the linkup handling is needed */ |
| 726 | v_BOOL_t isLinkUpSvcNeeded; |
| 727 | |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 728 | /* Mgmt Frames TX completion status code */ |
| 729 | tANI_U32 mgmtTxCompletionStatus; |
| 730 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 731 | /************************************************************* |
| 732 | * Tx Queues |
| 733 | */ |
| 734 | /** Transmit queues for each AC (VO,VI,BE etc) */ |
| 735 | hdd_list_t wmm_tx_queue[NUM_TX_QUEUES]; |
| 736 | /**Track whether VOS is in a low resource state*/ |
| 737 | v_BOOL_t isVosOutOfResource; |
| 738 | |
| 739 | /**Track whether OS TX queue has been disabled.*/ |
| 740 | v_BOOL_t isTxSuspended[NUM_TX_QUEUES]; |
| 741 | |
| 742 | /** WMM Status */ |
| 743 | hdd_wmm_status_t hddWmmStatus; |
| 744 | /************************************************************* |
| 745 | */ |
| 746 | /************************************************************* |
| 747 | * TODO - Remove it later |
| 748 | */ |
| 749 | /** Multiple station supports */ |
| 750 | /** Per-station structure */ |
| 751 | spinlock_t staInfo_lock; //To protect access to station Info |
| 752 | hdd_station_info_t aStaInfo[WLAN_MAX_STA_COUNT]; |
| 753 | //v_U8_t uNumActiveStation; |
| 754 | |
| 755 | v_U16_t aTxQueueLimit[NUM_TX_QUEUES]; |
| 756 | /************************************************************* |
| 757 | */ |
| 758 | |
| 759 | #ifdef FEATURE_WLAN_WAPI |
| 760 | hdd_wapi_info_t wapi_info; |
| 761 | #endif |
| 762 | |
| 763 | v_S7_t rssi; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 764 | struct work_struct monTxWorkQueue; |
| 765 | struct sk_buff *skb_to_tx; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 766 | |
| 767 | union { |
| 768 | hdd_station_ctx_t station; |
| 769 | hdd_ap_ctx_t ap; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 770 | hdd_mon_ctx_t monitor; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 771 | }sessionCtx; |
| 772 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 773 | hdd_cfg80211_state_t cfg80211State; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 774 | |
Gopichand Nakkala | 0f27681 | 2013-02-24 14:45:51 +0530 | [diff] [blame] | 775 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 776 | t_multicast_add_list mc_addr_list; |
| 777 | #endif |
| 778 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 779 | //Magic cookie for adapter sanity verification |
| 780 | v_U32_t magic; |
| 781 | v_BOOL_t higherDtimTransition; |
| 782 | }; |
| 783 | |
| 784 | typedef struct hdd_dynamic_mcbcfilter_s |
| 785 | { |
| 786 | v_BOOL_t enableCfg; |
| 787 | v_U8_t mcastBcastFilterSetting; |
| 788 | v_BOOL_t enableSuspend; |
| 789 | v_U8_t mcBcFilterSuspend; |
| 790 | }hdd_dynamic_mcbcfilter_t; |
| 791 | |
Madan Mohan Koyyalamudi | a53c4dc | 2012-11-13 10:35:42 -0800 | [diff] [blame] | 792 | #define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station) |
| 793 | #define WLAN_HDD_GET_AP_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap) |
| 794 | #define WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.station.WextState) |
| 795 | #define WLAN_HDD_GET_CTX(pAdapter) ((hdd_context_t*)pAdapter->pHddCtx) |
| 796 | #define WLAN_HDD_GET_HAL_CTX(pAdapter) (((hdd_context_t*)(pAdapter->pHddCtx))->hHal) |
| 797 | #define WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap.HostapdState) |
| 798 | #define WLAN_HDD_GET_CFG_STATE_PTR(pAdapter) (&(pAdapter)->cfg80211State) |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 799 | #ifdef FEATURE_WLAN_TDLS |
| 800 | #define WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter) ((tdlsCtx_t*)(pAdapter)->sessionCtx.station.pHddTdlsCtx) |
| 801 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 802 | |
| 803 | typedef struct hdd_adapter_list_node |
| 804 | { |
| 805 | hdd_list_node_t node; // MUST be first element |
| 806 | hdd_adapter_t *pAdapter; |
| 807 | }hdd_adapter_list_node_t; |
| 808 | |
| 809 | typedef struct hdd_priv_data_s |
| 810 | { |
| 811 | tANI_U8 *buf; |
| 812 | int used_len; |
| 813 | int total_len; |
| 814 | }hdd_priv_data_t; |
| 815 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 816 | /** Adapter stucture definition */ |
| 817 | |
| 818 | struct hdd_context_s |
| 819 | { |
| 820 | /** Global VOS context */ |
| 821 | v_CONTEXT_t pvosContext; |
| 822 | |
| 823 | /** HAL handle...*/ |
| 824 | tHalHandle hHal; |
| 825 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 826 | struct wiphy *wiphy ; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 827 | //TODO Remove this from here. |
| 828 | |
| 829 | hdd_list_t hddAdapters; //List of adapters |
| 830 | /* One per STA: 1 for RX_BCMC_STA_ID and 1 for SAP_SELF_STA_ID*/ |
| 831 | hdd_adapter_t *sta_to_adapter[WLAN_MAX_STA_COUNT + 3]; //One per sta. For quick reference. |
| 832 | |
| 833 | /** Pointer for firmware image data */ |
| 834 | const struct firmware *fw; |
| 835 | |
| 836 | /** Pointer for configuration data */ |
| 837 | const struct firmware *cfg; |
| 838 | |
| 839 | /** Pointer for nv data */ |
| 840 | const struct firmware *nv; |
| 841 | |
| 842 | /** Pointer to the parent device */ |
| 843 | struct device *parent_dev; |
| 844 | |
| 845 | pid_t pid_sdio_claimed; |
| 846 | atomic_t sdio_claim_count; |
| 847 | |
| 848 | /** Config values read from qcom_cfg.ini file */ |
| 849 | hdd_config_t *cfg_ini; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 850 | wlan_hdd_ftm_status_t ftm; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 851 | /** completion variable for full power callback */ |
| 852 | struct completion full_pwr_comp_var; |
| 853 | /** completion variable for Request BMPS callback */ |
| 854 | struct completion req_bmps_comp_var; |
| 855 | |
| 856 | /** completion variable for standby callback */ |
| 857 | struct completion standby_comp_var; |
| 858 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 859 | /* Completion variable to indicate Rx Thread Suspended */ |
| 860 | struct completion rx_sus_event_var; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 861 | |
| 862 | /* Completion variable to indicate Tx Thread Suspended */ |
| 863 | struct completion tx_sus_event_var; |
| 864 | |
| 865 | /* Completion variable to indicate Mc Thread Suspended */ |
| 866 | struct completion mc_sus_event_var; |
| 867 | |
Madan Mohan Koyyalamudi | c3a240c | 2012-09-28 15:34:08 -0700 | [diff] [blame] | 868 | /* Completion variable to wlan_hdd_get_crda_regd_entry */ |
| 869 | struct completion driver_crda_req; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 870 | |
| 871 | v_BOOL_t isWlanSuspended; |
| 872 | |
| 873 | v_BOOL_t isTxThreadSuspended; |
| 874 | |
| 875 | v_BOOL_t isMcThreadSuspended; |
| 876 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 877 | v_BOOL_t isRxThreadSuspended; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 878 | |
| 879 | volatile v_BOOL_t isLogpInProgress; |
| 880 | |
| 881 | v_BOOL_t isLoadUnloadInProgress; |
| 882 | |
| 883 | /**Track whether driver has been suspended.*/ |
| 884 | hdd_ps_state_t hdd_ps_state; |
| 885 | |
| 886 | /* Track whether Mcast/Bcast Filter is enabled.*/ |
| 887 | v_BOOL_t hdd_mcastbcast_filter_set; |
| 888 | |
| 889 | /* Track whether ignore DTIM is enabled*/ |
| 890 | v_BOOL_t hdd_ignore_dtim_enabled; |
| 891 | v_U32_t hdd_actual_ignore_DTIM_value; |
| 892 | v_U32_t hdd_actual_LI_value; |
| 893 | |
| 894 | |
| 895 | v_BOOL_t hdd_wlan_suspended; |
| 896 | |
| 897 | spinlock_t filter_lock; |
| 898 | |
| 899 | /* Lock to avoid race condtion during start/stop bss*/ |
| 900 | struct mutex sap_lock; |
| 901 | |
| 902 | /** ptt Process ID*/ |
| 903 | v_SINT_t ptt_pid; |
| 904 | |
| 905 | v_U8_t change_iface; |
| 906 | |
| 907 | /** Concurrency Parameters*/ |
| 908 | tVOS_CONCURRENCY_MODE concurrency_mode; |
| 909 | |
| 910 | v_U16_t no_of_sessions[VOS_MAX_NO_OF_MODE]; |
| 911 | |
| 912 | hdd_chip_reset_stats_t hddChipResetStats; |
| 913 | /* Number of times riva restarted */ |
| 914 | v_U32_t hddRivaResetStats; |
| 915 | |
| 916 | hdd_dynamic_mcbcfilter_t dynamic_mcbc_filter; |
| 917 | |
| 918 | /* Can we allow AMP connection right now*/ |
| 919 | v_BOOL_t isAmpAllowed; |
| 920 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 921 | /** P2P Device MAC Address for the adapter */ |
| 922 | v_MACADDR_t p2pDeviceAddress; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 923 | |
| 924 | /* Thermal mitigation information */ |
| 925 | hdd_thermal_mitigation_info_t tmInfo; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 926 | |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 927 | #ifdef WLAN_OPEN_SOURCE |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 928 | #ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK |
| 929 | struct wake_lock rx_wake_lock; |
| 930 | #endif |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 931 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 932 | |
| 933 | /* |
| 934 | * Framework initiated driver restarting |
| 935 | * hdd_reload_timer : Restart retry timer |
| 936 | * isRestartInProgress: Restart in progress |
| 937 | * hdd_restart_retries: Restart retries |
| 938 | * |
| 939 | */ |
| 940 | vos_timer_t hdd_restart_timer; |
| 941 | atomic_t isRestartInProgress; |
| 942 | u_int8_t hdd_restart_retries; |
| 943 | |
Madan Mohan Koyyalamudi | 2a1ba77 | 2012-10-11 14:59:06 -0700 | [diff] [blame] | 944 | hdd_scaninfo_t scan_info; |
Gopichand Nakkala | f7e53c5 | 2013-01-07 14:52:52 -0800 | [diff] [blame] | 945 | |
Madan Mohan Koyyalamudi | 543172b | 2012-12-05 16:40:18 -0800 | [diff] [blame] | 946 | /*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] | 947 | is invoked*/ |
Madan Mohan Koyyalamudi | 543172b | 2012-12-05 16:40:18 -0800 | [diff] [blame] | 948 | v_BOOL_t is_dynamic_channel_range_set; |
Madan Mohan Koyyalamudi | 69fc3ad | 2012-11-28 16:04:56 -0800 | [diff] [blame] | 949 | |
Gopichand Nakkala | 1bc04f1 | 2013-02-28 14:29:23 -0800 | [diff] [blame] | 950 | #ifdef WLAN_OPEN_SOURCE |
Madan Mohan Koyyalamudi | 69fc3ad | 2012-11-28 16:04:56 -0800 | [diff] [blame] | 951 | struct wake_lock sap_wake_lock; |
Gopichand Nakkala | 1bc04f1 | 2013-02-28 14:29:23 -0800 | [diff] [blame] | 952 | #endif |
Chilam Ng | 0112041 | 2013-02-19 18:32:21 -0800 | [diff] [blame] | 953 | |
| 954 | #ifdef FEATURE_WLAN_TDLS |
| 955 | eTDLSSupportMode tdls_mode; |
Hoonki Lee | 2751190 | 2013-03-14 18:19:06 -0700 | [diff] [blame] | 956 | eTDLSSupportMode tdls_mode_last; |
Gopichand Nakkala | 4327a15 | 2013-03-04 23:22:42 -0800 | [diff] [blame] | 957 | tdlsConnInfo_t tdlsConnInfo[HDD_MAX_NUM_TDLS_STA]; |
| 958 | /* TDLS peer connected count */ |
| 959 | tANI_U16 connected_peer_count; |
Hoonki Lee | 93e67ff | 2013-03-19 15:49:25 -0700 | [diff] [blame] | 960 | tdls_scan_context_t tdls_scan_ctxt; |
Sameer Thalappil | 50dc009 | 2013-02-19 17:23:33 -0800 | [diff] [blame] | 961 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 962 | }; |
| 963 | |
| 964 | |
| 965 | |
| 966 | /*--------------------------------------------------------------------------- |
| 967 | Function declarations and documenation |
| 968 | -------------------------------------------------------------------------*/ |
| 969 | VOS_STATUS hdd_get_front_adapter( hdd_context_t *pHddCtx, |
| 970 | hdd_adapter_list_node_t** ppAdapterNode); |
| 971 | |
| 972 | VOS_STATUS hdd_get_next_adapter( hdd_context_t *pHddCtx, |
| 973 | hdd_adapter_list_node_t* pAdapterNode, |
| 974 | hdd_adapter_list_node_t** pNextAdapterNode); |
| 975 | |
| 976 | VOS_STATUS hdd_remove_adapter( hdd_context_t *pHddCtx, |
| 977 | hdd_adapter_list_node_t* pAdapterNode); |
| 978 | |
| 979 | VOS_STATUS hdd_remove_front_adapter( hdd_context_t *pHddCtx, |
| 980 | hdd_adapter_list_node_t** ppAdapterNode); |
| 981 | |
| 982 | VOS_STATUS hdd_add_adapter_back( hdd_context_t *pHddCtx, |
| 983 | hdd_adapter_list_node_t* pAdapterNode); |
| 984 | |
| 985 | VOS_STATUS hdd_add_adapter_front( hdd_context_t *pHddCtx, |
| 986 | hdd_adapter_list_node_t* pAdapterNode); |
| 987 | |
| 988 | 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] | 989 | const char* name, tSirMacAddr macAddr, |
| 990 | tANI_U8 rtnl_held ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 991 | VOS_STATUS hdd_close_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, tANI_U8 rtnl_held ); |
| 992 | VOS_STATUS hdd_close_all_adapters( hdd_context_t *pHddCtx ); |
| 993 | VOS_STATUS hdd_stop_all_adapters( hdd_context_t *pHddCtx ); |
| 994 | VOS_STATUS hdd_reset_all_adapters( hdd_context_t *pHddCtx ); |
| 995 | VOS_STATUS hdd_start_all_adapters( hdd_context_t *pHddCtx ); |
| 996 | VOS_STATUS hdd_reconnect_all_adapters( hdd_context_t *pHddCtx ); |
Sudhir Sattayappa Kohalli | 90e4c75 | 2013-03-21 14:25:04 -0700 | [diff] [blame] | 997 | void hdd_dump_concurrency_info(hdd_context_t *pHddCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 998 | hdd_adapter_t * hdd_get_adapter_by_name( hdd_context_t *pHddCtx, tANI_U8 *name ); |
| 999 | hdd_adapter_t * hdd_get_adapter_by_macaddr( hdd_context_t *pHddCtx, tSirMacAddr macAddr ); |
| 1000 | hdd_adapter_t * hdd_get_mon_adapter( hdd_context_t *pHddCtx ); |
| 1001 | VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter ); |
| 1002 | hdd_adapter_t * hdd_get_adapter( hdd_context_t *pHddCtx, device_mode_t mode ); |
| 1003 | void hdd_deinit_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ); |
| 1004 | VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ); |
| 1005 | void hdd_set_station_ops( struct net_device *pWlanDev ); |
| 1006 | tANI_U8* wlan_hdd_get_intf_addr(hdd_context_t* pHddCtx); |
| 1007 | void wlan_hdd_release_intf_addr(hdd_context_t* pHddCtx, tANI_U8* releaseAddr); |
| 1008 | v_U8_t hdd_get_operating_channel( hdd_context_t *pHddCtx, device_mode_t mode ); |
| 1009 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1010 | void hdd_set_conparam ( v_UINT_t newParam ); |
| 1011 | tVOS_CON_MODE hdd_get_conparam( void ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1012 | |
| 1013 | void wlan_hdd_enable_deepsleep(v_VOID_t * pVosContext); |
| 1014 | 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] | 1015 | v_BOOL_t hdd_is_suspend_notify_allowed(hdd_context_t* pHddCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1016 | void hdd_abort_mac_scan(hdd_context_t *pHddCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1017 | void wlan_hdd_set_monitor_tx_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter ); |
| 1018 | 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] | 1019 | v_BOOL_t is_crda_regulatory_entry_valid(void); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1020 | void wlan_hdd_set_concurrency_mode(hdd_context_t *pHddCtx, tVOS_CON_MODE mode); |
| 1021 | void wlan_hdd_clear_concurrency_mode(hdd_context_t *pHddCtx, tVOS_CON_MODE mode); |
| 1022 | void wlan_hdd_reset_prob_rspies(hdd_adapter_t* pHostapdAdapter); |
| 1023 | void hdd_prevent_suspend(void); |
| 1024 | void hdd_allow_suspend(void); |
Madan Mohan Koyyalamudi | 10d83a9 | 2012-09-28 15:47:05 -0700 | [diff] [blame] | 1025 | void hdd_allow_suspend_timeout(v_U32_t timeout); |
Madan Mohan Koyyalamudi | b5da533 | 2012-10-15 17:23:21 -0700 | [diff] [blame] | 1026 | bool hdd_is_ssr_required(void); |
| 1027 | void hdd_set_ssr_required(e_hdd_ssr_required value); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1028 | |
| 1029 | VOS_STATUS hdd_enable_bmps_imps(hdd_context_t *pHddCtx); |
| 1030 | VOS_STATUS hdd_disable_bmps_imps(hdd_context_t *pHddCtx, tANI_U8 session_type); |
| 1031 | |
| 1032 | eHalStatus hdd_smeCloseSessionCallback(void *pContext); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1033 | VOS_STATUS wlan_hdd_restart_driver(hdd_context_t *pHddCtx); |
Madan Mohan Koyyalamudi | 8612ec9 | 2012-09-28 15:53:07 -0700 | [diff] [blame] | 1034 | void hdd_exchange_version_and_caps(hdd_context_t *pHddCtx); |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 1035 | void hdd_set_pwrparams(hdd_context_t *pHddCtx); |
| 1036 | void hdd_reset_pwrparams(hdd_context_t *pHddCtx); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1037 | #endif // end #if !defined( WLAN_HDD_MAIN_H ) |