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