blob: f3945f61cca07e3984ef4796d16b530d8be187d0 [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,
34 /** Associated in an Infrastructure network.*/
35 eConnectionState_Associated,
36
37 /** Participating in an IBSS network though disconnected (no partner stations
38 in the IBSS).*/
39 eConnectionState_IbssDisconnected,
40
41 /** Participating in an IBSS network with partner stations also present*/
Jeff Johnsone7245742012-09-05 17:12:55 -070042 eConnectionState_IbssConnected,
Jeff Johnson295189b2012-06-20 16:38:30 -070043
Jeff Johnsone7245742012-09-05 17:12:55 -070044 /** Disconnecting in an Infrastructure network.*/
45 eConnectionState_Disconnecting
46
Jeff Johnson295189b2012-06-20 16:38:30 -070047}eConnectionState;
48/**This structure stores the connection information */
49typedef struct connection_info_s
50{
51 /** connection state of the NIC.*/
52 eConnectionState connState;
53
54 /** BSS type of the current connection. Comes from the MIB at the
55 time the connect request is issued in combination with the BssDescription
56 from the associated entity.*/
57
58 eMib_dot11DesiredBssType connDot11DesiredBssType;
59 /** BSSID */
60 tCsrBssid bssId;
61
62 /** SSID Info*/
63 tCsrSSIDInfo SSID;
64
65 /** Station ID */
66 v_U8_t staId[ HDD_MAX_NUM_IBSS_STA ];
67 /** Peer Mac Address of the IBSS Stations */
68 v_MACADDR_t peerMacAddress[ HDD_MAX_NUM_IBSS_STA ];
69 /** Auth Type */
70 eCsrAuthType authType;
71
72 /** Unicast Encryption Type */
73 eCsrEncryptionType ucEncryptionType;
74
75 /** Multicast Encryption Type */
76 eCsrEncryptionType mcEncryptionType;
77
78 /** Keys */
79 tCsrKeys Keys;
80
81 /** Operation Channel */
82 v_U8_t operationChannel;
83
84 /** Remembers authenticated state */
85 v_U8_t uIsAuthenticated;
86
87}connection_info_t;
88/*Forward declaration of Adapter*/
89typedef struct hdd_adapter_s hdd_adapter_t;
90typedef struct hdd_context_s hdd_context_t;
91typedef struct hdd_station_ctx hdd_station_ctx_t;
92typedef struct hdd_ap_ctx_s hdd_ap_ctx_t;
93#ifdef CONFIG_CFG80211
94typedef struct hdd_mon_ctx_s hdd_mon_ctx_t;
95#endif
96
97
98extern v_BOOL_t hdd_connIsConnected( hdd_station_ctx_t *pHddStaCtx );
99extern eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, v_U32_t roamId,
100 eRoamCmdStatus roamStatus, eCsrRoamResult roamResult );
101
102extern v_VOID_t hdd_connSaveConnectInfo( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, eCsrRoamBssType eBssType );
103
104inline v_BOOL_t hdd_connGetConnectedBssType( hdd_station_ctx_t *pHddCtx,
105 eMib_dot11DesiredBssType *pConnectedBssType );
106
107int hdd_SetGENIEToCsr( hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType );
108
109int hdd_set_csr_auth_type( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType );
110#endif