blob: d96e66d4cdb73abbd83db397b239fab519960942 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam842dad02014-02-18 18:44:02 -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
22/*
Kiet Lama7f454d2014-07-24 12:04:06 -070023 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -080026 */
Kiet Lam842dad02014-02-18 18:44:02 -080027
28
Kiet Lama7f454d2014-07-24 12:04:06 -070029
30
Jeff Johnson295189b2012-06-20 16:38:30 -070031#if !defined( HDD_CONNECTION_H__ )
Gopichand Nakkala66923aa2013-03-06 23:17:24 +053032#define HDD_CONNECTION_H__
Jeff Johnson295189b2012-06-20 16:38:30 -070033#include <wlan_hdd_mib.h>
Ravi Joshiaa81ca22013-06-25 17:20:52 -070034#define HDD_MAX_NUM_IBSS_STA ( 32 )
Mohit Khanna698ba2a2012-12-04 15:08:18 -080035#ifdef FEATURE_WLAN_TDLS
Madan Mohan Koyyalamudi7d5eed32013-08-05 13:13:14 +053036#define HDD_MAX_NUM_TDLS_STA ( 8 )
Gopichand Nakkala2f4a2822013-04-17 11:22:01 -070037#define TDLS_STA_INDEX_VALID(staId) \
Masti, Narayanraddi975a9272015-05-19 11:11:43 +053038 (((staId) >= 3) && ((staId) < 0xFF))
Mohit Khanna698ba2a2012-12-04 15:08:18 -080039#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070040#define TKIP_COUNTER_MEASURE_STARTED 1
41#define TKIP_COUNTER_MEASURE_STOPED 0
42/* Timeout (in ms) for Link to Up before Registering Station */
43#define ASSOC_LINKUP_TIMEOUT 60
Ravi Joshife5e1162013-06-17 18:24:34 -070044#define IBSS_BROADCAST_STAID 0
Jeff Johnson295189b2012-06-20 16:38:30 -070045typedef enum
46{
47 /** Not associated in Infra or participating in an IBSS / Ad-hoc network.*/
48 eConnectionState_NotConnected,
Madan Mohan Koyyalamudifd4e1da2012-11-09 17:50:19 -080049
50 /** While connection in progress */
51 eConnectionState_Connecting,
52
Jeff Johnson295189b2012-06-20 16:38:30 -070053 /** Associated in an Infrastructure network.*/
54 eConnectionState_Associated,
55
56 /** Participating in an IBSS network though disconnected (no partner stations
57 in the IBSS).*/
58 eConnectionState_IbssDisconnected,
59
60 /** Participating in an IBSS network with partner stations also present*/
Jeff Johnsone7245742012-09-05 17:12:55 -070061 eConnectionState_IbssConnected,
Jeff Johnson295189b2012-06-20 16:38:30 -070062
Jeff Johnsone7245742012-09-05 17:12:55 -070063 /** Disconnecting in an Infrastructure network.*/
64 eConnectionState_Disconnecting
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -070065
Jeff Johnson295189b2012-06-20 16:38:30 -070066}eConnectionState;
67/**This structure stores the connection information */
68typedef struct connection_info_s
69{
70 /** connection state of the NIC.*/
71 eConnectionState connState;
72
73 /** BSS type of the current connection. Comes from the MIB at the
74 time the connect request is issued in combination with the BssDescription
75 from the associated entity.*/
76
77 eMib_dot11DesiredBssType connDot11DesiredBssType;
78 /** BSSID */
79 tCsrBssid bssId;
80
81 /** SSID Info*/
82 tCsrSSIDInfo SSID;
83
84 /** Station ID */
85 v_U8_t staId[ HDD_MAX_NUM_IBSS_STA ];
86 /** Peer Mac Address of the IBSS Stations */
87 v_MACADDR_t peerMacAddress[ HDD_MAX_NUM_IBSS_STA ];
88 /** Auth Type */
89 eCsrAuthType authType;
90
91 /** Unicast Encryption Type */
92 eCsrEncryptionType ucEncryptionType;
93
94 /** Multicast Encryption Type */
95 eCsrEncryptionType mcEncryptionType;
96
97 /** Keys */
98 tCsrKeys Keys;
99
100 /** Operation Channel */
101 v_U8_t operationChannel;
102
103 /** Remembers authenticated state */
104 v_U8_t uIsAuthenticated;
Gopichand Nakkaladacbcb52013-04-18 16:41:54 +0530105
106 /** Dot11Mode */
107 tANI_U32 dot11Mode;
Deepthi Gowriae6a1662015-10-12 12:59:37 +0530108
109 uint32_t rate_flags;
Jeff Johnson295189b2012-06-20 16:38:30 -0700110
111}connection_info_t;
112/*Forward declaration of Adapter*/
113typedef struct hdd_adapter_s hdd_adapter_t;
114typedef struct hdd_context_s hdd_context_t;
115typedef struct hdd_station_ctx hdd_station_ctx_t;
116typedef struct hdd_ap_ctx_s hdd_ap_ctx_t;
Jeff Johnson295189b2012-06-20 16:38:30 -0700117typedef struct hdd_mon_ctx_s hdd_mon_ctx_t;
Jeff Johnson295189b2012-06-20 16:38:30 -0700118
119
120extern v_BOOL_t hdd_connIsConnected( hdd_station_ctx_t *pHddStaCtx );
Agarwal Ashish450ffde2014-04-08 19:53:00 +0530121eCsrBand hdd_connGetConnectedBand( hdd_station_ctx_t *pHddStaCtx );
Jeff Johnson295189b2012-06-20 16:38:30 -0700122extern eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, v_U32_t roamId,
123 eRoamCmdStatus roamStatus, eCsrRoamResult roamResult );
124
125extern v_VOID_t hdd_connSaveConnectInfo( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, eCsrRoamBssType eBssType );
126
Jeff Johnson51019dc2013-02-21 16:44:09 -0800127v_BOOL_t hdd_connGetConnectedBssType( hdd_station_ctx_t *pHddCtx,
Jeff Johnson295189b2012-06-20 16:38:30 -0700128 eMib_dot11DesiredBssType *pConnectedBssType );
129
130int hdd_SetGENIEToCsr( hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType );
131
132int hdd_set_csr_auth_type( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType );
Hoonki Lee11f7dda2013-02-14 16:55:44 -0800133VOS_STATUS hdd_roamRegisterTDLSSTA( hdd_adapter_t *pAdapter,
Anand N Sunkad9bfc2622015-07-30 15:18:54 +0530134#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))
135 const tANI_U8 *peerMac,
136#else
137 tANI_U8 *peerMac,
138#endif
139 tANI_U16 staId, tANI_U8 ucastSig);
Gopichand Nakkala3d295922013-05-07 16:19:14 +0530140void hdd_PerformRoamSetKeyComplete(hdd_adapter_t *pAdapter);
Masti, Narayanraddi1fb32a92015-06-29 13:14:06 +0530141VOS_STATUS hdd_roamDeregisterTDLSSTA(hdd_adapter_t *pAdapter, tANI_U8 staId);
Srinivas Girigowda0c6d7fe2014-05-28 18:18:10 -0700142
143#if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD)
144void hdd_indicateEseBcnReportNoResults(const hdd_adapter_t *pAdapter,
145 const tANI_U16 measurementToken,
146 const tANI_BOOLEAN flag,
147 const tANI_U8 numBss);
148#endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */
149
Jeff Johnson295189b2012-06-20 16:38:30 -0700150#endif