blob: 34393340bd9258419701b72fb05326263d9d4a4c [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08002 * 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 Johnson32d95a32012-09-10 13:15:23 -070022 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -070023 *
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 Johnson295189b2012-06-20 16:38:30 -070061#include <net/cfg80211.h>
Jeff Johnson295189b2012-06-20 16:38:30 -070062#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 Thalappil50dc0092013-02-19 17:23:33 -080071#ifdef WLAN_OPEN_SOURCE
Jeff Johnsone7245742012-09-05 17:12:55 -070072#include <linux/wakelock.h>
Sameer Thalappil50dc0092013-02-19 17:23:33 -080073#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070074#include <wlan_hdd_ftm.h>
Chilam Ng01120412013-02-19 18:32:21 -080075#ifdef FEATURE_WLAN_TDLS
76#include "wlan_hdd_tdls.h"
77#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070078/*---------------------------------------------------------------------------
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 Johnson6a81ca42013-04-05 10:37:08 -0700104
Jeff Johnson295189b2012-06-20 16:38:30 -0700105/**event flags registered net device*/
Jeff Johnson6a81ca42013-04-05 10:37:08 -0700106#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 Johnson295189b2012-06-20 16:38:30 -0700113
114/** Maximum time(ms)to wait for disconnect to complete **/
115#define WLAN_WAIT_TIME_DISCONNECT 500
116#define WLAN_WAIT_TIME_STATS 800
117#define WLAN_WAIT_TIME_POWER 800
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700118/* Amount of time to wait for sme close session callback.
119 This value should be larger than the timeout used by WDI to wait for
120 a response from WCNSS */
121#define WLAN_WAIT_TIME_SESSIONOPENCLOSE 15000
Jeff Johnson295189b2012-06-20 16:38:30 -0700122#define WLAN_WAIT_TIME_ABORTSCAN 2000
123
Hoonki Lee11f7dda2013-02-14 16:55:44 -0800124/** Maximum time(ms) to wait for tdls add sta to complete **/
125#define WAIT_TIME_TDLS_ADD_STA 1500
126
Gopichand Nakkalae7cbc5d2013-03-27 21:09:23 -0700127/** Maximum time(ms) to wait for tdls del sta to complete **/
128#define WAIT_TIME_TDLS_DEL_STA 1500
129
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800130/** Maximum time(ms) to wait for tdls mgmt to complete **/
Gopichand Nakkala21c3f9b2013-03-23 14:45:55 -0700131#define WAIT_TIME_TDLS_MGMT 11000
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800132
Hoonki Lee14621352013-04-16 17:51:19 -0700133/** Maximum time(ms) to wait for tdls initiator to start direct communication **/
134#define WAIT_TIME_TDLS_INITIATOR 300
Madan Mohan Koyyalamudic3a240c2012-09-28 15:34:08 -0700135/* Maximum time to get crda entry settings */
136#define CRDA_WAIT_TIME 300
137
Jeff Johnson295189b2012-06-20 16:38:30 -0700138/* Scan Req Timeout */
139#define WLAN_WAIT_TIME_SCAN_REQ 100
140
141#define MAX_NUMBER_OF_ADAPTERS 4
142
143#define MAX_CFG_STRING_LEN 255
144
145#define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
146/** Mac Address string **/
147#define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x"
148#define MAX_GENIE_LEN 255
149
Jeff Johnson295189b2012-06-20 16:38:30 -0700150#define WLAN_CHIP_VERSION "WCNSS"
Jeff Johnson295189b2012-06-20 16:38:30 -0700151
152#define hddLog(level, args...) VOS_TRACE( VOS_MODULE_ID_HDD, level, ## args)
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700153#define ENTER() VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Enter:%s", __func__)
154#define EXIT() VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Exit:%s", __func__)
Jeff Johnson295189b2012-06-20 16:38:30 -0700155
156#define WLAN_HDD_GET_PRIV_PTR(__dev__) (hdd_adapter_t*)(netdev_priv((__dev__)))
157
158#define MAX_EXIT_ATTEMPTS_DURING_LOGP 20
159
160#define MAX_NO_OF_2_4_CHANNELS 14
161
Jeff Johnsone7245742012-09-05 17:12:55 -0700162#define WLAN_HDD_PUBLIC_ACTION_FRAME 4
163#define WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET 24
164#define WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET 30
165#define WLAN_HDD_P2P_SOCIAL_CHANNELS 3
Madan Mohan Koyyalamudi8d50f312012-11-27 15:48:57 -0800166#define WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN 1
Jeff Johnsone7245742012-09-05 17:12:55 -0700167
Chet Lanctot186b5732013-03-18 10:26:30 -0700168#ifdef WLAN_FEATURE_11W
169#define WLAN_HDD_SA_QUERY_ACTION_FRAME 8
170#endif
171
Hoonki Lee1090c6a2013-01-16 17:40:54 -0800172#define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14
173#define WLAN_HDD_TDLS_ACTION_FRAME 12
Jeff Johnsone7245742012-09-05 17:12:55 -0700174#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
Amar Singhal6144c002013-05-03 16:11:42 -0700175#define HDD_WAKE_LOCK_DURATION 500 //in msecs
Jeff Johnsone7245742012-09-05 17:12:55 -0700176#endif
177
Amar Singhal6144c002013-05-03 16:11:42 -0700178#define HDD_SAP_WAKE_LOCK_DURATION 10000 //in msecs
Madan Mohan Koyyalamudi69fc3ad2012-11-28 16:04:56 -0800179
Sunil Ravia72c3992013-01-31 06:12:22 -0800180/* Maximum number of interfaces allowed(STA, P2P Device, P2P Interface) */
181#define WLAN_MAX_INTERFACES 3
182
Gopichand Nakkala870cbae2013-03-15 21:16:09 +0530183#ifdef WLAN_FEATURE_GTK_OFFLOAD
184#define GTK_OFFLOAD_ENABLE 0
185#define GTK_OFFLOAD_DISABLE 1
186#endif
187
Jeff Johnson295189b2012-06-20 16:38:30 -0700188typedef struct hdd_tx_rx_stats_s
189{
190 // start_xmit stats
191 __u32 txXmitCalled;
192 __u32 txXmitDropped;
193 __u32 txXmitBackPressured;
194 __u32 txXmitQueued;
195 __u32 txXmitClassifiedAC[NUM_TX_QUEUES];
196 __u32 txXmitDroppedAC[NUM_TX_QUEUES];
197 __u32 txXmitBackPressuredAC[NUM_TX_QUEUES];
198 __u32 txXmitQueuedAC[NUM_TX_QUEUES];
199 // fetch_cbk stats
200 __u32 txFetched;
201 __u32 txFetchedAC[NUM_TX_QUEUES];
202 __u32 txFetchEmpty;
203 __u32 txFetchLowResources;
204 __u32 txFetchDequeueError;
205 __u32 txFetchDequeued;
206 __u32 txFetchDequeuedAC[NUM_TX_QUEUES];
207 __u32 txFetchDePressured;
208 __u32 txFetchDePressuredAC[NUM_TX_QUEUES];
209 // complete_cbk_stats
210 __u32 txCompleted;
211 // flush stats
212 __u32 txFlushed;
213 __u32 txFlushedAC[NUM_TX_QUEUES];
214 // rx stats
215 __u32 rxChains;
216 __u32 rxPackets;
217 __u32 rxDropped;
218 __u32 rxDelivered;
219 __u32 rxRefused;
220} hdd_tx_rx_stats_t;
221
222typedef struct hdd_chip_reset_stats_s
223{
224 __u32 totalLogpResets;
225 __u32 totalCMD53Failures;
226 __u32 totalMutexReadFailures;
227 __u32 totalMIFErrorFailures;
228 __u32 totalFWHearbeatFailures;
229 __u32 totalUnknownExceptions;
230} hdd_chip_reset_stats_t;
231
Chet Lanctot186b5732013-03-18 10:26:30 -0700232#ifdef WLAN_FEATURE_11W
233typedef struct hdd_pmf_stats_s
234{
235 uint8 numUnprotDeauthRx;
236 uint8 numUnprotDisassocRx;
237} hdd_pmf_stats_t;
238#endif
239
Jeff Johnson295189b2012-06-20 16:38:30 -0700240typedef struct hdd_stats_s
241{
242 tCsrSummaryStatsInfo summary_stat;
243 tCsrGlobalClassAStatsInfo ClassA_stat;
244 tCsrGlobalClassBStatsInfo ClassB_stat;
245 tCsrGlobalClassCStatsInfo ClassC_stat;
246 tCsrGlobalClassDStatsInfo ClassD_stat;
247 tCsrPerStaStatsInfo perStaStats;
248 hdd_tx_rx_stats_t hddTxRxStats;
249 hdd_chip_reset_stats_t hddChipResetStats;
Chet Lanctot186b5732013-03-18 10:26:30 -0700250#ifdef WLAN_FEATURE_11W
251 hdd_pmf_stats_t hddPmfStats;
252#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700253} hdd_stats_t;
254
255typedef enum
256{
257 HDD_ROAM_STATE_NONE,
258
259 // Issuing a disconnect due to transition into low power states.
260 HDD_ROAM_STATE_DISCONNECTING_POWER,
261
262 // move to this state when HDD sets a key with SME/CSR. Note this is
263 // an important state to get right because we will get calls into our SME
264 // callback routine for SetKey activity that we did not initiate!
265 HDD_ROAM_STATE_SETTING_KEY,
266} HDD_ROAM_STATE;
267
268typedef enum
269{
270 eHDD_SUSPEND_NONE = 0,
271 eHDD_SUSPEND_DEEP_SLEEP,
272 eHDD_SUSPEND_STANDBY,
273} hdd_ps_state_t;
274
275typedef struct roaming_info_s
276{
277 HDD_ROAM_STATE roamingState;
278 vos_event_t roamingEvent;
279
280} roaming_info_t;
281
282#ifdef FEATURE_WLAN_WAPI
283/* Define WAPI macros for Length, BKID count etc*/
284#define MAX_WPI_KEY_LENGTH 16
285#define MAX_NUM_PN 16
286#define MAC_ADDR_LEN 6
287#define MAX_ADDR_INDEX 12
288#define MAX_NUM_AKM_SUITES 16
289#define MAX_NUM_UNI_SUITES 16
290#define MAX_NUM_BKIDS 16
Jeff Johnson295189b2012-06-20 16:38:30 -0700291
292/** WAPI AUTH mode definition */
293enum _WAPIAuthMode
294{
295 WAPI_AUTH_MODE_OPEN = 0,
296 WAPI_AUTH_MODE_PSK = 1,
297 WAPI_AUTH_MODE_CERT
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700298} __packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700299typedef enum _WAPIAuthMode WAPIAuthMode;
300
301/** WAPI Work mode structure definition */
302#define WZC_ORIGINAL 0
303#define WAPI_EXTENTION 1
304
305struct _WAPI_FUNCTION_MODE
306{
307 unsigned char wapiMode;
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700308}__packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700309
310typedef struct _WAPI_FUNCTION_MODE WAPI_FUNCTION_MODE;
311
312typedef struct _WAPI_BKID
313{
314 v_U8_t bkid[16];
315}WAPI_BKID, *pWAPI_BKID;
316
317/** WAPI Association information structure definition */
318struct _WAPI_AssocInfo
319{
320 v_U8_t elementID;
321 v_U8_t length;
322 v_U16_t version;
323 v_U16_t akmSuiteCount;
324 v_U32_t akmSuite[MAX_NUM_AKM_SUITES];
325 v_U16_t unicastSuiteCount;
326 v_U32_t unicastSuite[MAX_NUM_UNI_SUITES];
327 v_U32_t multicastSuite;
328 v_U16_t wapiCability;
329 v_U16_t bkidCount;
330 WAPI_BKID bkidList[MAX_NUM_BKIDS];
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700331} __packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700332
333typedef struct _WAPI_AssocInfo WAPI_AssocInfo;
334typedef struct _WAPI_AssocInfo *pWAPI_IEAssocInfo;
335
336/** WAPI KEY Type definition */
337enum _WAPIKeyType
338{
339 PAIRWISE_KEY, //0
340 GROUP_KEY //1
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700341}__packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700342typedef enum _WAPIKeyType WAPIKeyType;
343
344/** WAPI KEY Direction definition */
345enum _KEY_DIRECTION
346{
347 None,
348 Rx,
349 Tx,
350 Rx_Tx
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700351}__packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700352
353typedef enum _KEY_DIRECTION WAPI_KEY_DIRECTION;
354
355/** WAPI KEY stucture definition */
356struct WLAN_WAPI_KEY
357{
358 WAPIKeyType keyType;
359 WAPI_KEY_DIRECTION keyDirection; /*reserved for future use*/
360 v_U8_t keyId;
361 v_U8_t addrIndex[MAX_ADDR_INDEX]; /*reserved for future use*/
362 int wpiekLen;
363 v_U8_t wpiek[MAX_WPI_KEY_LENGTH];
364 int wpickLen;
365 v_U8_t wpick[MAX_WPI_KEY_LENGTH];
366 v_U8_t pn[MAX_NUM_PN]; /*reserved for future use*/
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700367}__packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700368
369typedef struct WLAN_WAPI_KEY WLAN_WAPI_KEY;
370typedef struct WLAN_WAPI_KEY *pWLAN_WAPI_KEY;
371
372#define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0]))
373#define WLAN_EID_WAPI 68
374#define WAPI_PSK_AKM_SUITE 0x02721400
375#define WAPI_CERT_AKM_SUITE 0x01721400
376
377/** WAPI BKID List stucture definition */
378struct _WLAN_BKID_LIST
379{
380 v_U32_t length;
381 v_U32_t BKIDCount;
382 WAPI_BKID BKID[1];
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700383}__packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700384
385typedef struct _WLAN_BKID_LIST WLAN_BKID_LIST;
386typedef struct _WLAN_BKID_LIST *pWLAN_BKID_LIST;
387
388
389/** WAPI Information stucture definition */
390struct hdd_wapi_info_s
391{
392 v_U32_t nWapiMode;
393 v_BOOL_t fIsWapiSta;
394 v_MACADDR_t cachedMacAddr;
395 v_UCHAR_t wapiAuthMode;
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700396}__packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700397typedef struct hdd_wapi_info_s hdd_wapi_info_t;
398#endif /* FEATURE_WLAN_WAPI */
399
Jeff Johnson295189b2012-06-20 16:38:30 -0700400typedef struct beacon_data_s {
401 u8 *head, *tail;
402 int head_len, tail_len;
403 int dtim_period;
404} beacon_data_t;
Jeff Johnson295189b2012-06-20 16:38:30 -0700405
406typedef enum device_mode
407{ /* MAINTAIN 1 - 1 CORRESPONDENCE WITH tVOS_CON_MODE*/
408 WLAN_HDD_INFRA_STATION,
409 WLAN_HDD_SOFTAP,
410 WLAN_HDD_P2P_CLIENT,
411 WLAN_HDD_P2P_GO,
Jeff Johnson88ba7742013-02-27 14:36:02 -0800412 WLAN_HDD_MONITOR,
413 WLAN_HDD_FTM,
Shailender Karmuchia734f332013-04-19 14:02:48 -0700414 WLAN_HDD_IBSS,
Ravi Joshiaeb7d9e2013-05-02 12:28:14 -0700415 WLAN_HDD_P2P_DEVICE
Jeff Johnson295189b2012-06-20 16:38:30 -0700416}device_mode_t;
417
418typedef enum rem_on_channel_request_type
419{
420 REMAIN_ON_CHANNEL_REQUEST,
421 OFF_CHANNEL_ACTION_TX,
422}rem_on_channel_request_type_t;
423
424/* Thermal mitigation Level Enum Type */
425typedef enum
426{
427 WLAN_HDD_TM_LEVEL_0,
428 WLAN_HDD_TM_LEVEL_1,
429 WLAN_HDD_TM_LEVEL_2,
430 WLAN_HDD_TM_LEVEL_3,
431 WLAN_HDD_TM_LEVEL_4,
432 WLAN_HDD_TM_LEVEL_MAX
433} WLAN_TmLevelEnumType;
434
435/* Driver Action based on thermal mitigation level structure */
436typedef struct
437{
438 v_BOOL_t ampduEnable;
439 v_BOOL_t enterImps;
440 v_U32_t txSleepDuration;
441 v_U32_t txOperationDuration;
442 v_U32_t txBlockFrameCountThreshold;
443} hdd_tmLevelAction_t;
444
445/* Thermal Mitigation control context structure */
446typedef struct
447{
448 WLAN_TmLevelEnumType currentTmLevel;
449 hdd_tmLevelAction_t tmAction;
450 vos_timer_t txSleepTimer;
451 struct mutex tmOperationLock;
452 vos_event_t setTmDoneEvent;
453 v_U32_t txFrameCount;
454 v_TIME_t lastblockTs;
455 v_TIME_t lastOpenTs;
456 struct netdev_queue *blockedQueue;
Leo Chang50bbd252013-04-25 14:58:01 -0700457 v_BOOL_t qBlocked;
Jeff Johnson295189b2012-06-20 16:38:30 -0700458} hdd_thermal_mitigation_info_t;
459
Jeff Johnson295189b2012-06-20 16:38:30 -0700460typedef struct hdd_remain_on_chan_ctx
461{
462 struct net_device *dev;
463 struct ieee80211_channel chan;
464 enum nl80211_channel_type chan_type;
465 unsigned int duration;
466 u64 cookie;
467 rem_on_channel_request_type_t rem_on_chan_request;
468}hdd_remain_on_chan_ctx_t;
469
Jeff Johnsone7245742012-09-05 17:12:55 -0700470typedef enum{
471 HDD_IDLE,
472 HDD_PD_REQ_ACK_PENDING,
473 HDD_GO_NEG_REQ_ACK_PENDING,
474 HDD_INVALID_STATE,
475}eP2PActionFrameState;
476
477typedef enum {
478 WLAN_HDD_GO_NEG_REQ,
479 WLAN_HDD_GO_NEG_RESP,
480 WLAN_HDD_GO_NEG_CNF,
481 WLAN_HDD_INVITATION_REQ,
482 WLAN_HDD_INVITATION_RESP,
483 WLAN_HDD_DEV_DIS_REQ,
484 WLAN_HDD_DEV_DIS_RESP,
485 WLAN_HDD_PROV_DIS_REQ,
486 WLAN_HDD_PROV_DIS_RESP,
487}tActionFrmType;
488
Jeff Johnson295189b2012-06-20 16:38:30 -0700489typedef struct hdd_cfg80211_state_s
490{
491 tANI_U16 current_freq;
492 u64 action_cookie;
493 tANI_U8 *buf;
494 size_t len;
495 struct sk_buff *skb;
496 hdd_remain_on_chan_ctx_t* remain_on_chan_ctx;
Jeff Johnsone7245742012-09-05 17:12:55 -0700497 eP2PActionFrameState actionFrmState;
Jeff Johnson295189b2012-06-20 16:38:30 -0700498}hdd_cfg80211_state_t;
499
Madan Mohan Koyyalamudib5da5332012-10-15 17:23:21 -0700500
501typedef enum{
502 HDD_SSR_NOT_REQUIRED,
503 HDD_SSR_REQUIRED,
504 HDD_SSR_DISABLED,
505}e_hdd_ssr_required;
506
Gopichand Nakkala870cbae2013-03-15 21:16:09 +0530507#ifdef WLAN_FEATURE_GTK_OFFLOAD
508typedef struct
509{
510 v_BOOL_t requested;
511 tSirGtkOffloadParams gtkOffloadReqParams;
512}hddGtkOffloadParams;
513#endif
Madan Mohan Koyyalamudib5da5332012-10-15 17:23:21 -0700514
Jeff Johnson295189b2012-06-20 16:38:30 -0700515struct hdd_station_ctx
516{
517 /** Handle to the Wireless Extension State */
518 hdd_wext_state_t WextState;
519
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800520#ifdef FEATURE_WLAN_TDLS
521 tdlsCtx_t *pHddTdlsCtx;
522#endif
523
524
Jeff Johnson295189b2012-06-20 16:38:30 -0700525 /**Connection information*/
526 connection_info_t conn_info;
527
528 roaming_info_t roam_info;
529
530 v_BOOL_t bSendDisconnect;
531
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700532#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Jeff Johnson295189b2012-06-20 16:38:30 -0700533 int ft_carrier_on;
534#endif
Gopichand Nakkala870cbae2013-03-15 21:16:09 +0530535
536#ifdef WLAN_FEATURE_GTK_OFFLOAD
537 hddGtkOffloadParams gtkOffloadRequestParams;
538#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700539};
540
541#define BSS_STOP 0
542#define BSS_START 1
543typedef struct hdd_hostapd_state_s
544{
545 int bssState;
546 vos_event_t vosEvent;
547 VOS_STATUS vosStatus;
548 v_BOOL_t bCommit;
549
550} hdd_hostapd_state_t;
551
552
553/*
554 * Per station structure kept in HDD for multiple station support for SoftAP
555*/
556typedef struct {
557 /** The station entry is used or not */
558 v_BOOL_t isUsed;
559
560 /** Station ID reported back from HAL (through SAP). Broadcast
561 * uses station ID zero by default in both libra and volans. */
562 v_U8_t ucSTAId;
563
564 /** MAC address of the station */
565 v_MACADDR_t macAddrSTA;
566
567 /** Current Station state so HDD knows how to deal with packet
568 * queue. Most recent states used to change TL STA state. */
569 WLANTL_STAStateType tlSTAState;
570
571 /** Transmit queues for each AC (VO,VI,BE etc). */
572 hdd_list_t wmm_tx_queue[NUM_TX_QUEUES];
573
574 /** Might need to differentiate queue depth in contention case */
575 v_U16_t aTxQueueDepth[NUM_TX_QUEUES];
576
577 /**Track whether OS TX queue has been disabled.*/
578 v_BOOL_t txSuspended[NUM_TX_QUEUES];
579
580 /** Track QoS status of station */
581 v_BOOL_t isQosEnabled;
582
Madan Mohan Koyyalamudicd784992013-01-11 15:30:36 -0800583 /** The station entry for which Deauth is in progress */
584 v_BOOL_t isDeauthInProgress;
Jeff Johnson295189b2012-06-20 16:38:30 -0700585} hdd_station_info_t;
586
587struct hdd_ap_ctx_s
588{
589 hdd_hostapd_state_t HostapdState;
590
591 // Memory differentiation mode is enabled
592 //v_U16_t uMemoryDiffThreshold;
593 //v_U8_t uNumActiveAC;
594 //v_U8_t uActiveACMask;
595 //v_U8_t aTxQueueLimit[NUM_TX_QUEUES];
596
597 /** Packet Count to update uNumActiveAC and uActiveACMask */
598 //v_U16_t uUpdatePktCount;
599
600 /** Station ID assigned after BSS starts */
601 v_U8_t uBCStaId;
602
603 v_U8_t uPrivacy; // The privacy bits of configuration
Jeff Johnson7dda7772013-02-27 08:36:13 -0800604
Jeff Johnson295189b2012-06-20 16:38:30 -0700605 tSirWPSPBCProbeReq WPSPBCProbeReq;
Jeff Johnson7dda7772013-02-27 08:36:13 -0800606
Jeff Johnson295189b2012-06-20 16:38:30 -0700607 tsap_Config_t sapConfig;
Jeff Johnson7dda7772013-02-27 08:36:13 -0800608
Jeff Johnson295189b2012-06-20 16:38:30 -0700609 struct semaphore semWpsPBCOverlapInd;
610
611 v_BOOL_t apDisableIntraBssFwd;
612
613 vos_timer_t hdd_ap_inactivity_timer;
614
615 v_U8_t operatingChannel;
616
617 v_BOOL_t uIsAuthenticated;
618
619 eCsrEncryptionType ucEncryptType;
620
Jeff Johnson295189b2012-06-20 16:38:30 -0700621 //This will point to group key data, if it is received before start bss.
622 tCsrRoamSetKey groupKey;
623 // This will have WEP key data, if it is received before start bss
624 tCsrRoamSetKey wepKey[CSR_MAX_NUM_KEY];
625
626 beacon_data_t *beacon;
Jeff Johnson295189b2012-06-20 16:38:30 -0700627};
628
Jeff Johnson295189b2012-06-20 16:38:30 -0700629struct hdd_mon_ctx_s
630{
631 hdd_adapter_t *pAdapterForTx;
632};
Jeff Johnson295189b2012-06-20 16:38:30 -0700633
634typedef struct hdd_scaninfo_s
635{
636 /* The scan id */
637 v_U32_t scanId;
638
639 /* The scan pending */
640 v_U32_t mScanPending;
641
642 /* Client Wait Scan Result */
643 v_U32_t waitScanResult;
644
Jeff Johnson295189b2012-06-20 16:38:30 -0700645 /* Additional IE for scan */
646 tSirAddie scanAddIE;
647
648 /* Scan mode*/
649 tSirScanType scan_mode;
650
651 /* Scan Completion Event */
652 struct completion scan_req_completion_event;
653
Madan Mohan Koyyalamudif4e81002012-11-13 10:46:38 -0800654 /* completion variable for abortscan */
655 struct completion abortscan_event_var;
656
Jeff Johnson295189b2012-06-20 16:38:30 -0700657 vos_event_t scan_finished_event;
658
659 hdd_scan_pending_option_e scan_pending_option;
660
661}hdd_scaninfo_t;
662
Gopichand Nakkala0f276812013-02-24 14:45:51 +0530663#define WLAN_HDD_MAX_MC_ADDR_LIST 10
664
665#ifdef WLAN_FEATURE_PACKET_FILTERING
666typedef struct multicast_addr_list
667{
668 v_U8_t isFilterApplied;
669 v_U8_t mc_cnt;
670 v_U8_t addr[WLAN_HDD_MAX_MC_ADDR_LIST][ETH_ALEN];
671} t_multicast_add_list;
672#endif
673
Jeff Johnson295189b2012-06-20 16:38:30 -0700674#define WLAN_HDD_ADAPTER_MAGIC 0x574c414e //ASCII "WLAN"
675struct hdd_adapter_s
676{
677 void *pHddCtx;
678
679 device_mode_t device_mode;
680
681 /** Handle to the network device */
682 struct net_device *dev;
683
684 //TODO Move this to sta Ctx
Jeff Johnson295189b2012-06-20 16:38:30 -0700685 struct wireless_dev wdev ;
686 struct cfg80211_scan_request *request ;
Jeff Johnson295189b2012-06-20 16:38:30 -0700687
Jeff Johnson295189b2012-06-20 16:38:30 -0700688 /** ops checks if Opportunistic Power Save is Enable or Not
689 * ctw stores ctWindow value once we receive Opps command from
690 * wpa_supplicant then using ctWindow value we need to Enable
691 * Opportunistic Power Save
692 */
693 tANI_U8 ops;
694 tANI_U32 ctw;
Jeff Johnson295189b2012-06-20 16:38:30 -0700695
696 /** Current MAC Address for the adapter */
697 v_MACADDR_t macAddressCurrent;
698
699 /**Event Flags*/
700 unsigned long event_flags;
701
702 /**Device TX/RX statistics*/
703 struct net_device_stats stats;
704 /** HDD statistics*/
705 hdd_stats_t hdd_stats;
706 /**Mib information*/
707 sHddMib_t hdd_mib;
708
709 tANI_U8 sessionId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700710
711 /* Completion variable for session close */
712 struct completion session_close_comp_var;
713
714 /* Completion variable for session open */
715 struct completion session_open_comp_var;
716
717 //TODO: move these to sta ctx. These may not be used in AP
718 /** completion variable for disconnect callback */
719 struct completion disconnect_comp_var;
720
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700721 /** Completion of change country code */
722 struct completion change_country_code;
723
Jeff Johnson295189b2012-06-20 16:38:30 -0700724 /* completion variable for Linkup Event */
725 struct completion linkup_event_var;
726
Jeff Johnson295189b2012-06-20 16:38:30 -0700727 /* completion variable for cancel remain on channel Event */
728 struct completion cancel_rem_on_chan_var;
729
730#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
731 /* completion variable for off channel remain on channel Event */
732 struct completion offchannel_tx_event;
733#endif
734 /* Completion variable for action frame */
735 struct completion tx_action_cnf_event;
736 /* Completion variable for remain on channel ready */
737 struct completion rem_on_chan_ready_event;
Jeff Johnson295189b2012-06-20 16:38:30 -0700738
Jeff Johnson9efb9aa2013-03-15 13:59:27 -0700739 /* Completion variable for Upper Layer Authentication */
740 struct completion ula_complete;
741
Hoonki Lee11f7dda2013-02-14 16:55:44 -0800742#ifdef FEATURE_WLAN_TDLS
743 struct completion tdls_add_station_comp;
Gopichand Nakkalae7cbc5d2013-03-27 21:09:23 -0700744 struct completion tdls_del_station_comp;
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800745 struct completion tdls_mgmt_comp;
746 eHalStatus tdlsAddStaStatus;
Hoonki Lee11f7dda2013-02-14 16:55:44 -0800747#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700748 /* Track whether the linkup handling is needed */
749 v_BOOL_t isLinkUpSvcNeeded;
750
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800751 /* Mgmt Frames TX completion status code */
752 tANI_U32 mgmtTxCompletionStatus;
753
Jeff Johnson295189b2012-06-20 16:38:30 -0700754/*************************************************************
755 * Tx Queues
756 */
757 /** Transmit queues for each AC (VO,VI,BE etc) */
758 hdd_list_t wmm_tx_queue[NUM_TX_QUEUES];
759 /**Track whether VOS is in a low resource state*/
760 v_BOOL_t isVosOutOfResource;
761
762 /**Track whether OS TX queue has been disabled.*/
763 v_BOOL_t isTxSuspended[NUM_TX_QUEUES];
764
765 /** WMM Status */
766 hdd_wmm_status_t hddWmmStatus;
767/*************************************************************
768 */
769/*************************************************************
770 * TODO - Remove it later
771 */
772 /** Multiple station supports */
773 /** Per-station structure */
774 spinlock_t staInfo_lock; //To protect access to station Info
775 hdd_station_info_t aStaInfo[WLAN_MAX_STA_COUNT];
776 //v_U8_t uNumActiveStation;
777
778 v_U16_t aTxQueueLimit[NUM_TX_QUEUES];
779/*************************************************************
780 */
781
782#ifdef FEATURE_WLAN_WAPI
783 hdd_wapi_info_t wapi_info;
784#endif
785
786 v_S7_t rssi;
Jeff Johnson295189b2012-06-20 16:38:30 -0700787 struct work_struct monTxWorkQueue;
788 struct sk_buff *skb_to_tx;
Jeff Johnson295189b2012-06-20 16:38:30 -0700789
790 union {
791 hdd_station_ctx_t station;
792 hdd_ap_ctx_t ap;
Jeff Johnson295189b2012-06-20 16:38:30 -0700793 hdd_mon_ctx_t monitor;
Jeff Johnson295189b2012-06-20 16:38:30 -0700794 }sessionCtx;
795
Jeff Johnson295189b2012-06-20 16:38:30 -0700796 hdd_cfg80211_state_t cfg80211State;
Jeff Johnson295189b2012-06-20 16:38:30 -0700797
Gopichand Nakkala0f276812013-02-24 14:45:51 +0530798#ifdef WLAN_FEATURE_PACKET_FILTERING
799 t_multicast_add_list mc_addr_list;
800#endif
801
Jeff Johnson295189b2012-06-20 16:38:30 -0700802 //Magic cookie for adapter sanity verification
803 v_U32_t magic;
804 v_BOOL_t higherDtimTransition;
805};
806
807typedef struct hdd_dynamic_mcbcfilter_s
808{
809 v_BOOL_t enableCfg;
810 v_U8_t mcastBcastFilterSetting;
811 v_BOOL_t enableSuspend;
812 v_U8_t mcBcFilterSuspend;
813}hdd_dynamic_mcbcfilter_t;
814
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -0800815#define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station)
816#define WLAN_HDD_GET_AP_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap)
817#define WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.station.WextState)
818#define WLAN_HDD_GET_CTX(pAdapter) ((hdd_context_t*)pAdapter->pHddCtx)
819#define WLAN_HDD_GET_HAL_CTX(pAdapter) (((hdd_context_t*)(pAdapter->pHddCtx))->hHal)
820#define WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap.HostapdState)
821#define WLAN_HDD_GET_CFG_STATE_PTR(pAdapter) (&(pAdapter)->cfg80211State)
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800822#ifdef FEATURE_WLAN_TDLS
Gopichand Nakkala40ab2752013-04-04 20:11:36 +0530823#define WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter) \
824 (((WLAN_HDD_INFRA_STATION != pAdapter->device_mode) && \
825 (WLAN_HDD_P2P_CLIENT != pAdapter->device_mode)) ? NULL : \
826 (tdlsCtx_t*)(pAdapter)->sessionCtx.station.pHddTdlsCtx)
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800827#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700828
829typedef struct hdd_adapter_list_node
830{
831 hdd_list_node_t node; // MUST be first element
832 hdd_adapter_t *pAdapter;
833}hdd_adapter_list_node_t;
834
835typedef struct hdd_priv_data_s
836{
837 tANI_U8 *buf;
838 int used_len;
839 int total_len;
840}hdd_priv_data_t;
841
Jeff Johnson295189b2012-06-20 16:38:30 -0700842/** Adapter stucture definition */
843
844struct hdd_context_s
845{
846 /** Global VOS context */
847 v_CONTEXT_t pvosContext;
848
849 /** HAL handle...*/
850 tHalHandle hHal;
851
Jeff Johnson295189b2012-06-20 16:38:30 -0700852 struct wiphy *wiphy ;
Jeff Johnson295189b2012-06-20 16:38:30 -0700853 //TODO Remove this from here.
854
855 hdd_list_t hddAdapters; //List of adapters
856 /* One per STA: 1 for RX_BCMC_STA_ID and 1 for SAP_SELF_STA_ID*/
857 hdd_adapter_t *sta_to_adapter[WLAN_MAX_STA_COUNT + 3]; //One per sta. For quick reference.
858
859 /** Pointer for firmware image data */
860 const struct firmware *fw;
861
862 /** Pointer for configuration data */
863 const struct firmware *cfg;
864
865 /** Pointer for nv data */
866 const struct firmware *nv;
867
868 /** Pointer to the parent device */
869 struct device *parent_dev;
870
871 pid_t pid_sdio_claimed;
872 atomic_t sdio_claim_count;
873
874 /** Config values read from qcom_cfg.ini file */
875 hdd_config_t *cfg_ini;
Jeff Johnson295189b2012-06-20 16:38:30 -0700876 wlan_hdd_ftm_status_t ftm;
Jeff Johnson295189b2012-06-20 16:38:30 -0700877 /** completion variable for full power callback */
878 struct completion full_pwr_comp_var;
879 /** completion variable for Request BMPS callback */
880 struct completion req_bmps_comp_var;
881
882 /** completion variable for standby callback */
883 struct completion standby_comp_var;
884
Jeff Johnson295189b2012-06-20 16:38:30 -0700885 /* Completion variable to indicate Rx Thread Suspended */
886 struct completion rx_sus_event_var;
Jeff Johnson295189b2012-06-20 16:38:30 -0700887
888 /* Completion variable to indicate Tx Thread Suspended */
889 struct completion tx_sus_event_var;
890
891 /* Completion variable to indicate Mc Thread Suspended */
892 struct completion mc_sus_event_var;
893
Madan Mohan Koyyalamudic3a240c2012-09-28 15:34:08 -0700894 /* Completion variable to wlan_hdd_get_crda_regd_entry */
895 struct completion driver_crda_req;
Jeff Johnson295189b2012-06-20 16:38:30 -0700896
897 v_BOOL_t isWlanSuspended;
898
899 v_BOOL_t isTxThreadSuspended;
900
901 v_BOOL_t isMcThreadSuspended;
902
Jeff Johnson295189b2012-06-20 16:38:30 -0700903 v_BOOL_t isRxThreadSuspended;
Jeff Johnson295189b2012-06-20 16:38:30 -0700904
905 volatile v_BOOL_t isLogpInProgress;
906
907 v_BOOL_t isLoadUnloadInProgress;
908
909 /**Track whether driver has been suspended.*/
910 hdd_ps_state_t hdd_ps_state;
911
912 /* Track whether Mcast/Bcast Filter is enabled.*/
913 v_BOOL_t hdd_mcastbcast_filter_set;
914
915 /* Track whether ignore DTIM is enabled*/
916 v_BOOL_t hdd_ignore_dtim_enabled;
917 v_U32_t hdd_actual_ignore_DTIM_value;
918 v_U32_t hdd_actual_LI_value;
919
920
921 v_BOOL_t hdd_wlan_suspended;
922
923 spinlock_t filter_lock;
924
925 /* Lock to avoid race condtion during start/stop bss*/
926 struct mutex sap_lock;
927
928 /** ptt Process ID*/
929 v_SINT_t ptt_pid;
930
931 v_U8_t change_iface;
932
933 /** Concurrency Parameters*/
934 tVOS_CONCURRENCY_MODE concurrency_mode;
935
936 v_U16_t no_of_sessions[VOS_MAX_NO_OF_MODE];
937
938 hdd_chip_reset_stats_t hddChipResetStats;
939 /* Number of times riva restarted */
940 v_U32_t hddRivaResetStats;
941
942 hdd_dynamic_mcbcfilter_t dynamic_mcbc_filter;
943
944 /* Can we allow AMP connection right now*/
945 v_BOOL_t isAmpAllowed;
946
Jeff Johnson295189b2012-06-20 16:38:30 -0700947 /** P2P Device MAC Address for the adapter */
948 v_MACADDR_t p2pDeviceAddress;
Jeff Johnson295189b2012-06-20 16:38:30 -0700949
950 /* Thermal mitigation information */
951 hdd_thermal_mitigation_info_t tmInfo;
Jeff Johnsone7245742012-09-05 17:12:55 -0700952
Sameer Thalappil50dc0092013-02-19 17:23:33 -0800953#ifdef WLAN_OPEN_SOURCE
Jeff Johnsone7245742012-09-05 17:12:55 -0700954#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
955 struct wake_lock rx_wake_lock;
956#endif
Sameer Thalappil50dc0092013-02-19 17:23:33 -0800957#endif
Jeff Johnsone7245742012-09-05 17:12:55 -0700958
959 /*
960 * Framework initiated driver restarting
961 * hdd_reload_timer : Restart retry timer
962 * isRestartInProgress: Restart in progress
963 * hdd_restart_retries: Restart retries
964 *
965 */
966 vos_timer_t hdd_restart_timer;
967 atomic_t isRestartInProgress;
968 u_int8_t hdd_restart_retries;
969
Madan Mohan Koyyalamudi2a1ba772012-10-11 14:59:06 -0700970 hdd_scaninfo_t scan_info;
Gopichand Nakkalaf7e53c52013-01-07 14:52:52 -0800971
Madan Mohan Koyyalamudi543172b2012-12-05 16:40:18 -0800972 /*is_dyanmic_channel_range_set is set to 1 when Softap_set_channel_range
Gopichand Nakkalaf7e53c52013-01-07 14:52:52 -0800973 is invoked*/
Madan Mohan Koyyalamudi543172b2012-12-05 16:40:18 -0800974 v_BOOL_t is_dynamic_channel_range_set;
Madan Mohan Koyyalamudi69fc3ad2012-11-28 16:04:56 -0800975
Gopichand Nakkala1bc04f12013-02-28 14:29:23 -0800976#ifdef WLAN_OPEN_SOURCE
Madan Mohan Koyyalamudi69fc3ad2012-11-28 16:04:56 -0800977 struct wake_lock sap_wake_lock;
Gopichand Nakkala1bc04f12013-02-28 14:29:23 -0800978#endif
Chilam Ng01120412013-02-19 18:32:21 -0800979
980#ifdef FEATURE_WLAN_TDLS
981 eTDLSSupportMode tdls_mode;
Hoonki Lee27511902013-03-14 18:19:06 -0700982 eTDLSSupportMode tdls_mode_last;
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800983 tdlsConnInfo_t tdlsConnInfo[HDD_MAX_NUM_TDLS_STA];
984 /* TDLS peer connected count */
985 tANI_U16 connected_peer_count;
Hoonki Lee93e67ff2013-03-19 15:49:25 -0700986 tdls_scan_context_t tdls_scan_ctxt;
Sameer Thalappil50dc0092013-02-19 17:23:33 -0800987#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700988};
989
990
991
992/*---------------------------------------------------------------------------
993 Function declarations and documenation
994 -------------------------------------------------------------------------*/
995VOS_STATUS hdd_get_front_adapter( hdd_context_t *pHddCtx,
996 hdd_adapter_list_node_t** ppAdapterNode);
997
998VOS_STATUS hdd_get_next_adapter( hdd_context_t *pHddCtx,
999 hdd_adapter_list_node_t* pAdapterNode,
1000 hdd_adapter_list_node_t** pNextAdapterNode);
1001
1002VOS_STATUS hdd_remove_adapter( hdd_context_t *pHddCtx,
1003 hdd_adapter_list_node_t* pAdapterNode);
1004
1005VOS_STATUS hdd_remove_front_adapter( hdd_context_t *pHddCtx,
1006 hdd_adapter_list_node_t** ppAdapterNode);
1007
1008VOS_STATUS hdd_add_adapter_back( hdd_context_t *pHddCtx,
1009 hdd_adapter_list_node_t* pAdapterNode);
1010
1011VOS_STATUS hdd_add_adapter_front( hdd_context_t *pHddCtx,
1012 hdd_adapter_list_node_t* pAdapterNode);
1013
1014hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type,
Jeff Johnsoneed415b2013-01-18 16:11:20 -08001015 const char* name, tSirMacAddr macAddr,
1016 tANI_U8 rtnl_held );
Jeff Johnson295189b2012-06-20 16:38:30 -07001017VOS_STATUS hdd_close_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, tANI_U8 rtnl_held );
1018VOS_STATUS hdd_close_all_adapters( hdd_context_t *pHddCtx );
1019VOS_STATUS hdd_stop_all_adapters( hdd_context_t *pHddCtx );
1020VOS_STATUS hdd_reset_all_adapters( hdd_context_t *pHddCtx );
1021VOS_STATUS hdd_start_all_adapters( hdd_context_t *pHddCtx );
1022VOS_STATUS hdd_reconnect_all_adapters( hdd_context_t *pHddCtx );
Sudhir Sattayappa Kohalli90e4c752013-03-21 14:25:04 -07001023void hdd_dump_concurrency_info(hdd_context_t *pHddCtx);
Jeff Johnson295189b2012-06-20 16:38:30 -07001024hdd_adapter_t * hdd_get_adapter_by_name( hdd_context_t *pHddCtx, tANI_U8 *name );
1025hdd_adapter_t * hdd_get_adapter_by_macaddr( hdd_context_t *pHddCtx, tSirMacAddr macAddr );
1026hdd_adapter_t * hdd_get_mon_adapter( hdd_context_t *pHddCtx );
1027VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter );
1028hdd_adapter_t * hdd_get_adapter( hdd_context_t *pHddCtx, device_mode_t mode );
1029void hdd_deinit_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter );
1030VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter );
1031void hdd_set_station_ops( struct net_device *pWlanDev );
1032tANI_U8* wlan_hdd_get_intf_addr(hdd_context_t* pHddCtx);
1033void wlan_hdd_release_intf_addr(hdd_context_t* pHddCtx, tANI_U8* releaseAddr);
1034v_U8_t hdd_get_operating_channel( hdd_context_t *pHddCtx, device_mode_t mode );
1035
Jeff Johnson295189b2012-06-20 16:38:30 -07001036void hdd_set_conparam ( v_UINT_t newParam );
1037tVOS_CON_MODE hdd_get_conparam( void );
Jeff Johnson295189b2012-06-20 16:38:30 -07001038
1039void wlan_hdd_enable_deepsleep(v_VOID_t * pVosContext);
1040v_BOOL_t hdd_is_apps_power_collapse_allowed(hdd_context_t* pHddCtx);
Madan Mohan Koyyalamudic72a4d62012-11-08 14:59:34 -08001041v_BOOL_t hdd_is_suspend_notify_allowed(hdd_context_t* pHddCtx);
Jeff Johnson295189b2012-06-20 16:38:30 -07001042void hdd_abort_mac_scan(hdd_context_t *pHddCtx);
Jeff Johnson295189b2012-06-20 16:38:30 -07001043void wlan_hdd_set_monitor_tx_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter );
1044void hdd_cleanup_actionframe( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter );
Madan Mohan Koyyalamudic3a240c2012-09-28 15:34:08 -07001045v_BOOL_t is_crda_regulatory_entry_valid(void);
Yunsen Wange3ba1fb2013-04-05 15:04:43 -07001046void crda_regulatory_entry_default(v_U8_t *countryCode, int domain_id);
Jeff Johnson295189b2012-06-20 16:38:30 -07001047void wlan_hdd_set_concurrency_mode(hdd_context_t *pHddCtx, tVOS_CON_MODE mode);
1048void wlan_hdd_clear_concurrency_mode(hdd_context_t *pHddCtx, tVOS_CON_MODE mode);
1049void wlan_hdd_reset_prob_rspies(hdd_adapter_t* pHostapdAdapter);
1050void hdd_prevent_suspend(void);
1051void hdd_allow_suspend(void);
Madan Mohan Koyyalamudi10d83a92012-09-28 15:47:05 -07001052void hdd_allow_suspend_timeout(v_U32_t timeout);
Madan Mohan Koyyalamudib5da5332012-10-15 17:23:21 -07001053bool hdd_is_ssr_required(void);
1054void hdd_set_ssr_required(e_hdd_ssr_required value);
Jeff Johnson295189b2012-06-20 16:38:30 -07001055
1056VOS_STATUS hdd_enable_bmps_imps(hdd_context_t *pHddCtx);
1057VOS_STATUS hdd_disable_bmps_imps(hdd_context_t *pHddCtx, tANI_U8 session_type);
1058
Jeff Johnsone7245742012-09-05 17:12:55 -07001059VOS_STATUS wlan_hdd_restart_driver(hdd_context_t *pHddCtx);
Madan Mohan Koyyalamudi8612ec92012-09-28 15:53:07 -07001060void hdd_exchange_version_and_caps(hdd_context_t *pHddCtx);
Tushnim Bhattacharyya3a37def2013-02-24 11:11:15 -08001061void hdd_set_pwrparams(hdd_context_t *pHddCtx);
1062void hdd_reset_pwrparams(hdd_context_t *pHddCtx);
Jeff Johnson295189b2012-06-20 16:38:30 -07001063#endif // end #if !defined( WLAN_HDD_MAIN_H )