blob: bb8be328746a2cc38088019e806c79868f07cea9 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson32d95a32012-09-10 13:15:23 -07002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -07003 *
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#if !defined( HDD_CONNECTION_H__ )
23#define HDD_CONNECTION_H__
24#include <wlan_hdd_mib.h>
25#define HDD_MAX_NUM_IBSS_STA ( 4 )
Mohit Khanna698ba2a2012-12-04 15:08:18 -080026#ifdef FEATURE_WLAN_TDLS
27#define HDD_MAX_NUM_TDLS_STA ( 4 )
28#endif
Jeff Johnson295189b2012-06-20 16:38:30 -070029#define TKIP_COUNTER_MEASURE_STARTED 1
30#define TKIP_COUNTER_MEASURE_STOPED 0
31/* Timeout (in ms) for Link to Up before Registering Station */
32#define ASSOC_LINKUP_TIMEOUT 60
33typedef enum
34{
35 /** Not associated in Infra or participating in an IBSS / Ad-hoc network.*/
36 eConnectionState_NotConnected,
Madan Mohan Koyyalamudifd4e1da2012-11-09 17:50:19 -080037
38 /** While connection in progress */
39 eConnectionState_Connecting,
40
Jeff Johnson295189b2012-06-20 16:38:30 -070041 /** Associated in an Infrastructure network.*/
42 eConnectionState_Associated,
43
44 /** Participating in an IBSS network though disconnected (no partner stations
45 in the IBSS).*/
46 eConnectionState_IbssDisconnected,
47
48 /** Participating in an IBSS network with partner stations also present*/
Jeff Johnsone7245742012-09-05 17:12:55 -070049 eConnectionState_IbssConnected,
Jeff Johnson295189b2012-06-20 16:38:30 -070050
Jeff Johnsone7245742012-09-05 17:12:55 -070051 /** Disconnecting in an Infrastructure network.*/
52 eConnectionState_Disconnecting
Madan Mohan Koyyalamudi1bed5982012-10-22 14:38:06 -070053
Jeff Johnson295189b2012-06-20 16:38:30 -070054}eConnectionState;
55/**This structure stores the connection information */
56typedef struct connection_info_s
57{
58 /** connection state of the NIC.*/
59 eConnectionState connState;
60
61 /** BSS type of the current connection. Comes from the MIB at the
62 time the connect request is issued in combination with the BssDescription
63 from the associated entity.*/
64
65 eMib_dot11DesiredBssType connDot11DesiredBssType;
66 /** BSSID */
67 tCsrBssid bssId;
68
69 /** SSID Info*/
70 tCsrSSIDInfo SSID;
71
72 /** Station ID */
73 v_U8_t staId[ HDD_MAX_NUM_IBSS_STA ];
74 /** Peer Mac Address of the IBSS Stations */
75 v_MACADDR_t peerMacAddress[ HDD_MAX_NUM_IBSS_STA ];
76 /** Auth Type */
77 eCsrAuthType authType;
78
79 /** Unicast Encryption Type */
80 eCsrEncryptionType ucEncryptionType;
81
82 /** Multicast Encryption Type */
83 eCsrEncryptionType mcEncryptionType;
84
85 /** Keys */
86 tCsrKeys Keys;
87
88 /** Operation Channel */
89 v_U8_t operationChannel;
90
91 /** Remembers authenticated state */
92 v_U8_t uIsAuthenticated;
93
94}connection_info_t;
95/*Forward declaration of Adapter*/
96typedef struct hdd_adapter_s hdd_adapter_t;
97typedef struct hdd_context_s hdd_context_t;
98typedef struct hdd_station_ctx hdd_station_ctx_t;
99typedef struct hdd_ap_ctx_s hdd_ap_ctx_t;
100#ifdef CONFIG_CFG80211
101typedef struct hdd_mon_ctx_s hdd_mon_ctx_t;
102#endif
103
104
105extern v_BOOL_t hdd_connIsConnected( hdd_station_ctx_t *pHddStaCtx );
106extern eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, v_U32_t roamId,
107 eRoamCmdStatus roamStatus, eCsrRoamResult roamResult );
108
109extern v_VOID_t hdd_connSaveConnectInfo( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, eCsrRoamBssType eBssType );
110
111inline v_BOOL_t hdd_connGetConnectedBssType( hdd_station_ctx_t *pHddCtx,
112 eMib_dot11DesiredBssType *pConnectedBssType );
113
114int hdd_SetGENIEToCsr( hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType );
115
116int hdd_set_csr_auth_type( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType );
117#endif