blob: 40d0b5c6b0cbe80cd6e061066b1bb22a0013bd57 [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__ )
43#define HDD_CONNECTION_H__
44#include <wlan_hdd_mib.h>
45#define HDD_MAX_NUM_IBSS_STA ( 4 )
Mohit Khanna698ba2a2012-12-04 15:08:18 -080046#ifdef FEATURE_WLAN_TDLS
47#define HDD_MAX_NUM_TDLS_STA ( 4 )
48#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070049#define TKIP_COUNTER_MEASURE_STARTED 1
50#define TKIP_COUNTER_MEASURE_STOPED 0
51/* Timeout (in ms) for Link to Up before Registering Station */
52#define ASSOC_LINKUP_TIMEOUT 60
53typedef enum
54{
55 /** Not associated in Infra or participating in an IBSS / Ad-hoc network.*/
56 eConnectionState_NotConnected,
Madan Mohan Koyyalamudifd4e1da2012-11-09 17:50:19 -080057
58 /** While connection in progress */
59 eConnectionState_Connecting,
60
Jeff Johnson295189b2012-06-20 16:38:30 -070061 /** Associated in an Infrastructure network.*/
62 eConnectionState_Associated,
63
64 /** Participating in an IBSS network though disconnected (no partner stations
65 in the IBSS).*/
66 eConnectionState_IbssDisconnected,
67
68 /** Participating in an IBSS network with partner stations also present*/
Jeff Johnsone7245742012-09-05 17:12:55 -070069 eConnectionState_IbssConnected,
Jeff Johnson295189b2012-06-20 16:38:30 -070070
Jeff Johnsone7245742012-09-05 17:12:55 -070071 /** Disconnecting in an Infrastructure network.*/
72 eConnectionState_Disconnecting
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -070073
Jeff Johnson295189b2012-06-20 16:38:30 -070074}eConnectionState;
75/**This structure stores the connection information */
76typedef struct connection_info_s
77{
78 /** connection state of the NIC.*/
79 eConnectionState connState;
80
81 /** BSS type of the current connection. Comes from the MIB at the
82 time the connect request is issued in combination with the BssDescription
83 from the associated entity.*/
84
85 eMib_dot11DesiredBssType connDot11DesiredBssType;
86 /** BSSID */
87 tCsrBssid bssId;
88
89 /** SSID Info*/
90 tCsrSSIDInfo SSID;
91
92 /** Station ID */
93 v_U8_t staId[ HDD_MAX_NUM_IBSS_STA ];
94 /** Peer Mac Address of the IBSS Stations */
95 v_MACADDR_t peerMacAddress[ HDD_MAX_NUM_IBSS_STA ];
96 /** Auth Type */
97 eCsrAuthType authType;
98
99 /** Unicast Encryption Type */
100 eCsrEncryptionType ucEncryptionType;
101
102 /** Multicast Encryption Type */
103 eCsrEncryptionType mcEncryptionType;
104
105 /** Keys */
106 tCsrKeys Keys;
107
108 /** Operation Channel */
109 v_U8_t operationChannel;
110
111 /** Remembers authenticated state */
112 v_U8_t uIsAuthenticated;
113
114}connection_info_t;
115/*Forward declaration of Adapter*/
116typedef struct hdd_adapter_s hdd_adapter_t;
117typedef struct hdd_context_s hdd_context_t;
118typedef struct hdd_station_ctx hdd_station_ctx_t;
119typedef struct hdd_ap_ctx_s hdd_ap_ctx_t;
120#ifdef CONFIG_CFG80211
121typedef struct hdd_mon_ctx_s hdd_mon_ctx_t;
122#endif
123
124
125extern v_BOOL_t hdd_connIsConnected( hdd_station_ctx_t *pHddStaCtx );
126extern eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, v_U32_t roamId,
127 eRoamCmdStatus roamStatus, eCsrRoamResult roamResult );
128
129extern v_VOID_t hdd_connSaveConnectInfo( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, eCsrRoamBssType eBssType );
130
Jeff Johnson51019dc2013-02-21 16:44:09 -0800131v_BOOL_t hdd_connGetConnectedBssType( hdd_station_ctx_t *pHddCtx,
Jeff Johnson295189b2012-06-20 16:38:30 -0700132 eMib_dot11DesiredBssType *pConnectedBssType );
133
134int hdd_SetGENIEToCsr( hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType );
135
136int hdd_set_csr_auth_type( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType );
Hoonki Lee11f7dda2013-02-14 16:55:44 -0800137VOS_STATUS hdd_roamRegisterTDLSSTA( hdd_adapter_t *pAdapter,
138 tANI_U8 *peerMac, tANI_U16 staId, tANI_U8 ucastSig);
139
Jeff Johnson295189b2012-06-20 16:38:30 -0700140#endif