Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 2 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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 | |
| 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 Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame^] | 26 | #ifdef FEATURE_WLAN_TDLS |
| 27 | #define HDD_MAX_NUM_TDLS_STA ( 4 ) |
| 28 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 29 | #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 |
| 33 | typedef enum |
| 34 | { |
| 35 | /** Not associated in Infra or participating in an IBSS / Ad-hoc network.*/ |
| 36 | eConnectionState_NotConnected, |
Madan Mohan Koyyalamudi | fd4e1da | 2012-11-09 17:50:19 -0800 | [diff] [blame] | 37 | |
| 38 | /** While connection in progress */ |
| 39 | eConnectionState_Connecting, |
| 40 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 41 | /** 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 Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 49 | eConnectionState_IbssConnected, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 50 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 51 | /** Disconnecting in an Infrastructure network.*/ |
| 52 | eConnectionState_Disconnecting |
Madan Mohan Koyyalamudi | 1bed598 | 2012-10-22 14:38:06 -0700 | [diff] [blame] | 53 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 54 | }eConnectionState; |
| 55 | /**This structure stores the connection information */ |
| 56 | typedef 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*/ |
| 96 | typedef struct hdd_adapter_s hdd_adapter_t; |
| 97 | typedef struct hdd_context_s hdd_context_t; |
| 98 | typedef struct hdd_station_ctx hdd_station_ctx_t; |
| 99 | typedef struct hdd_ap_ctx_s hdd_ap_ctx_t; |
| 100 | #ifdef CONFIG_CFG80211 |
| 101 | typedef struct hdd_mon_ctx_s hdd_mon_ctx_t; |
| 102 | #endif |
| 103 | |
| 104 | |
| 105 | extern v_BOOL_t hdd_connIsConnected( hdd_station_ctx_t *pHddStaCtx ); |
| 106 | extern eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, v_U32_t roamId, |
| 107 | eRoamCmdStatus roamStatus, eCsrRoamResult roamResult ); |
| 108 | |
| 109 | extern v_VOID_t hdd_connSaveConnectInfo( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, eCsrRoamBssType eBssType ); |
| 110 | |
| 111 | inline v_BOOL_t hdd_connGetConnectedBssType( hdd_station_ctx_t *pHddCtx, |
| 112 | eMib_dot11DesiredBssType *pConnectedBssType ); |
| 113 | |
| 114 | int hdd_SetGENIEToCsr( hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType ); |
| 115 | |
| 116 | int hdd_set_csr_auth_type( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType ); |
| 117 | #endif |