blob: f6aac61c0c56045f312e4232d6da1b0b451d4b29 [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( HDD_CONNECTION_H__ )
Gopichand Nakkala66923aa2013-03-06 23:17:24 +053043#define HDD_CONNECTION_H__
Jeff Johnson295189b2012-06-20 16:38:30 -070044#include <wlan_hdd_mib.h>
Gopichand Nakkalac984e032013-02-27 22:24:12 -080045#define HDD_MAX_NUM_IBSS_STA ( 9 )
Mohit Khanna698ba2a2012-12-04 15:08:18 -080046#ifdef FEATURE_WLAN_TDLS
Gopichand Nakkalab977a972013-02-18 19:15:09 -080047#define HDD_MAX_NUM_TDLS_STA ( HDD_MAX_NUM_IBSS_STA - 1 ) // up to 3 as 1 is assigned to AP
Gopichand Nakkala2f4a2822013-04-17 11:22:01 -070048#define TDLS_STA_INDEX_VALID(staId) \
49 (((staId) >= 4) && ((staId) < 0xFF))
Mohit Khanna698ba2a2012-12-04 15:08:18 -080050#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070051#define TKIP_COUNTER_MEASURE_STARTED 1
52#define TKIP_COUNTER_MEASURE_STOPED 0
53/* Timeout (in ms) for Link to Up before Registering Station */
54#define ASSOC_LINKUP_TIMEOUT 60
Shailender Karmuchia734f332013-04-19 14:02:48 -070055#define IBSS_BROADCAST_STAID 1
Jeff Johnson295189b2012-06-20 16:38:30 -070056typedef enum
57{
58 /** Not associated in Infra or participating in an IBSS / Ad-hoc network.*/
59 eConnectionState_NotConnected,
Madan Mohan Koyyalamudifd4e1da2012-11-09 17:50:19 -080060
61 /** While connection in progress */
62 eConnectionState_Connecting,
63
Jeff Johnson295189b2012-06-20 16:38:30 -070064 /** Associated in an Infrastructure network.*/
65 eConnectionState_Associated,
66
67 /** Participating in an IBSS network though disconnected (no partner stations
68 in the IBSS).*/
69 eConnectionState_IbssDisconnected,
70
71 /** Participating in an IBSS network with partner stations also present*/
Jeff Johnsone7245742012-09-05 17:12:55 -070072 eConnectionState_IbssConnected,
Jeff Johnson295189b2012-06-20 16:38:30 -070073
Jeff Johnsone7245742012-09-05 17:12:55 -070074 /** Disconnecting in an Infrastructure network.*/
75 eConnectionState_Disconnecting
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -070076
Jeff Johnson295189b2012-06-20 16:38:30 -070077}eConnectionState;
78/**This structure stores the connection information */
79typedef struct connection_info_s
80{
81 /** connection state of the NIC.*/
82 eConnectionState connState;
83
84 /** BSS type of the current connection. Comes from the MIB at the
85 time the connect request is issued in combination with the BssDescription
86 from the associated entity.*/
87
88 eMib_dot11DesiredBssType connDot11DesiredBssType;
89 /** BSSID */
90 tCsrBssid bssId;
91
92 /** SSID Info*/
93 tCsrSSIDInfo SSID;
94
95 /** Station ID */
96 v_U8_t staId[ HDD_MAX_NUM_IBSS_STA ];
97 /** Peer Mac Address of the IBSS Stations */
98 v_MACADDR_t peerMacAddress[ HDD_MAX_NUM_IBSS_STA ];
99 /** Auth Type */
100 eCsrAuthType authType;
101
102 /** Unicast Encryption Type */
103 eCsrEncryptionType ucEncryptionType;
104
105 /** Multicast Encryption Type */
106 eCsrEncryptionType mcEncryptionType;
107
108 /** Keys */
109 tCsrKeys Keys;
110
111 /** Operation Channel */
112 v_U8_t operationChannel;
113
114 /** Remembers authenticated state */
115 v_U8_t uIsAuthenticated;
Gopichand Nakkalad86a14e2013-04-18 16:41:54 +0530116
117 /** Dot11Mode */
118 tANI_U32 dot11Mode;
Jeff Johnson295189b2012-06-20 16:38:30 -0700119
120}connection_info_t;
121/*Forward declaration of Adapter*/
122typedef struct hdd_adapter_s hdd_adapter_t;
123typedef struct hdd_context_s hdd_context_t;
124typedef struct hdd_station_ctx hdd_station_ctx_t;
125typedef struct hdd_ap_ctx_s hdd_ap_ctx_t;
Jeff Johnson295189b2012-06-20 16:38:30 -0700126typedef struct hdd_mon_ctx_s hdd_mon_ctx_t;
Jeff Johnson295189b2012-06-20 16:38:30 -0700127
128
129extern v_BOOL_t hdd_connIsConnected( hdd_station_ctx_t *pHddStaCtx );
130extern eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, v_U32_t roamId,
131 eRoamCmdStatus roamStatus, eCsrRoamResult roamResult );
132
133extern v_VOID_t hdd_connSaveConnectInfo( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, eCsrRoamBssType eBssType );
134
Jeff Johnson51019dc2013-02-21 16:44:09 -0800135v_BOOL_t hdd_connGetConnectedBssType( hdd_station_ctx_t *pHddCtx,
Jeff Johnson295189b2012-06-20 16:38:30 -0700136 eMib_dot11DesiredBssType *pConnectedBssType );
137
138int hdd_SetGENIEToCsr( hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType );
139
140int hdd_set_csr_auth_type( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType );
Hoonki Lee11f7dda2013-02-14 16:55:44 -0800141VOS_STATUS hdd_roamRegisterTDLSSTA( hdd_adapter_t *pAdapter,
142 tANI_U8 *peerMac, tANI_U16 staId, tANI_U8 ucastSig);
143
Jeff Johnson295189b2012-06-20 16:38:30 -0700144#endif