1 /** \file apConnApi.h 2 * \brief AP Connection Module API 3 * 4 * \see apConn.c 5 */ 6 /**************************************************************************** 7 **+-----------------------------------------------------------------------+** 8 **| |** 9 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved. |** 10 **| All rights reserved. |** 11 **| |** 12 **| Redistribution and use in source and binary forms, with or without |** 13 **| modification, are permitted provided that the following conditions |** 14 **| are met: |** 15 **| |** 16 **| * Redistributions of source code must retain the above copyright |** 17 **| notice, this list of conditions and the following disclaimer. |** 18 **| * Redistributions in binary form must reproduce the above copyright |** 19 **| notice, this list of conditions and the following disclaimer in |** 20 **| the documentation and/or other materials provided with the |** 21 **| distribution. |** 22 **| * Neither the name Texas Instruments nor the names of its |** 23 **| contributors may be used to endorse or promote products derived |** 24 **| from this software without specific prior written permission. |** 25 **| |** 26 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |** 27 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |** 28 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |** 29 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |** 30 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |** 31 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |** 32 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |** 33 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |** 34 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |** 35 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |** 36 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |** 37 **| |** 38 **+-----------------------------------------------------------------------+** 39 ****************************************************************************/ 40 41 /**************************************************************************** 42 * * 43 * MODULE: AP Connection * 44 * PURPOSE: AP Connection Module API * 45 * * 46 ****************************************************************************/ 47 48 #ifndef _AP_CONNECTION_API_H_ 49 #define _AP_CONNECTION_API_H_ 50 51 #include "paramOut.h" 52 #include "rsnApi.h" 53 #include "roamingMngrTypes.h" 54 55 /* Constants */ 56 57 #define AP_CONNECT_TRIGGER_IGNORED 0x0 58 59 /* Enumerations */ 60 61 /** 62 * Requests to connect types 63 */ 64 typedef enum 65 { 66 AP_CONNECT_RETAIN_CURR_AP = 0, /**< Give-up on roaming, return to current AP without performing re-connection */ 67 AP_CONNECT_RECONNECT_CURR_AP, /**< Perform roaming - connect to AP, registered as current AP */ 68 AP_CONNECT_FAST_TO_AP, /**< Perform roaming - re-connect to new AP via RE-Assoc, parameters attached */ 69 AP_CONNECT_FULL_TO_AP /**< Perform full connection - connect to new AP via Assoc, parameters attached */ 70 } apConn_connRequest_e; 71 72 /* triggers for Roaming */ 73 typedef enum 74 { 75 ROAMING_TRIGGER_NONE, 76 77 ROAMING_TRIGGER_LOW_QUALITY_FOR_BG_SCAN, 78 ROAMING_TRIGGER_NORMAL_QUALITY_FOR_BG_SCAN, 79 80 ROAMING_TRIGGER_LOW_TX_RATE, 81 ROAMING_TRIGGER_LOW_SNR, 82 ROAMING_TRIGGER_LOW_QUALITY, 83 84 ROAMING_TRIGGER_MAX_TX_RETRIES, 85 ROAMING_TRIGGER_BSS_LOSS, 86 ROAMING_TRIGGER_SWITCH_CHANNEL, 87 88 ROAMING_TRIGGER_AP_DISCONNECT, /* DE_AUTH, DIS_ASSOC*/ 89 ROAMING_TRIGGER_SECURITY_ATTACK, 90 91 ROAMING_TRIGGER_LAST 92 } apConn_roamingTrigger_e; 93 94 typedef enum 95 { 96 CONN_STATUS_CONNECTED, 97 CONN_STATUS_NOT_CONNECTED, 98 CONN_STATUS_HANDOVER_FAILURE, 99 CONN_STATUS_HANDOVER_SUCCESS, 100 CONN_STATUS_LAST 101 } apConn_connStatus_e; 102 103 typedef enum 104 { 105 REG_DOMAIN_FIXED, 106 REG_DOMAIN_80211D, 107 REG_DOMAIN_80211H 108 } REG_DOMAIN_CAPABILITY; 109 /* Typedefs */ 110 111 /** 112 * Roaming Manager callback type 113 */ 114 115 typedef TI_STATUS (*apConn_roamMngrCallb_t) (TI_HANDLE hRoamingMngr, void *pData); 116 117 /* Structures */ 118 119 typedef struct _apConn_staCapabilities_t 120 { 121 /* None, Shared, AutoSwitch, WPA, WPAPSK, WPANone, WPA2, WPA2PSK */ 122 OS_802_11_AUTHENTICATION_MODE authMode; 123 /* None, WEP, TKIP, AES */ 124 OS_802_11_ENCRYPTION_TYPES encryptionType; 125 /* 2.4G, 5G or Dual */ 126 OS_802_11_NETWORK_TYPE networkType; 127 /* An array of 16 octets. Each octet contains a preferred data rate in units of 0.5 Mbps */ 128 OS_802_11_RATES_EX rateMask; 129 /* TRUE - EXC enabled, FALSE - EXC disabled */ 130 BOOL excEnabled; 131 /* TRUE - QOS enabled, FALSE - QOS disabled */ 132 BOOL qosEnabled; 133 /* Fixed, 802.11D, 802.11H */ 134 REG_DOMAIN_CAPABILITY regDomain; 135 } apConn_staCapabilities_t; 136 137 typedef struct _apConn_connStatus_t 138 { 139 apConn_connStatus_e status; /** Reported status of the connection */ 140 UINT32 dataBufLength; /** (Optional) length of attached buffer */ 141 char *dataBuf; /** (Optional) attached buffer - can be used in case of vendor specific IEs in Assoc resp packet */ 142 } apConn_connStatus_t; 143 144 typedef struct _apConn_connRequest_t 145 { 146 apConn_connRequest_e requestType; /** Type of request to establish connection */ 147 UINT32 dataBufLength; /** (Optional) length of attached buffer */ 148 char *dataBuf; /** (Optional) attached buffer - can be used in case of vendor specific IEs in Assoc req packet */ 149 } apConn_connRequest_t; 150 151 /* External data definitions */ 152 153 /* External functions definitions */ 154 155 /* Function prototypes */ 156 157 /* Called by Roaming Manager */ 158 TI_STATUS apConn_setRoamThresholds(TI_HANDLE hAPConnection, roamingMngrThresholdsConfig_t *pParam); 159 TI_STATUS apConn_getRoamThresholds(TI_HANDLE hAPConnection, roamingMngrThresholdsConfig_t *pParam); 160 161 TI_STATUS apConn_registerRoamMngrCallb(TI_HANDLE hAPConnection, 162 apConn_roamMngrCallb_t roamEventCallb, 163 apConn_roamMngrCallb_t reportStatusCallb, 164 apConn_roamMngrCallb_t returnNeighborApsCallb); 165 TI_STATUS apConn_unregisterRoamMngrCallb(TI_HANDLE hAPConnection); 166 167 TI_STATUS apConn_disconnect(TI_HANDLE hAPConnection); 168 TI_STATUS apConn_getStaCapabilities(TI_HANDLE hAPConnection, 169 apConn_staCapabilities_t *ie_list); 170 TI_STATUS apConn_connectToAP(TI_HANDLE hAPConnection, 171 bssEntry_t *newAP, 172 apConn_connRequest_t *request, 173 BOOL reNegotiateTspec); 174 bssEntry_t *apConn_getBSSParams(TI_HANDLE hAPConnection); 175 176 BOOL apConn_isSiteBanned(TI_HANDLE hAPConnection, macAddress_t * bssid); 177 178 BOOL apConn_getPreAuthAPStatus(TI_HANDLE hAPConnection, 179 macAddress_t *givenAp); 180 TI_STATUS apConn_preAuthenticate(TI_HANDLE hAPConnection, bssList_t *listAPs, UINT8 listAPs_numOfEntries); 181 TI_STATUS apConn_prepareToRoaming(TI_HANDLE hAPConnection, apConn_roamingTrigger_e reason); 182 TI_STATUS apConn_reportRoamingEventDisconnect(TI_HANDLE hAPConnection,UINT16 uStatusCode,BOOLEAN bDeAuthenticate ); 183 184 #endif /* _AP_CONNECTION_API_H_*/ 185 186