Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Varun Reddy Yeturu | d5939f8 | 2015-12-24 18:14:02 -0800 | [diff] [blame] | 2 | * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [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 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
| 28 | /* |
| 29 | * This file lim_assoc_utils.h contains the utility definitions |
| 30 | * LIM uses while processing Re/Association messages. |
| 31 | * Author: Chandra Modumudi |
| 32 | * Date: 02/13/02 |
| 33 | * History:- |
| 34 | * Date Modified by Modification Information |
| 35 | * -------------------------------------------------------------------- |
| 36 | * 05/26/10 js WPA handling in (Re)Assoc frames |
| 37 | * |
| 38 | */ |
| 39 | #ifndef __LIM_ASSOC_UTILS_H |
| 40 | #define __LIM_ASSOC_UTILS_H |
| 41 | |
| 42 | #include "sir_api.h" |
| 43 | #include "sir_debug.h" |
| 44 | #include "cfg_api.h" |
| 45 | |
| 46 | #include "lim_types.h" |
| 47 | |
Anurag Chouhan | 600c3a0 | 2016-03-01 10:33:54 +0530 | [diff] [blame^] | 48 | uint32_t lim_cmp_ssid(tSirMacSSid *, tpPESession); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 49 | uint8_t lim_compare_capabilities(tpAniSirGlobal, |
| 50 | tSirAssocReq *, |
| 51 | tSirMacCapabilityInfo *, tpPESession); |
| 52 | uint8_t lim_check_rx_basic_rates(tpAniSirGlobal, tSirMacRateSet, tpPESession); |
| 53 | uint8_t lim_check_rx_rsn_ie_match(tpAniSirGlobal, tDot11fIERSN, tpPESession, uint8_t, |
| 54 | bool *); |
| 55 | uint8_t lim_check_rx_wpa_ie_match(tpAniSirGlobal, tDot11fIEWPA, tpPESession, |
| 56 | uint8_t); |
| 57 | uint8_t lim_check_mcs_set(tpAniSirGlobal pMac, uint8_t *supportedMCSSet); |
| 58 | void limPostDummyToTmRing(tpAniSirGlobal, tpDphHashNode); |
| 59 | void limPostPacketToTdRing(tpAniSirGlobal, tpDphHashNode, uint8_t); |
| 60 | tSirRetStatus lim_cleanup_rx_path(tpAniSirGlobal, tpDphHashNode, tpPESession); |
| 61 | void lim_reject_association(tpAniSirGlobal, tSirMacAddr, uint8_t, |
| 62 | uint8_t, tAniAuthType, |
| 63 | uint16_t, uint8_t, tSirResultCodes, tpPESession); |
| 64 | |
| 65 | #ifdef WLAN_FEATURE_11AC |
| 66 | tSirRetStatus lim_populate_peer_rate_set(tpAniSirGlobal pMac, |
| 67 | tpSirSupportedRates pRates, |
| 68 | uint8_t *pSupportedMCSSet, |
| 69 | uint8_t basicOnly, |
| 70 | tpPESession psessionEntry, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 71 | tDot11fIEVHTCaps * pVHTCaps); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 72 | #else |
| 73 | tSirRetStatus lim_populate_peer_rate_set(tpAniSirGlobal pMac, |
| 74 | tpSirSupportedRates pRates, |
| 75 | uint8_t *pSupportedMCSSet, |
| 76 | uint8_t basicOnly, |
| 77 | tpPESession psessionEntry); |
| 78 | #endif |
| 79 | |
| 80 | #ifdef WLAN_FEATURE_11AC |
| 81 | tSirRetStatus lim_populate_own_rate_set(tpAniSirGlobal pMac, |
| 82 | tpSirSupportedRates pRates, |
| 83 | uint8_t *pSupportedMCSSet, |
| 84 | uint8_t basicOnly, |
| 85 | tpPESession psessionEntry, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 86 | tDot11fIEVHTCaps * pVHTCaps); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 87 | |
| 88 | #else |
| 89 | tSirRetStatus lim_populate_own_rate_set(tpAniSirGlobal pMac, |
| 90 | tpSirSupportedRates pRates, |
| 91 | uint8_t *pSupportedMCSSet, |
| 92 | uint8_t basicOnly, |
| 93 | tpPESession psessionEntry); |
| 94 | #endif |
| 95 | |
| 96 | #ifdef WLAN_FEATURE_11AC |
| 97 | tSirRetStatus |
| 98 | lim_populate_matching_rate_set(tpAniSirGlobal pMac, |
| 99 | tpDphHashNode pStaDs, |
| 100 | tSirMacRateSet *pOperRateSet, |
| 101 | tSirMacRateSet *pExtRateSet, |
| 102 | uint8_t *pSupportedMCSSet, |
| 103 | tpPESession psessionEntry, |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 104 | tDot11fIEVHTCaps * pVHTCaps); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 105 | #else |
| 106 | tSirRetStatus lim_populate_matching_rate_set(tpAniSirGlobal, |
| 107 | tpDphHashNode, |
| 108 | tSirMacRateSet *, |
| 109 | tSirMacRateSet *, |
| 110 | uint8_t *pSupportedMCSSet, |
| 111 | tpPESession); |
| 112 | |
| 113 | #endif |
| 114 | |
| 115 | #ifdef WLAN_FEATURE_11AC |
| 116 | #define MCSMAPMASK1x1 0x3 |
| 117 | #define MCSMAPMASK2x2 0xC |
| 118 | #endif |
| 119 | |
| 120 | tSirRetStatus lim_add_sta(tpAniSirGlobal, tpDphHashNode, uint8_t, tpPESession); |
| 121 | tSirRetStatus lim_del_bss(tpAniSirGlobal, tpDphHashNode, uint16_t, tpPESession); |
| 122 | tSirRetStatus lim_del_sta(tpAniSirGlobal, tpDphHashNode, bool, tpPESession); |
| 123 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 124 | tSirRetStatus lim_add_ft_sta_self(tpAniSirGlobal pMac, uint16_t assocId, |
| 125 | tpPESession psessionEntry); |
| 126 | #endif /* WLAN_FEATURE_VOWIFI_11R */ |
| 127 | tSirRetStatus lim_add_sta_self(tpAniSirGlobal, uint16_t, uint8_t, tpPESession); |
| 128 | tStaRateMode lim_get_sta_rate_mode(uint8_t dot11Mode); |
| 129 | |
| 130 | void lim_teardown_infra_bss(tpAniSirGlobal, tpPESession); |
| 131 | void lim_restore_pre_reassoc_state(tpAniSirGlobal, |
| 132 | tSirResultCodes, uint16_t, tpPESession); |
| 133 | void lim_post_reassoc_failure(tpAniSirGlobal, |
| 134 | tSirResultCodes, uint16_t, tpPESession); |
| 135 | bool lim_is_reassoc_in_progress(tpAniSirGlobal, tpPESession); |
| 136 | void |
Anurag Chouhan | 6d76066 | 2016-02-20 16:05:43 +0530 | [diff] [blame] | 137 | lim_send_del_sta_cnf(tpAniSirGlobal pMac, struct qdf_mac_addr sta_dsaddr, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 138 | uint16_t staDsAssocId, tLimMlmStaContext mlmStaContext, |
| 139 | tSirResultCodes statusCode, tpPESession psessionEntry); |
| 140 | |
| 141 | void lim_handle_cnf_wait_timeout(tpAniSirGlobal pMac, uint16_t staId); |
| 142 | void lim_delete_dph_hash_entry(tpAniSirGlobal, tSirMacAddr, uint16_t, tpPESession); |
| 143 | void lim_check_and_announce_join_success(tpAniSirGlobal, |
| 144 | tSirProbeRespBeacon *, |
| 145 | tpSirMacMgmtHdr, tpPESession); |
| 146 | void lim_update_re_assoc_globals(tpAniSirGlobal pMac, |
| 147 | tpSirAssocRsp pAssocRsp, |
| 148 | tpPESession psessionEntry); |
| 149 | |
| 150 | void lim_update_assoc_sta_datas(tpAniSirGlobal pMac, |
| 151 | tpDphHashNode pStaDs, tpSirAssocRsp pAssocRsp, |
| 152 | tpPESession psessionEntry); |
| 153 | void lim_fill_supported_rates_info(tpAniSirGlobal pMac, tpDphHashNode pSta, |
| 154 | tpSirSupportedRates pRates, |
| 155 | tpPESession psessionEntry); |
| 156 | |
| 157 | tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, |
| 158 | tpSchBeaconStruct pBeaconStruct, |
| 159 | tpSirBssDescription bssDescription, |
| 160 | uint8_t updateEntry, tpPESession psessionEntry); |
| 161 | tSirRetStatus lim_sta_send_add_bss_pre_assoc(tpAniSirGlobal pMac, uint8_t updateEntry, |
| 162 | tpPESession psessionEntry); |
| 163 | |
| 164 | void lim_prepare_and_send_del_sta_cnf(tpAniSirGlobal pMac, tpDphHashNode pStaDs, |
| 165 | tSirResultCodes statusCode, tpPESession); |
| 166 | tSirRetStatus lim_extract_ap_capabilities(tpAniSirGlobal pMac, uint8_t *pIE, |
| 167 | uint16_t ieLen, |
| 168 | tpSirProbeRespBeacon beaconStruct); |
| 169 | void lim_init_pre_auth_timer_table(tpAniSirGlobal pMac, |
| 170 | tpLimPreAuthTable pPreAuthTimerTable); |
| 171 | tpLimPreAuthNode lim_acquire_free_pre_auth_node(tpAniSirGlobal pMac, |
| 172 | tpLimPreAuthTable |
| 173 | pPreAuthTimerTable); |
| 174 | tpLimPreAuthNode lim_get_pre_auth_node_from_index(tpAniSirGlobal pMac, |
| 175 | tpLimPreAuthTable pAuthTable, |
| 176 | uint32_t authNodeIdx); |
| 177 | |
| 178 | /* Util API to check if the channels supported by STA is within range */ |
| 179 | tSirRetStatus lim_is_dot11h_supported_channels_valid(tpAniSirGlobal pMac, |
| 180 | tSirAssocReq *assoc); |
| 181 | |
| 182 | /* Util API to check if the txpower supported by STA is within range */ |
| 183 | tSirRetStatus lim_is_dot11h_power_capabilities_in_range(tpAniSirGlobal pMac, |
| 184 | tSirAssocReq *assoc, |
| 185 | tpPESession); |
| 186 | |
| 187 | /* API to re-add the same BSS during re-association */ |
| 188 | void lim_handle_add_bss_in_re_assoc_context(tpAniSirGlobal pMac, tpDphHashNode pStaDs, |
| 189 | tpPESession psessionEntry); |
| 190 | |
| 191 | /* API to fill in RX Highest Supported data Rate */ |
| 192 | void lim_fill_rx_highest_supported_rate(tpAniSirGlobal pMac, |
| 193 | uint16_t *rxHighestRate, |
| 194 | uint8_t *pSupportedMCSSet); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 195 | void lim_send_retry_reassoc_req_frame(tpAniSirGlobal pMac, |
| 196 | tLimMlmReassocReq *pMlmReassocReq, |
| 197 | tpPESession psessionEntry); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 198 | #ifdef WLAN_FEATURE_11W |
| 199 | void lim_send_sme_unprotected_mgmt_frame_ind(tpAniSirGlobal pMac, uint8_t frameType, |
| 200 | uint8_t *frame, uint32_t frameLen, |
| 201 | uint16_t sessionId, |
| 202 | tpPESession psessionEntry); |
| 203 | #endif |
| 204 | |
| 205 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
| 206 | void lim_send_sme_tsm_ie_ind(tpAniSirGlobal pMac, tpPESession psessionEntry, |
| 207 | uint8_t tid, uint8_t state, uint16_t measInterval); |
Varun Reddy Yeturu | d5939f8 | 2015-12-24 18:14:02 -0800 | [diff] [blame] | 208 | #else |
| 209 | static inline void lim_send_sme_tsm_ie_ind(tpAniSirGlobal pMac, |
| 210 | tpPESession psessionEntry, uint8_t tid, |
| 211 | uint8_t state, uint16_t measInterval) |
| 212 | {} |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 213 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
| 214 | |
| 215 | #endif /* __LIM_ASSOC_UTILS_H */ |