blob: 74c785a552f24e0fbb0313dbddcde09c727c92f7 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Rajeev Kumar8b373292014-01-08 20:36:55 -08002 * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08003 *
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
Jeff Johnson295189b2012-06-20 16:38:30 -070086/** HDD's internal Tx Queue Length. Needs to be a power of 2 */
87#define HDD_TX_QUEUE_MAX_LEN 128
88/** HDD internal Tx Queue Low Watermark. Net Device TX queue is disabled
89 * when HDD queue becomes full. This Low watermark is used to enable
90 * the Net Device queue again */
91#define HDD_TX_QUEUE_LOW_WATER_MARK (HDD_TX_QUEUE_MAX_LEN*3/4)
92/** Bytes to reserve in the headroom */
93#define LIBRA_HW_NEEDED_HEADROOM 128
94/** Hdd Tx Time out value */
95#ifdef LIBRA_LINUX_PC
96#define HDD_TX_TIMEOUT (8000)
97#else
98#define HDD_TX_TIMEOUT msecs_to_jiffies(5000)
99#endif
100/** Hdd Default MTU */
101#define HDD_DEFAULT_MTU (1500)
Jeff Johnson6a81ca42013-04-05 10:37:08 -0700102
Jeff Johnson295189b2012-06-20 16:38:30 -0700103/**event flags registered net device*/
Jeff Johnson6a81ca42013-04-05 10:37:08 -0700104#define NET_DEVICE_REGISTERED (0)
105#define SME_SESSION_OPENED (1)
106#define INIT_TX_RX_SUCCESS (2)
107#define WMM_INIT_DONE (3)
108#define SOFTAP_BSS_STARTED (4)
109#define DEVICE_IFACE_OPENED (5)
110#define TDLS_INIT_DONE (6)
Jeff Johnson295189b2012-06-20 16:38:30 -0700111
112/** Maximum time(ms)to wait for disconnect to complete **/
113#define WLAN_WAIT_TIME_DISCONNECT 500
114#define WLAN_WAIT_TIME_STATS 800
115#define WLAN_WAIT_TIME_POWER 800
Sameer Thalappilda4eb6a2013-09-25 11:45:07 -0700116#define WLAN_WAIT_TIME_COUNTRY 1000
Kiet Lam46b8e4e2013-11-06 21:49:53 +0530117#define WLAN_WAIT_TIME_CHANNEL_UPDATE 600
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 Nakkala79ff85d2013-05-27 17:05:29 +0530130/** Maximum time(ms) to wait for Link Establish Req to complete **/
131#define WAIT_TIME_TDLS_LINK_ESTABLISH_REQ 1500
132
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800133/** Maximum time(ms) to wait for tdls mgmt to complete **/
Gopichand Nakkala21c3f9b2013-03-23 14:45:55 -0700134#define WAIT_TIME_TDLS_MGMT 11000
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800135
Hoonki Lee14621352013-04-16 17:51:19 -0700136/** Maximum time(ms) to wait for tdls initiator to start direct communication **/
Gopichand Nakkala9b4eee12013-05-21 16:05:48 +0530137#define WAIT_TIME_TDLS_INITIATOR 600
Amar Singhalfddc28c2013-09-05 13:03:40 -0700138
139/* Maximum time to get linux regulatory entry settings */
Amar Singhala49cbc52013-10-08 18:37:44 -0700140#ifdef CONFIG_ENABLE_LINUX_REG
Amar Singhalfddc28c2013-09-05 13:03:40 -0700141#define LINUX_REG_WAIT_TIME 300
Amar Singhala49cbc52013-10-08 18:37:44 -0700142#else
143#define CRDA_WAIT_TIME 300
144#endif
Madan Mohan Koyyalamudic3a240c2012-09-28 15:34:08 -0700145
Jeff Johnson295189b2012-06-20 16:38:30 -0700146/* Scan Req Timeout */
147#define WLAN_WAIT_TIME_SCAN_REQ 100
148
149#define MAX_NUMBER_OF_ADAPTERS 4
150
151#define MAX_CFG_STRING_LEN 255
152
153#define MAC_ADDR_ARRAY(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
154/** Mac Address string **/
155#define MAC_ADDRESS_STR "%02x:%02x:%02x:%02x:%02x:%02x"
Arif Hussained667642013-10-27 23:01:14 -0700156#define MAC_ADDRESS_STR_LEN 18 /* Including null terminator */
Jeff Johnson295189b2012-06-20 16:38:30 -0700157#define MAX_GENIE_LEN 255
158
Jeff Johnson295189b2012-06-20 16:38:30 -0700159#define WLAN_CHIP_VERSION "WCNSS"
Jeff Johnson295189b2012-06-20 16:38:30 -0700160
161#define hddLog(level, args...) VOS_TRACE( VOS_MODULE_ID_HDD, level, ## args)
Madan Mohan Koyyalamudi87054ba2012-11-02 13:24:12 -0700162#define ENTER() VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Enter:%s", __func__)
163#define EXIT() VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Exit:%s", __func__)
Jeff Johnson295189b2012-06-20 16:38:30 -0700164
165#define WLAN_HDD_GET_PRIV_PTR(__dev__) (hdd_adapter_t*)(netdev_priv((__dev__)))
166
167#define MAX_EXIT_ATTEMPTS_DURING_LOGP 20
168
169#define MAX_NO_OF_2_4_CHANNELS 14
170
Jeff Johnsone7245742012-09-05 17:12:55 -0700171#define WLAN_HDD_PUBLIC_ACTION_FRAME 4
172#define WLAN_HDD_PUBLIC_ACTION_FRAME_OFFSET 24
173#define WLAN_HDD_PUBLIC_ACTION_FRAME_TYPE_OFFSET 30
174#define WLAN_HDD_P2P_SOCIAL_CHANNELS 3
Madan Mohan Koyyalamudi8d50f312012-11-27 15:48:57 -0800175#define WLAN_HDD_P2P_SINGLE_CHANNEL_SCAN 1
Jeff Johnsone7245742012-09-05 17:12:55 -0700176
Gopichand Nakkala1f7a64f2013-04-01 18:37:17 +0530177#define WLAN_HDD_IS_SOCIAL_CHANNEL(center_freq) \
178(((center_freq) == 2412) || ((center_freq) == 2437) || ((center_freq) == 2462))
179
Madan Mohan Koyyalamudi71278262013-04-12 22:00:48 +0530180#define WLAN_HDD_CHANNEL_IN_UNII_1_BAND(center_freq) \
181(((center_freq) == 5180 ) || ((center_freq) == 5200) \
182|| ((center_freq) == 5220) || ((center_freq) == 5240))
183
Chet Lanctot186b5732013-03-18 10:26:30 -0700184#ifdef WLAN_FEATURE_11W
185#define WLAN_HDD_SA_QUERY_ACTION_FRAME 8
186#endif
187
Hoonki Lee1090c6a2013-01-16 17:40:54 -0800188#define WLAN_HDD_PUBLIC_ACTION_TDLS_DISC_RESP 14
189#define WLAN_HDD_TDLS_ACTION_FRAME 12
Jeff Johnsone7245742012-09-05 17:12:55 -0700190#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
Sameer Thalappil84b14ff2013-06-12 16:02:52 -0700191#define HDD_WAKE_LOCK_DURATION 50 //in msecs
Jeff Johnsone7245742012-09-05 17:12:55 -0700192#endif
193
Amar Singhal6144c002013-05-03 16:11:42 -0700194#define HDD_SAP_WAKE_LOCK_DURATION 10000 //in msecs
Madan Mohan Koyyalamudi69fc3ad2012-11-28 16:04:56 -0800195
Sameer Thalappil451ebb92013-06-28 15:49:58 -0700196#define HDD_MOD_EXIT_SSR_MAX_RETRIES 30
197
Sunil Ravia72c3992013-01-31 06:12:22 -0800198/* Maximum number of interfaces allowed(STA, P2P Device, P2P Interface) */
199#define WLAN_MAX_INTERFACES 3
200
Gopichand Nakkala870cbae2013-03-15 21:16:09 +0530201#ifdef WLAN_FEATURE_GTK_OFFLOAD
202#define GTK_OFFLOAD_ENABLE 0
203#define GTK_OFFLOAD_DISABLE 1
204#endif
205
Madan Mohan Koyyalamudi1d16f462013-08-27 16:25:34 +0530206#ifdef FEATURE_WLAN_SCAN_PNO
207#define HDD_PNO_SCAN_TIMERS_SET_ONE 1
208/* value should not be greater than PNO_MAX_SCAN_TIMERS */
209#define HDD_PNO_SCAN_TIMERS_SET_MULTIPLE 6
210#endif
211
Arif Hussain0273cba2014-01-07 20:58:29 -0800212#define MAX_USER_COMMAND_SIZE 4096
213
Gopichand Nakkala3d295922013-05-07 16:19:14 +0530214#define HDD_MAC_ADDR_LEN 6
215typedef v_U8_t tWlanHddMacAddr[HDD_MAC_ADDR_LEN];
216
Rajeev79dbe4c2013-10-05 11:03:42 +0530217#ifdef FEATURE_WLAN_BATCH_SCAN
218#define HDD_BATCH_SCAN_VERSION (17)
219#define HDD_SET_BATCH_SCAN_DEFAULT_FREQ (30)/*batch scan frequency default 30s*/
220#define HDD_SET_BATCH_SCAN_BEST_NETWORK (16)/*best network default value*/
221#define HDD_SET_BATCH_SCAN_DEFAULT_BAND (0)/*auto means both 2.4GHz and 5GHz*/
222#define HDD_SET_BATCH_SCAN_24GHz_BAND_ONLY (1)/*only 2.4GHz band*/
223#define HDD_SET_BATCH_SCAN_5GHz_BAND_ONLY (2)/*only 5GHz band*/
224#define HDD_SET_BATCH_SCAN_REQ_TIME_OUT (15000) /*Batch scan req timeout in ms*/
225#define HDD_GET_BATCH_SCAN_RSP_TIME_OUT (15000) /*Batch scan req timeout in ms*/
226#define HDD_BATCH_SCAN_AP_META_INFO_SIZE (150) /*AP meta info size in string*/
227
228#define MIN(a, b) (a > b ? b : a)
229
230#endif
231
Jeff Johnson72a40512013-12-19 10:14:15 -0800232/*
233 * Generic asynchronous request/response support
234 *
235 * Many of the APIs supported by HDD require a call to SME to
236 * perform an action or to retrieve some data. In most cases SME
237 * performs the operation asynchronously, and will execute a provided
238 * callback function when the request has completed. In order to
239 * synchronize this the HDD API allocates a context which is then
240 * passed to SME, and which is then, in turn, passed back to the
241 * callback function when the operation completes. The callback
242 * function then sets a completion variable inside the context which
243 * the HDD API is waiting on. In an ideal world the HDD API would
244 * wait forever (or at least for a long time) for the response to be
245 * received and for the completion variable to be set. However in
246 * most cases these HDD APIs are being invoked in the context of a
247 * userspace thread which has invoked either a cfg80211 API or a
248 * wireless extensions ioctl and which has taken the kernel rtnl_lock.
249 * Since this lock is used to synchronize many of the kernel tasks, we
250 * do not want to hold it for a long time. In addition we do not want
251 * to block userspace threads (such as the wpa supplicant's main
252 * thread) for an extended time. Therefore we only block for a short
253 * time waiting for the response before we timeout. This means that
254 * it is possible for the HDD API to timeout, and for the callback to
255 * be invoked afterwards. In order for the callback function to
256 * determine if the HDD API is still waiting, a magic value is also
257 * stored in the shared context. Only if the context has a valid
258 * magic will the callback routine do any work. In order to further
259 * synchronize these activities a spinlock is used so that if any HDD
260 * API timeout coincides with its callback, the operations of the two
261 * threads will be serialized.
262 */
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700263struct statsContext
264{
265 struct completion completion;
266 hdd_adapter_t *pAdapter;
267 unsigned int magic;
268};
269
Jeff Johnson72a40512013-12-19 10:14:15 -0800270extern spinlock_t hdd_context_lock;
271
Srinivas Girigowda5cecb202013-10-08 09:13:25 -0700272#define STATS_CONTEXT_MAGIC 0x53544154 //STAT
Jeff Johnson72a40512013-12-19 10:14:15 -0800273#define RSSI_CONTEXT_MAGIC 0x52535349 //RSSI
274#define POWER_CONTEXT_MAGIC 0x504F5752 //POWR
275#define SNR_CONTEXT_MAGIC 0x534E5200 //SNR
Rajeev79dbe4c2013-10-05 11:03:42 +0530276
Jeff Johnson295189b2012-06-20 16:38:30 -0700277typedef struct hdd_tx_rx_stats_s
278{
279 // start_xmit stats
280 __u32 txXmitCalled;
281 __u32 txXmitDropped;
282 __u32 txXmitBackPressured;
283 __u32 txXmitQueued;
284 __u32 txXmitClassifiedAC[NUM_TX_QUEUES];
285 __u32 txXmitDroppedAC[NUM_TX_QUEUES];
286 __u32 txXmitBackPressuredAC[NUM_TX_QUEUES];
287 __u32 txXmitQueuedAC[NUM_TX_QUEUES];
288 // fetch_cbk stats
289 __u32 txFetched;
290 __u32 txFetchedAC[NUM_TX_QUEUES];
291 __u32 txFetchEmpty;
292 __u32 txFetchLowResources;
293 __u32 txFetchDequeueError;
294 __u32 txFetchDequeued;
295 __u32 txFetchDequeuedAC[NUM_TX_QUEUES];
296 __u32 txFetchDePressured;
297 __u32 txFetchDePressuredAC[NUM_TX_QUEUES];
298 // complete_cbk_stats
299 __u32 txCompleted;
300 // flush stats
301 __u32 txFlushed;
302 __u32 txFlushedAC[NUM_TX_QUEUES];
303 // rx stats
304 __u32 rxChains;
305 __u32 rxPackets;
306 __u32 rxDropped;
307 __u32 rxDelivered;
308 __u32 rxRefused;
Sudhir Sattayappa Kohalli37620692013-08-05 14:02:26 -0700309 __u32 pkt_tx_count; //TX pkt Counter used for dynamic splitscan
310 __u32 pkt_rx_count; //RX pkt Counter used for dynamic splitscan
Jeff Johnson295189b2012-06-20 16:38:30 -0700311} hdd_tx_rx_stats_t;
312
313typedef struct hdd_chip_reset_stats_s
314{
315 __u32 totalLogpResets;
316 __u32 totalCMD53Failures;
317 __u32 totalMutexReadFailures;
318 __u32 totalMIFErrorFailures;
319 __u32 totalFWHearbeatFailures;
320 __u32 totalUnknownExceptions;
321} hdd_chip_reset_stats_t;
322
Chet Lanctot186b5732013-03-18 10:26:30 -0700323#ifdef WLAN_FEATURE_11W
324typedef struct hdd_pmf_stats_s
325{
326 uint8 numUnprotDeauthRx;
327 uint8 numUnprotDisassocRx;
328} hdd_pmf_stats_t;
329#endif
330
Jeff Johnson295189b2012-06-20 16:38:30 -0700331typedef struct hdd_stats_s
332{
333 tCsrSummaryStatsInfo summary_stat;
334 tCsrGlobalClassAStatsInfo ClassA_stat;
335 tCsrGlobalClassBStatsInfo ClassB_stat;
336 tCsrGlobalClassCStatsInfo ClassC_stat;
337 tCsrGlobalClassDStatsInfo ClassD_stat;
338 tCsrPerStaStatsInfo perStaStats;
339 hdd_tx_rx_stats_t hddTxRxStats;
340 hdd_chip_reset_stats_t hddChipResetStats;
Chet Lanctot186b5732013-03-18 10:26:30 -0700341#ifdef WLAN_FEATURE_11W
342 hdd_pmf_stats_t hddPmfStats;
343#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700344} hdd_stats_t;
345
346typedef enum
347{
348 HDD_ROAM_STATE_NONE,
349
350 // Issuing a disconnect due to transition into low power states.
351 HDD_ROAM_STATE_DISCONNECTING_POWER,
352
353 // move to this state when HDD sets a key with SME/CSR. Note this is
354 // an important state to get right because we will get calls into our SME
355 // callback routine for SetKey activity that we did not initiate!
356 HDD_ROAM_STATE_SETTING_KEY,
357} HDD_ROAM_STATE;
358
359typedef enum
360{
361 eHDD_SUSPEND_NONE = 0,
362 eHDD_SUSPEND_DEEP_SLEEP,
363 eHDD_SUSPEND_STANDBY,
364} hdd_ps_state_t;
365
366typedef struct roaming_info_s
367{
368 HDD_ROAM_STATE roamingState;
369 vos_event_t roamingEvent;
Gopichand Nakkala3d295922013-05-07 16:19:14 +0530370
371 tWlanHddMacAddr bssid;
372 tWlanHddMacAddr peerMac;
373 tANI_U32 roamId;
374 eRoamCmdStatus roamStatus;
375 v_BOOL_t deferKeyComplete;
Jeff Johnson295189b2012-06-20 16:38:30 -0700376
377} roaming_info_t;
378
379#ifdef FEATURE_WLAN_WAPI
380/* Define WAPI macros for Length, BKID count etc*/
381#define MAX_WPI_KEY_LENGTH 16
382#define MAX_NUM_PN 16
383#define MAC_ADDR_LEN 6
384#define MAX_ADDR_INDEX 12
385#define MAX_NUM_AKM_SUITES 16
386#define MAX_NUM_UNI_SUITES 16
387#define MAX_NUM_BKIDS 16
Jeff Johnson295189b2012-06-20 16:38:30 -0700388
389/** WAPI AUTH mode definition */
390enum _WAPIAuthMode
391{
392 WAPI_AUTH_MODE_OPEN = 0,
393 WAPI_AUTH_MODE_PSK = 1,
394 WAPI_AUTH_MODE_CERT
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700395} __packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700396typedef enum _WAPIAuthMode WAPIAuthMode;
397
398/** WAPI Work mode structure definition */
399#define WZC_ORIGINAL 0
400#define WAPI_EXTENTION 1
401
402struct _WAPI_FUNCTION_MODE
403{
404 unsigned char wapiMode;
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700405}__packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700406
407typedef struct _WAPI_FUNCTION_MODE WAPI_FUNCTION_MODE;
408
409typedef struct _WAPI_BKID
410{
411 v_U8_t bkid[16];
412}WAPI_BKID, *pWAPI_BKID;
413
414/** WAPI Association information structure definition */
415struct _WAPI_AssocInfo
416{
417 v_U8_t elementID;
418 v_U8_t length;
419 v_U16_t version;
420 v_U16_t akmSuiteCount;
421 v_U32_t akmSuite[MAX_NUM_AKM_SUITES];
422 v_U16_t unicastSuiteCount;
423 v_U32_t unicastSuite[MAX_NUM_UNI_SUITES];
424 v_U32_t multicastSuite;
425 v_U16_t wapiCability;
426 v_U16_t bkidCount;
427 WAPI_BKID bkidList[MAX_NUM_BKIDS];
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700428} __packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700429
430typedef struct _WAPI_AssocInfo WAPI_AssocInfo;
431typedef struct _WAPI_AssocInfo *pWAPI_IEAssocInfo;
432
433/** WAPI KEY Type definition */
434enum _WAPIKeyType
435{
436 PAIRWISE_KEY, //0
437 GROUP_KEY //1
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700438}__packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700439typedef enum _WAPIKeyType WAPIKeyType;
440
441/** WAPI KEY Direction definition */
442enum _KEY_DIRECTION
443{
444 None,
445 Rx,
446 Tx,
447 Rx_Tx
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700448}__packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700449
450typedef enum _KEY_DIRECTION WAPI_KEY_DIRECTION;
451
452/** WAPI KEY stucture definition */
453struct WLAN_WAPI_KEY
454{
455 WAPIKeyType keyType;
456 WAPI_KEY_DIRECTION keyDirection; /*reserved for future use*/
457 v_U8_t keyId;
458 v_U8_t addrIndex[MAX_ADDR_INDEX]; /*reserved for future use*/
459 int wpiekLen;
460 v_U8_t wpiek[MAX_WPI_KEY_LENGTH];
461 int wpickLen;
462 v_U8_t wpick[MAX_WPI_KEY_LENGTH];
463 v_U8_t pn[MAX_NUM_PN]; /*reserved for future use*/
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700464}__packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700465
466typedef struct WLAN_WAPI_KEY WLAN_WAPI_KEY;
467typedef struct WLAN_WAPI_KEY *pWLAN_WAPI_KEY;
468
469#define WPA_GET_LE16(a) ((u16) (((a)[1] << 8) | (a)[0]))
470#define WLAN_EID_WAPI 68
471#define WAPI_PSK_AKM_SUITE 0x02721400
472#define WAPI_CERT_AKM_SUITE 0x01721400
473
474/** WAPI BKID List stucture definition */
475struct _WLAN_BKID_LIST
476{
477 v_U32_t length;
478 v_U32_t BKIDCount;
479 WAPI_BKID BKID[1];
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700480}__packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700481
482typedef struct _WLAN_BKID_LIST WLAN_BKID_LIST;
483typedef struct _WLAN_BKID_LIST *pWLAN_BKID_LIST;
484
485
486/** WAPI Information stucture definition */
487struct hdd_wapi_info_s
488{
489 v_U32_t nWapiMode;
490 v_BOOL_t fIsWapiSta;
491 v_MACADDR_t cachedMacAddr;
492 v_UCHAR_t wapiAuthMode;
Madan Mohan Koyyalamudi4e31b132012-11-02 13:13:52 -0700493}__packed;
Jeff Johnson295189b2012-06-20 16:38:30 -0700494typedef struct hdd_wapi_info_s hdd_wapi_info_t;
495#endif /* FEATURE_WLAN_WAPI */
496
Jeff Johnson295189b2012-06-20 16:38:30 -0700497typedef struct beacon_data_s {
498 u8 *head, *tail;
499 int head_len, tail_len;
500 int dtim_period;
501} beacon_data_t;
Jeff Johnson295189b2012-06-20 16:38:30 -0700502
503typedef enum device_mode
504{ /* MAINTAIN 1 - 1 CORRESPONDENCE WITH tVOS_CON_MODE*/
505 WLAN_HDD_INFRA_STATION,
506 WLAN_HDD_SOFTAP,
507 WLAN_HDD_P2P_CLIENT,
508 WLAN_HDD_P2P_GO,
Jeff Johnson88ba7742013-02-27 14:36:02 -0800509 WLAN_HDD_MONITOR,
510 WLAN_HDD_FTM,
Shailender Karmuchia734f332013-04-19 14:02:48 -0700511 WLAN_HDD_IBSS,
Ravi Joshiaeb7d9e2013-05-02 12:28:14 -0700512 WLAN_HDD_P2P_DEVICE
Jeff Johnson295189b2012-06-20 16:38:30 -0700513}device_mode_t;
514
515typedef enum rem_on_channel_request_type
516{
517 REMAIN_ON_CHANNEL_REQUEST,
518 OFF_CHANNEL_ACTION_TX,
519}rem_on_channel_request_type_t;
520
521/* Thermal mitigation Level Enum Type */
522typedef enum
523{
524 WLAN_HDD_TM_LEVEL_0,
525 WLAN_HDD_TM_LEVEL_1,
526 WLAN_HDD_TM_LEVEL_2,
527 WLAN_HDD_TM_LEVEL_3,
528 WLAN_HDD_TM_LEVEL_4,
529 WLAN_HDD_TM_LEVEL_MAX
530} WLAN_TmLevelEnumType;
531
532/* Driver Action based on thermal mitigation level structure */
533typedef struct
534{
535 v_BOOL_t ampduEnable;
536 v_BOOL_t enterImps;
537 v_U32_t txSleepDuration;
538 v_U32_t txOperationDuration;
539 v_U32_t txBlockFrameCountThreshold;
540} hdd_tmLevelAction_t;
541
542/* Thermal Mitigation control context structure */
543typedef struct
544{
545 WLAN_TmLevelEnumType currentTmLevel;
546 hdd_tmLevelAction_t tmAction;
547 vos_timer_t txSleepTimer;
548 struct mutex tmOperationLock;
549 vos_event_t setTmDoneEvent;
550 v_U32_t txFrameCount;
551 v_TIME_t lastblockTs;
552 v_TIME_t lastOpenTs;
553 struct netdev_queue *blockedQueue;
Leo Chang50bbd252013-04-25 14:58:01 -0700554 v_BOOL_t qBlocked;
Jeff Johnson295189b2012-06-20 16:38:30 -0700555} hdd_thermal_mitigation_info_t;
556
Jeff Johnson295189b2012-06-20 16:38:30 -0700557typedef struct hdd_remain_on_chan_ctx
558{
559 struct net_device *dev;
560 struct ieee80211_channel chan;
561 enum nl80211_channel_type chan_type;
562 unsigned int duration;
563 u64 cookie;
564 rem_on_channel_request_type_t rem_on_chan_request;
565}hdd_remain_on_chan_ctx_t;
566
Jeff Johnsone7245742012-09-05 17:12:55 -0700567typedef enum{
568 HDD_IDLE,
569 HDD_PD_REQ_ACK_PENDING,
570 HDD_GO_NEG_REQ_ACK_PENDING,
571 HDD_INVALID_STATE,
572}eP2PActionFrameState;
573
574typedef enum {
575 WLAN_HDD_GO_NEG_REQ,
576 WLAN_HDD_GO_NEG_RESP,
577 WLAN_HDD_GO_NEG_CNF,
578 WLAN_HDD_INVITATION_REQ,
579 WLAN_HDD_INVITATION_RESP,
580 WLAN_HDD_DEV_DIS_REQ,
581 WLAN_HDD_DEV_DIS_RESP,
582 WLAN_HDD_PROV_DIS_REQ,
583 WLAN_HDD_PROV_DIS_RESP,
584}tActionFrmType;
585
Jeff Johnson295189b2012-06-20 16:38:30 -0700586typedef struct hdd_cfg80211_state_s
587{
588 tANI_U16 current_freq;
589 u64 action_cookie;
590 tANI_U8 *buf;
591 size_t len;
592 struct sk_buff *skb;
593 hdd_remain_on_chan_ctx_t* remain_on_chan_ctx;
Jeff Johnsone7245742012-09-05 17:12:55 -0700594 eP2PActionFrameState actionFrmState;
Jeff Johnson295189b2012-06-20 16:38:30 -0700595}hdd_cfg80211_state_t;
596
Madan Mohan Koyyalamudib5da5332012-10-15 17:23:21 -0700597
598typedef enum{
599 HDD_SSR_NOT_REQUIRED,
600 HDD_SSR_REQUIRED,
601 HDD_SSR_DISABLED,
602}e_hdd_ssr_required;
603
Jeff Johnson295189b2012-06-20 16:38:30 -0700604struct hdd_station_ctx
605{
606 /** Handle to the Wireless Extension State */
607 hdd_wext_state_t WextState;
608
Gopichand Nakkala4327a152013-03-04 23:22:42 -0800609#ifdef FEATURE_WLAN_TDLS
610 tdlsCtx_t *pHddTdlsCtx;
611#endif
612
613
Jeff Johnson295189b2012-06-20 16:38:30 -0700614 /**Connection information*/
615 connection_info_t conn_info;
616
617 roaming_info_t roam_info;
618
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700619#if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR)
Jeff Johnson295189b2012-06-20 16:38:30 -0700620 int ft_carrier_on;
621#endif
Gopichand Nakkala870cbae2013-03-15 21:16:09 +0530622
623#ifdef WLAN_FEATURE_GTK_OFFLOAD
Gopichand Nakkalad36ee622013-05-07 14:13:27 +0530624 tSirGtkOffloadParams gtkOffloadReqParams;
Gopichand Nakkala870cbae2013-03-15 21:16:09 +0530625#endif
Shailender Karmuchi15cd0672013-05-15 19:50:04 -0700626 /*Increment whenever ibss New peer joins and departs the network */
627 int ibss_sta_generation;
Shailender Karmuchi642e9812013-05-30 14:34:49 -0700628
629 /*Save the wep/wpa-none keys*/
630 tCsrRoamSetKey ibss_enc_key;
Srinivas Girigowda66c05eb2013-07-14 13:06:01 -0700631
632 v_BOOL_t hdd_ReassocScenario;
Jeff Johnson295189b2012-06-20 16:38:30 -0700633};
634
635#define BSS_STOP 0
636#define BSS_START 1
637typedef struct hdd_hostapd_state_s
638{
639 int bssState;
640 vos_event_t vosEvent;
641 VOS_STATUS vosStatus;
642 v_BOOL_t bCommit;
643
644} hdd_hostapd_state_t;
645
646
647/*
648 * Per station structure kept in HDD for multiple station support for SoftAP
649*/
650typedef struct {
651 /** The station entry is used or not */
652 v_BOOL_t isUsed;
653
654 /** Station ID reported back from HAL (through SAP). Broadcast
655 * uses station ID zero by default in both libra and volans. */
656 v_U8_t ucSTAId;
657
658 /** MAC address of the station */
659 v_MACADDR_t macAddrSTA;
660
661 /** Current Station state so HDD knows how to deal with packet
662 * queue. Most recent states used to change TL STA state. */
663 WLANTL_STAStateType tlSTAState;
664
665 /** Transmit queues for each AC (VO,VI,BE etc). */
666 hdd_list_t wmm_tx_queue[NUM_TX_QUEUES];
667
668 /** Might need to differentiate queue depth in contention case */
669 v_U16_t aTxQueueDepth[NUM_TX_QUEUES];
670
671 /**Track whether OS TX queue has been disabled.*/
672 v_BOOL_t txSuspended[NUM_TX_QUEUES];
673
Madan Mohan Koyyalamudifd3b7a92013-10-10 15:02:58 +0530674 /**Track whether 3/4th of resources are used */
675 v_BOOL_t vosLowResource;
676
Jeff Johnson295189b2012-06-20 16:38:30 -0700677 /** Track QoS status of station */
678 v_BOOL_t isQosEnabled;
679
Madan Mohan Koyyalamudicd784992013-01-11 15:30:36 -0800680 /** The station entry for which Deauth is in progress */
681 v_BOOL_t isDeauthInProgress;
Jeff Johnson295189b2012-06-20 16:38:30 -0700682} hdd_station_info_t;
683
684struct hdd_ap_ctx_s
685{
686 hdd_hostapd_state_t HostapdState;
687
688 // Memory differentiation mode is enabled
689 //v_U16_t uMemoryDiffThreshold;
690 //v_U8_t uNumActiveAC;
691 //v_U8_t uActiveACMask;
692 //v_U8_t aTxQueueLimit[NUM_TX_QUEUES];
693
694 /** Packet Count to update uNumActiveAC and uActiveACMask */
695 //v_U16_t uUpdatePktCount;
696
697 /** Station ID assigned after BSS starts */
698 v_U8_t uBCStaId;
699
700 v_U8_t uPrivacy; // The privacy bits of configuration
Jeff Johnson7dda7772013-02-27 08:36:13 -0800701
Jeff Johnson295189b2012-06-20 16:38:30 -0700702 tSirWPSPBCProbeReq WPSPBCProbeReq;
Jeff Johnson7dda7772013-02-27 08:36:13 -0800703
Jeff Johnson295189b2012-06-20 16:38:30 -0700704 tsap_Config_t sapConfig;
Jeff Johnson7dda7772013-02-27 08:36:13 -0800705
Jeff Johnson295189b2012-06-20 16:38:30 -0700706 struct semaphore semWpsPBCOverlapInd;
707
708 v_BOOL_t apDisableIntraBssFwd;
709
710 vos_timer_t hdd_ap_inactivity_timer;
711
712 v_U8_t operatingChannel;
713
714 v_BOOL_t uIsAuthenticated;
715
716 eCsrEncryptionType ucEncryptType;
717
Jeff Johnson295189b2012-06-20 16:38:30 -0700718 //This will point to group key data, if it is received before start bss.
719 tCsrRoamSetKey groupKey;
720 // This will have WEP key data, if it is received before start bss
721 tCsrRoamSetKey wepKey[CSR_MAX_NUM_KEY];
722
723 beacon_data_t *beacon;
Jeff Johnson295189b2012-06-20 16:38:30 -0700724};
725
Jeff Johnson295189b2012-06-20 16:38:30 -0700726struct hdd_mon_ctx_s
727{
728 hdd_adapter_t *pAdapterForTx;
729};
Jeff Johnson295189b2012-06-20 16:38:30 -0700730
731typedef struct hdd_scaninfo_s
732{
733 /* The scan id */
734 v_U32_t scanId;
735
736 /* The scan pending */
737 v_U32_t mScanPending;
738
Kiet Lamac06e2c2013-10-23 16:25:07 +0530739 /* Counter for mScanPending so that the scan pending
740 error log is not printed for more than 5 times */
741 v_U32_t mScanPendingCounter;
742
Jeff Johnson295189b2012-06-20 16:38:30 -0700743 /* Client Wait Scan Result */
744 v_U32_t waitScanResult;
745
Jeff Johnson295189b2012-06-20 16:38:30 -0700746 /* Additional IE for scan */
747 tSirAddie scanAddIE;
748
749 /* Scan mode*/
750 tSirScanType scan_mode;
751
752 /* Scan Completion Event */
753 struct completion scan_req_completion_event;
754
Madan Mohan Koyyalamudif4e81002012-11-13 10:46:38 -0800755 /* completion variable for abortscan */
756 struct completion abortscan_event_var;
757
Jeff Johnson295189b2012-06-20 16:38:30 -0700758 vos_event_t scan_finished_event;
759
760 hdd_scan_pending_option_e scan_pending_option;
761
762}hdd_scaninfo_t;
763
Gopichand Nakkala0f276812013-02-24 14:45:51 +0530764#define WLAN_HDD_MAX_MC_ADDR_LIST 10
765
766#ifdef WLAN_FEATURE_PACKET_FILTERING
767typedef struct multicast_addr_list
768{
769 v_U8_t isFilterApplied;
770 v_U8_t mc_cnt;
771 v_U8_t addr[WLAN_HDD_MAX_MC_ADDR_LIST][ETH_ALEN];
772} t_multicast_add_list;
773#endif
774
Rajeev79dbe4c2013-10-05 11:03:42 +0530775#ifdef FEATURE_WLAN_BATCH_SCAN
776
777/*Batch scan repsonse AP info*/
778typedef struct
779{
780 /*Batch ID*/
781 tANI_U32 batchId;
782 /*is it last AP in GET BATCH SCAN RSP*/
783 v_BOOL_t isLastAp;
784 /*BSSID*/
785 tANI_U8 bssid[SIR_MAC_ADDR_LEN];
786 /*SSID*/
787 tANI_U8 ssid[SIR_MAX_SSID_SIZE];
788 /*Channel*/
789 tANI_U8 ch;
790 /*RSSI or Level*/
791 tANI_U8 rssi;
792 /*Age*/
793 tANI_U32 age;
794}tHDDbatchScanRspApInfo;
795
796/*Batch scan response list*/
797struct tHDDBatchScanRspList
798{
799 tHDDbatchScanRspApInfo ApInfo;
800 struct tHDDBatchScanRspList *pNext;
801};
802
803typedef struct tHDDBatchScanRspList tHddBatchScanRsp;
Rajeev Kumar20140c12013-10-21 19:39:02 -0700804
805/*Batch Scan state*/
806typedef enum
807{
808 /*Batch scan is started this means WLS_BATCHING SET command is issued
809 from framework*/
810 eHDD_BATCH_SCAN_STATE_STARTED,
811
812 /*Batch scan is stopped this means WLS_BATCHING STOP command is issued
813 from framework*/
814 eHDD_BATCH_SCAN_STATE_STOPPED,
815
816 eHDD_BATCH_SCAN_STATE_MAX,
817} eHDD_BATCH_SCAN_STATE;
818
Rajeev79dbe4c2013-10-05 11:03:42 +0530819#endif
820
821
Jeff Johnson295189b2012-06-20 16:38:30 -0700822#define WLAN_HDD_ADAPTER_MAGIC 0x574c414e //ASCII "WLAN"
823struct hdd_adapter_s
824{
825 void *pHddCtx;
826
827 device_mode_t device_mode;
828
829 /** Handle to the network device */
830 struct net_device *dev;
Vinay Krishna Erannad5b2be22013-12-01 17:00:15 +0530831
832#ifdef WLAN_NS_OFFLOAD
833 /** IPv6 notifier callback for handling NS offload on change in IP */
834 struct notifier_block ipv6_notifier;
835 struct work_struct ipv6NotifierWorkQueue;
836#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700837
Vinay Krishna Eranna4d055d42013-12-17 17:02:01 +0530838 /** IPv4 notifier callback for handling ARP offload on change in IP */
839 struct notifier_block ipv4_notifier;
840 struct work_struct ipv4NotifierWorkQueue;
841
Jeff Johnson295189b2012-06-20 16:38:30 -0700842 //TODO Move this to sta Ctx
Jeff Johnson295189b2012-06-20 16:38:30 -0700843 struct wireless_dev wdev ;
844 struct cfg80211_scan_request *request ;
Jeff Johnson295189b2012-06-20 16:38:30 -0700845
Jeff Johnson295189b2012-06-20 16:38:30 -0700846 /** ops checks if Opportunistic Power Save is Enable or Not
847 * ctw stores ctWindow value once we receive Opps command from
848 * wpa_supplicant then using ctWindow value we need to Enable
849 * Opportunistic Power Save
850 */
851 tANI_U8 ops;
852 tANI_U32 ctw;
Jeff Johnson295189b2012-06-20 16:38:30 -0700853
854 /** Current MAC Address for the adapter */
855 v_MACADDR_t macAddressCurrent;
856
857 /**Event Flags*/
858 unsigned long event_flags;
859
860 /**Device TX/RX statistics*/
861 struct net_device_stats stats;
862 /** HDD statistics*/
863 hdd_stats_t hdd_stats;
864 /**Mib information*/
865 sHddMib_t hdd_mib;
866
867 tANI_U8 sessionId;
Jeff Johnson295189b2012-06-20 16:38:30 -0700868
869 /* Completion variable for session close */
870 struct completion session_close_comp_var;
871
872 /* Completion variable for session open */
873 struct completion session_open_comp_var;
874
875 //TODO: move these to sta ctx. These may not be used in AP
876 /** completion variable for disconnect callback */
877 struct completion disconnect_comp_var;
878
Jeff Johnson04dd8a82012-06-29 20:41:40 -0700879 /** Completion of change country code */
880 struct completion change_country_code;
881
Jeff Johnson295189b2012-06-20 16:38:30 -0700882 /* completion variable for Linkup Event */
883 struct completion linkup_event_var;
884
Jeff Johnson295189b2012-06-20 16:38:30 -0700885 /* completion variable for cancel remain on channel Event */
886 struct completion cancel_rem_on_chan_var;
887
888#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
889 /* completion variable for off channel remain on channel Event */
890 struct completion offchannel_tx_event;
891#endif
892 /* Completion variable for action frame */
893 struct completion tx_action_cnf_event;
894 /* Completion variable for remain on channel ready */
895 struct completion rem_on_chan_ready_event;
Jeff Johnson295189b2012-06-20 16:38:30 -0700896
Jeff Johnson9efb9aa2013-03-15 13:59:27 -0700897 /* Completion variable for Upper Layer Authentication */
898 struct completion ula_complete;
899
Hoonki Lee11f7dda2013-02-14 16:55:44 -0800900#ifdef FEATURE_WLAN_TDLS
901 struct completion tdls_add_station_comp;
Gopichand Nakkalae7cbc5d2013-03-27 21:09:23 -0700902 struct completion tdls_del_station_comp;
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800903 struct completion tdls_mgmt_comp;
Gopichand Nakkala79ff85d2013-05-27 17:05:29 +0530904 struct completion tdls_link_establish_req_comp;
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800905 eHalStatus tdlsAddStaStatus;
Hoonki Lee11f7dda2013-02-14 16:55:44 -0800906#endif
Jeff Johnson295189b2012-06-20 16:38:30 -0700907 /* Track whether the linkup handling is needed */
908 v_BOOL_t isLinkUpSvcNeeded;
909
Gopichand Nakkalab977a972013-02-18 19:15:09 -0800910 /* Mgmt Frames TX completion status code */
911 tANI_U32 mgmtTxCompletionStatus;
912
Jeff Johnson295189b2012-06-20 16:38:30 -0700913/*************************************************************
914 * Tx Queues
915 */
916 /** Transmit queues for each AC (VO,VI,BE etc) */
917 hdd_list_t wmm_tx_queue[NUM_TX_QUEUES];
918 /**Track whether VOS is in a low resource state*/
919 v_BOOL_t isVosOutOfResource;
Madan Mohan Koyyalamudifd3b7a92013-10-10 15:02:58 +0530920
921 /**Track whether 3/4th of resources are used */
922 v_BOOL_t isVosLowResource;
Jeff Johnson295189b2012-06-20 16:38:30 -0700923
924 /**Track whether OS TX queue has been disabled.*/
925 v_BOOL_t isTxSuspended[NUM_TX_QUEUES];
926
927 /** WMM Status */
928 hdd_wmm_status_t hddWmmStatus;
929/*************************************************************
930 */
931/*************************************************************
932 * TODO - Remove it later
933 */
934 /** Multiple station supports */
935 /** Per-station structure */
936 spinlock_t staInfo_lock; //To protect access to station Info
937 hdd_station_info_t aStaInfo[WLAN_MAX_STA_COUNT];
938 //v_U8_t uNumActiveStation;
939
940 v_U16_t aTxQueueLimit[NUM_TX_QUEUES];
941/*************************************************************
942 */
943
944#ifdef FEATURE_WLAN_WAPI
945 hdd_wapi_info_t wapi_info;
946#endif
947
948 v_S7_t rssi;
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +0530949
950 tANI_U8 snr;
951
Jeff Johnson295189b2012-06-20 16:38:30 -0700952 struct work_struct monTxWorkQueue;
953 struct sk_buff *skb_to_tx;
Jeff Johnson295189b2012-06-20 16:38:30 -0700954
955 union {
956 hdd_station_ctx_t station;
957 hdd_ap_ctx_t ap;
Jeff Johnson295189b2012-06-20 16:38:30 -0700958 hdd_mon_ctx_t monitor;
Jeff Johnson295189b2012-06-20 16:38:30 -0700959 }sessionCtx;
960
Jeff Johnson295189b2012-06-20 16:38:30 -0700961 hdd_cfg80211_state_t cfg80211State;
Jeff Johnson295189b2012-06-20 16:38:30 -0700962
Gopichand Nakkala0f276812013-02-24 14:45:51 +0530963#ifdef WLAN_FEATURE_PACKET_FILTERING
964 t_multicast_add_list mc_addr_list;
965#endif
966
Jeff Johnson295189b2012-06-20 16:38:30 -0700967 //Magic cookie for adapter sanity verification
968 v_U32_t magic;
969 v_BOOL_t higherDtimTransition;
Madan Mohan Koyyalamudid9383fd2013-08-13 09:27:30 +0530970 v_BOOL_t survey_idx;
Rajeev79dbe4c2013-10-05 11:03:42 +0530971
972#ifdef FEATURE_WLAN_BATCH_SCAN
973 /*Completion variable for set batch scan request*/
974 struct completion hdd_set_batch_scan_req_var;
975 /*Completion variable for get batch scan request*/
976 struct completion hdd_get_batch_scan_req_var;
977 /*HDD batch scan lock*/
978 struct mutex hdd_batch_scan_lock;
979 /*HDD set batch scan request*/
980 tSirSetBatchScanReq hddSetBatchScanReq;
981 /*HDD set batch scan response*/
982 tSirSetBatchScanRsp hddSetBatchScanRsp;
983 /*HDD stop batch scan indication*/
984 tSirStopBatchScanInd hddStopBatchScanInd;
985 /*HDD get batch scan request*/
986 tSirTriggerBatchScanResultInd hddTriggerBatchScanResultInd;
987 /*Batched scan reponse queue: new batch scan results added at the tail
988 and old batch scan results are deleted from head*/
989 tHddBatchScanRsp *pBatchScanRsp;
990 /*No of scans in batch scan rsp(MSCAN)*/
991 v_U32_t numScanList;
992 /*isTruncated = 1 batch scan rsp is truncated
993 isTruncated = 0 batch scan rsp is complete*/
994 v_BOOL_t isTruncated;
995 /*Wait for get batch scan response from FW or not*/
996 volatile v_BOOL_t hdd_wait_for_get_batch_scan_rsp;
997 /*Wait for set batch scan response from FW or not*/
998 volatile v_BOOL_t hdd_wait_for_set_batch_scan_rsp;
999 /*Previous batch scan ID*/
1000 v_U32_t prev_batch_id;
Rajeev Kumar20140c12013-10-21 19:39:02 -07001001 /*Batch scan state*/
1002 eHDD_BATCH_SCAN_STATE batchScanState;
Rajeev79dbe4c2013-10-05 11:03:42 +05301003#endif
1004
Srinivas Girigowda5cecb202013-10-08 09:13:25 -07001005#if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD)
1006 tAniTrafStrmMetrics tsmStats;
1007#endif
Kiet Lamf040f472013-11-20 21:15:23 +05301008 /* Flag to ensure PSB is configured through framework */
1009 v_U8_t psbChanged;
1010 /* UAPSD psb value configured through framework */
1011 v_U8_t configuredPsb;
Jeff Johnson295189b2012-06-20 16:38:30 -07001012};
1013
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -08001014#define WLAN_HDD_GET_STATION_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.station)
1015#define WLAN_HDD_GET_AP_CTX_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap)
1016#define WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.station.WextState)
1017#define WLAN_HDD_GET_CTX(pAdapter) ((hdd_context_t*)pAdapter->pHddCtx)
1018#define WLAN_HDD_GET_HAL_CTX(pAdapter) (((hdd_context_t*)(pAdapter->pHddCtx))->hHal)
1019#define WLAN_HDD_GET_HOSTAP_STATE_PTR(pAdapter) (&(pAdapter)->sessionCtx.ap.HostapdState)
1020#define WLAN_HDD_GET_CFG_STATE_PTR(pAdapter) (&(pAdapter)->cfg80211State)
Gopichand Nakkala4327a152013-03-04 23:22:42 -08001021#ifdef FEATURE_WLAN_TDLS
Madan Mohan Koyyalamudi81746922013-07-17 14:38:51 +05301022#define WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter) \
Gopichand Nakkala40ab2752013-04-04 20:11:36 +05301023 (((WLAN_HDD_INFRA_STATION != pAdapter->device_mode) && \
Madan Mohan Koyyalamudi81746922013-07-17 14:38:51 +05301024 (WLAN_HDD_P2P_CLIENT != pAdapter->device_mode)) ? 0 : 1)
1025#define WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter) \
1026 ((WLAN_HDD_IS_TDLS_SUPPORTED_ADAPTER(pAdapter)) ? \
1027 (tdlsCtx_t*)(pAdapter)->sessionCtx.station.pHddTdlsCtx : NULL)
Gopichand Nakkala4327a152013-03-04 23:22:42 -08001028#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001029
1030typedef struct hdd_adapter_list_node
1031{
1032 hdd_list_node_t node; // MUST be first element
1033 hdd_adapter_t *pAdapter;
1034}hdd_adapter_list_node_t;
1035
1036typedef struct hdd_priv_data_s
1037{
1038 tANI_U8 *buf;
1039 int used_len;
1040 int total_len;
1041}hdd_priv_data_t;
1042
Leo Chang64d68bc2013-06-04 15:40:52 -07001043typedef struct
1044{
1045 vos_timer_t trafficTimer;
1046 atomic_t isActiveMode;
1047 v_U8_t isInitialized;
1048 vos_lock_t trafficLock;
1049 v_TIME_t lastFrameTs;
1050}hdd_traffic_monitor_t;
1051
Jeff Johnson295189b2012-06-20 16:38:30 -07001052/** Adapter stucture definition */
1053
1054struct hdd_context_s
1055{
1056 /** Global VOS context */
1057 v_CONTEXT_t pvosContext;
1058
1059 /** HAL handle...*/
1060 tHalHandle hHal;
1061
Jeff Johnson295189b2012-06-20 16:38:30 -07001062 struct wiphy *wiphy ;
Jeff Johnson295189b2012-06-20 16:38:30 -07001063 //TODO Remove this from here.
1064
1065 hdd_list_t hddAdapters; //List of adapters
1066 /* One per STA: 1 for RX_BCMC_STA_ID and 1 for SAP_SELF_STA_ID*/
1067 hdd_adapter_t *sta_to_adapter[WLAN_MAX_STA_COUNT + 3]; //One per sta. For quick reference.
1068
1069 /** Pointer for firmware image data */
1070 const struct firmware *fw;
1071
1072 /** Pointer for configuration data */
1073 const struct firmware *cfg;
1074
1075 /** Pointer for nv data */
1076 const struct firmware *nv;
1077
1078 /** Pointer to the parent device */
1079 struct device *parent_dev;
1080
1081 pid_t pid_sdio_claimed;
1082 atomic_t sdio_claim_count;
1083
1084 /** Config values read from qcom_cfg.ini file */
1085 hdd_config_t *cfg_ini;
Jeff Johnson295189b2012-06-20 16:38:30 -07001086 wlan_hdd_ftm_status_t ftm;
Jeff Johnson295189b2012-06-20 16:38:30 -07001087 /** completion variable for full power callback */
1088 struct completion full_pwr_comp_var;
1089 /** completion variable for Request BMPS callback */
1090 struct completion req_bmps_comp_var;
1091
1092 /** completion variable for standby callback */
1093 struct completion standby_comp_var;
1094
Jeff Johnson295189b2012-06-20 16:38:30 -07001095 /* Completion variable to indicate Rx Thread Suspended */
1096 struct completion rx_sus_event_var;
Jeff Johnson295189b2012-06-20 16:38:30 -07001097
1098 /* Completion variable to indicate Tx Thread Suspended */
1099 struct completion tx_sus_event_var;
1100
1101 /* Completion variable to indicate Mc Thread Suspended */
1102 struct completion mc_sus_event_var;
1103
Amar Singhalfddc28c2013-09-05 13:03:40 -07001104 /* Completion variable for regulatory hint */
Amar Singhala49cbc52013-10-08 18:37:44 -07001105#ifdef CONFIG_ENABLE_LINUX_REG
Amar Singhalfddc28c2013-09-05 13:03:40 -07001106 struct completion linux_reg_req;
Amar Singhala49cbc52013-10-08 18:37:44 -07001107#else
1108 struct completion driver_crda_req;
1109#endif
Jeff Johnson295189b2012-06-20 16:38:30 -07001110
Kiet Lam46b8e4e2013-11-06 21:49:53 +05301111 /* Completion variable to indicate updation of channel */
1112 struct completion wiphy_channel_update_event;
1113
1114 v_BOOL_t nEnableStrictRegulatoryForFCC;
1115
Jeff Johnson295189b2012-06-20 16:38:30 -07001116 v_BOOL_t isWlanSuspended;
1117
1118 v_BOOL_t isTxThreadSuspended;
1119
1120 v_BOOL_t isMcThreadSuspended;
1121
Jeff Johnson295189b2012-06-20 16:38:30 -07001122 v_BOOL_t isRxThreadSuspended;
Jeff Johnson295189b2012-06-20 16:38:30 -07001123
1124 volatile v_BOOL_t isLogpInProgress;
1125
1126 v_BOOL_t isLoadUnloadInProgress;
1127
1128 /**Track whether driver has been suspended.*/
1129 hdd_ps_state_t hdd_ps_state;
1130
1131 /* Track whether Mcast/Bcast Filter is enabled.*/
1132 v_BOOL_t hdd_mcastbcast_filter_set;
1133
1134 /* Track whether ignore DTIM is enabled*/
1135 v_BOOL_t hdd_ignore_dtim_enabled;
1136 v_U32_t hdd_actual_ignore_DTIM_value;
1137 v_U32_t hdd_actual_LI_value;
1138
1139
1140 v_BOOL_t hdd_wlan_suspended;
1141
1142 spinlock_t filter_lock;
1143
1144 /* Lock to avoid race condtion during start/stop bss*/
1145 struct mutex sap_lock;
1146
1147 /** ptt Process ID*/
1148 v_SINT_t ptt_pid;
Leo Chang9e646082013-08-02 11:20:21 -07001149#ifdef WLAN_KD_READY_NOTIFIER
1150 v_BOOL_t kd_nl_init;
1151#endif /* WLAN_KD_READY_NOTIFIER */
Jeff Johnson295189b2012-06-20 16:38:30 -07001152 v_U8_t change_iface;
1153
1154 /** Concurrency Parameters*/
1155 tVOS_CONCURRENCY_MODE concurrency_mode;
1156
Yue Ma3ede6052013-08-29 00:33:26 -07001157 v_U16_t no_of_sessions[VOS_MAX_NO_OF_MODE + 1];
Jeff Johnson295189b2012-06-20 16:38:30 -07001158
1159 hdd_chip_reset_stats_t hddChipResetStats;
1160 /* Number of times riva restarted */
1161 v_U32_t hddRivaResetStats;
1162
Jeff Johnson295189b2012-06-20 16:38:30 -07001163 /* Can we allow AMP connection right now*/
1164 v_BOOL_t isAmpAllowed;
1165
Jeff Johnson295189b2012-06-20 16:38:30 -07001166 /** P2P Device MAC Address for the adapter */
1167 v_MACADDR_t p2pDeviceAddress;
Jeff Johnson295189b2012-06-20 16:38:30 -07001168
1169 /* Thermal mitigation information */
1170 hdd_thermal_mitigation_info_t tmInfo;
Jeff Johnsone7245742012-09-05 17:12:55 -07001171
Sameer Thalappil50dc0092013-02-19 17:23:33 -08001172#ifdef WLAN_OPEN_SOURCE
Jeff Johnsone7245742012-09-05 17:12:55 -07001173#ifdef WLAN_FEATURE_HOLD_RX_WAKELOCK
1174 struct wake_lock rx_wake_lock;
1175#endif
Sameer Thalappil50dc0092013-02-19 17:23:33 -08001176#endif
Jeff Johnsone7245742012-09-05 17:12:55 -07001177
1178 /*
1179 * Framework initiated driver restarting
1180 * hdd_reload_timer : Restart retry timer
1181 * isRestartInProgress: Restart in progress
1182 * hdd_restart_retries: Restart retries
1183 *
1184 */
1185 vos_timer_t hdd_restart_timer;
1186 atomic_t isRestartInProgress;
1187 u_int8_t hdd_restart_retries;
1188
Madan Mohan Koyyalamudi2a1ba772012-10-11 14:59:06 -07001189 hdd_scaninfo_t scan_info;
Gopichand Nakkalaf7e53c52013-01-07 14:52:52 -08001190
Madan Mohan Koyyalamudi543172b2012-12-05 16:40:18 -08001191 /*is_dyanmic_channel_range_set is set to 1 when Softap_set_channel_range
Gopichand Nakkalaf7e53c52013-01-07 14:52:52 -08001192 is invoked*/
Madan Mohan Koyyalamudi543172b2012-12-05 16:40:18 -08001193 v_BOOL_t is_dynamic_channel_range_set;
Madan Mohan Koyyalamudi69fc3ad2012-11-28 16:04:56 -08001194
Gopichand Nakkala1bc04f12013-02-28 14:29:23 -08001195#ifdef WLAN_OPEN_SOURCE
Madan Mohan Koyyalamudi69fc3ad2012-11-28 16:04:56 -08001196 struct wake_lock sap_wake_lock;
Gopichand Nakkala1bc04f12013-02-28 14:29:23 -08001197#endif
Chilam Ng01120412013-02-19 18:32:21 -08001198
1199#ifdef FEATURE_WLAN_TDLS
1200 eTDLSSupportMode tdls_mode;
Hoonki Lee27511902013-03-14 18:19:06 -07001201 eTDLSSupportMode tdls_mode_last;
Gopichand Nakkala4327a152013-03-04 23:22:42 -08001202 tdlsConnInfo_t tdlsConnInfo[HDD_MAX_NUM_TDLS_STA];
1203 /* TDLS peer connected count */
1204 tANI_U16 connected_peer_count;
Hoonki Lee93e67ff2013-03-19 15:49:25 -07001205 tdls_scan_context_t tdls_scan_ctxt;
Sunil Dutt41de4e22013-11-14 18:09:02 +05301206 /* Lock to avoid race condition during TDLS operations*/
1207 struct mutex tdls_lock;
Sameer Thalappil50dc0092013-02-19 17:23:33 -08001208#endif
Madan Mohan Koyyalamudi2602b202013-08-29 01:15:12 +05301209
Leo Chang64d68bc2013-06-04 15:40:52 -07001210 hdd_traffic_monitor_t traffic_monitor;
Gopichand Nakkalab8f0f1a2013-05-23 18:19:48 +05301211
1212 /* MC/BC Filter state variable
1213 * This always contains the value that is currently
1214 * configured
1215 * */
1216 v_U8_t configuredMcastBcastFilter;
Gopichand Nakkala8c0386c2013-07-09 23:31:37 +05301217
Amar Singhal49fdfd52013-08-13 13:25:12 -07001218 v_U8_t sus_res_mcastbcast_filter;
Yue Ma0d4891e2013-08-06 17:01:45 -07001219
Amar Singhald53568e2013-09-26 11:03:45 -07001220 v_BOOL_t sus_res_mcastbcast_filter_valid;
1221
Yue Ma0d4891e2013-08-06 17:01:45 -07001222 /* debugfs entry */
1223 struct dentry *debugfs_phy;
Kamath Vinayak4000c9a2013-08-23 14:24:27 +05301224
1225 /* Use below lock to protect access to isSchedScanUpdatePending
1226 * since it will be accessed in two different contexts.
1227 */
1228 spinlock_t schedScan_lock;
1229
1230 // Flag keeps track of wiphy suspend/resume
1231 v_BOOL_t isWiphySuspended;
1232
1233 // Indicates about pending sched_scan results
1234 v_BOOL_t isSchedScanUpdatePending;
Sudhir Sattayappa Kohalli37620692013-08-05 14:02:26 -07001235 /*
1236 * TX_rx_pkt_count_timer
1237 */
1238 vos_timer_t tx_rx_trafficTmr;
1239 v_U8_t drvr_miracast;
1240 v_U8_t issplitscan_enabled;
Tushnim Bhattacharyya71ccecc2013-10-14 16:22:56 -07001241
1242 /* VHT80 allowed*/
1243 v_BOOL_t isVHT80Allowed;
1244
Leo Chang0b0e45a2013-12-15 15:18:55 -08001245#ifdef FEATURE_WLAN_CH_AVOID
1246 v_U16_t unsafeChannelCount;
1247 v_U16_t unsafeChannelList[NUM_20MHZ_RF_CHANNELS];
1248 v_U16_t safeChannelList[NUM_20MHZ_RF_CHANNELS];
1249#endif /* FEATURE_WLAN_CH_AVOID */
c_hpothu9b781ba2013-12-30 20:57:45 +05301250
1251 v_BOOL_t btCoexModeSet;
Jeff Johnson295189b2012-06-20 16:38:30 -07001252};
1253
1254
1255
1256/*---------------------------------------------------------------------------
1257 Function declarations and documenation
1258 -------------------------------------------------------------------------*/
1259VOS_STATUS hdd_get_front_adapter( hdd_context_t *pHddCtx,
1260 hdd_adapter_list_node_t** ppAdapterNode);
1261
1262VOS_STATUS hdd_get_next_adapter( hdd_context_t *pHddCtx,
1263 hdd_adapter_list_node_t* pAdapterNode,
1264 hdd_adapter_list_node_t** pNextAdapterNode);
1265
1266VOS_STATUS hdd_remove_adapter( hdd_context_t *pHddCtx,
1267 hdd_adapter_list_node_t* pAdapterNode);
1268
1269VOS_STATUS hdd_remove_front_adapter( hdd_context_t *pHddCtx,
1270 hdd_adapter_list_node_t** ppAdapterNode);
1271
1272VOS_STATUS hdd_add_adapter_back( hdd_context_t *pHddCtx,
1273 hdd_adapter_list_node_t* pAdapterNode);
1274
1275VOS_STATUS hdd_add_adapter_front( hdd_context_t *pHddCtx,
1276 hdd_adapter_list_node_t* pAdapterNode);
1277
1278hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type,
Jeff Johnsoneed415b2013-01-18 16:11:20 -08001279 const char* name, tSirMacAddr macAddr,
1280 tANI_U8 rtnl_held );
Jeff Johnson295189b2012-06-20 16:38:30 -07001281VOS_STATUS hdd_close_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter, tANI_U8 rtnl_held );
1282VOS_STATUS hdd_close_all_adapters( hdd_context_t *pHddCtx );
1283VOS_STATUS hdd_stop_all_adapters( hdd_context_t *pHddCtx );
1284VOS_STATUS hdd_reset_all_adapters( hdd_context_t *pHddCtx );
1285VOS_STATUS hdd_start_all_adapters( hdd_context_t *pHddCtx );
1286VOS_STATUS hdd_reconnect_all_adapters( hdd_context_t *pHddCtx );
Sudhir Sattayappa Kohalli90e4c752013-03-21 14:25:04 -07001287void hdd_dump_concurrency_info(hdd_context_t *pHddCtx);
Jeff Johnson295189b2012-06-20 16:38:30 -07001288hdd_adapter_t * hdd_get_adapter_by_name( hdd_context_t *pHddCtx, tANI_U8 *name );
1289hdd_adapter_t * hdd_get_adapter_by_macaddr( hdd_context_t *pHddCtx, tSirMacAddr macAddr );
1290hdd_adapter_t * hdd_get_mon_adapter( hdd_context_t *pHddCtx );
1291VOS_STATUS hdd_init_station_mode( hdd_adapter_t *pAdapter );
1292hdd_adapter_t * hdd_get_adapter( hdd_context_t *pHddCtx, device_mode_t mode );
1293void hdd_deinit_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter );
1294VOS_STATUS hdd_stop_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter );
1295void hdd_set_station_ops( struct net_device *pWlanDev );
1296tANI_U8* wlan_hdd_get_intf_addr(hdd_context_t* pHddCtx);
1297void wlan_hdd_release_intf_addr(hdd_context_t* pHddCtx, tANI_U8* releaseAddr);
1298v_U8_t hdd_get_operating_channel( hdd_context_t *pHddCtx, device_mode_t mode );
1299
Jeff Johnson295189b2012-06-20 16:38:30 -07001300void hdd_set_conparam ( v_UINT_t newParam );
1301tVOS_CON_MODE hdd_get_conparam( void );
Jeff Johnson295189b2012-06-20 16:38:30 -07001302
1303void wlan_hdd_enable_deepsleep(v_VOID_t * pVosContext);
1304v_BOOL_t hdd_is_apps_power_collapse_allowed(hdd_context_t* pHddCtx);
Madan Mohan Koyyalamudic72a4d62012-11-08 14:59:34 -08001305v_BOOL_t hdd_is_suspend_notify_allowed(hdd_context_t* pHddCtx);
Madan Mohan Koyyalamudiff3a7152013-06-13 14:47:55 +05301306void hdd_abort_mac_scan(hdd_context_t *pHddCtx, tANI_U8 sessionId);
Jeff Johnson295189b2012-06-20 16:38:30 -07001307void wlan_hdd_set_monitor_tx_adapter( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter );
1308void hdd_cleanup_actionframe( hdd_context_t *pHddCtx, hdd_adapter_t *pAdapter );
Amar Singhalfddc28c2013-09-05 13:03:40 -07001309
Yunsen Wange3ba1fb2013-04-05 15:04:43 -07001310void crda_regulatory_entry_default(v_U8_t *countryCode, int domain_id);
Jeff Johnson295189b2012-06-20 16:38:30 -07001311void wlan_hdd_set_concurrency_mode(hdd_context_t *pHddCtx, tVOS_CON_MODE mode);
1312void wlan_hdd_clear_concurrency_mode(hdd_context_t *pHddCtx, tVOS_CON_MODE mode);
1313void wlan_hdd_reset_prob_rspies(hdd_adapter_t* pHostapdAdapter);
1314void hdd_prevent_suspend(void);
1315void hdd_allow_suspend(void);
Madan Mohan Koyyalamudi10d83a92012-09-28 15:47:05 -07001316void hdd_allow_suspend_timeout(v_U32_t timeout);
Madan Mohan Koyyalamudib5da5332012-10-15 17:23:21 -07001317bool hdd_is_ssr_required(void);
1318void hdd_set_ssr_required(e_hdd_ssr_required value);
Jeff Johnson295189b2012-06-20 16:38:30 -07001319
1320VOS_STATUS hdd_enable_bmps_imps(hdd_context_t *pHddCtx);
1321VOS_STATUS hdd_disable_bmps_imps(hdd_context_t *pHddCtx, tANI_U8 session_type);
1322
Madan Mohan Koyyalamudi71278262013-04-12 22:00:48 +05301323void wlan_hdd_cfg80211_update_reg_info(struct wiphy *wiphy);
Jeff Johnsone7245742012-09-05 17:12:55 -07001324VOS_STATUS wlan_hdd_restart_driver(hdd_context_t *pHddCtx);
Madan Mohan Koyyalamudi8612ec92012-09-28 15:53:07 -07001325void hdd_exchange_version_and_caps(hdd_context_t *pHddCtx);
Tushnim Bhattacharyya3a37def2013-02-24 11:11:15 -08001326void hdd_set_pwrparams(hdd_context_t *pHddCtx);
1327void hdd_reset_pwrparams(hdd_context_t *pHddCtx);
Gopichand Nakkalaf502e2b2013-05-24 18:34:25 +05301328int wlan_hdd_validate_context(hdd_context_t *pHddCtx);
Srinivas Girigowda0c69aee2013-10-09 17:21:01 -07001329v_BOOL_t hdd_is_valid_mac_address(const tANI_U8* pMacAddr);
Sudhir Sattayappa Kohallib1d8c3a2013-06-18 14:47:20 -07001330VOS_STATUS hdd_issta_p2p_clientconnected(hdd_context_t *pHddCtx);
Vinay Krishna Eranna4d055d42013-12-17 17:02:01 +05301331void hdd_ipv4_notifier_work_queue(struct work_struct *work);
Gopichand Nakkala227c7f32013-06-26 22:44:57 +05301332#ifdef WLAN_FEATURE_PACKET_FILTERING
1333int wlan_hdd_setIPv6Filter(hdd_context_t *pHddCtx, tANI_U8 filterType, tANI_U8 sessionId);
1334#endif
Vinay Krishna Erannad5b2be22013-12-01 17:00:15 +05301335
1336#ifdef WLAN_NS_OFFLOAD
1337void hdd_ipv6_notifier_work_queue(struct work_struct *work);
1338#endif
1339
Tushnim Bhattacharyya71ccecc2013-10-14 16:22:56 -07001340#ifdef CONFIG_ENABLE_LINUX_REG
1341void hdd_checkandupdate_phymode( hdd_context_t *pHddCtx);
1342#endif
Kiet Lamf040f472013-11-20 21:15:23 +05301343int hdd_wmmps_helper(hdd_adapter_t *pAdapter, tANI_U8 *ptr);
Rajeev Kumar8b373292014-01-08 20:36:55 -08001344
1345#ifdef FEATURE_WLAN_BATCH_SCAN
1346/**---------------------------------------------------------------------------
1347
1348 \brief hdd_handle_batch_scan_ioctl () - This function handles WLS_BATCHING
1349 IOCTLs from user space. Following BATCH SCAN DEV IOCTs are handled:
1350 WLS_BATCHING VERSION
1351 WLS_BATCHING SET
1352 WLS_BATCHING GET
1353 WLS_BATCHING STOP
1354
1355 \param - pAdapter Pointer to HDD adapter
1356 \param - pPrivdata Pointer to priv_data
1357 \param - command Pointer to command
1358
1359 \return - 0 for success -EFAULT for failure
1360
1361 --------------------------------------------------------------------------*/
1362
1363int hdd_handle_batch_scan_ioctl
1364(
1365 hdd_adapter_t *pAdapter,
1366 hdd_priv_data_t *pPrivdata,
1367 tANI_U8 *command
1368);
1369#endif /*End of FEATURE_WLAN_BATCH_SCAN*/
1370
Jeff Johnson295189b2012-06-20 16:38:30 -07001371#endif // end #if !defined( WLAN_HDD_MAIN_H )