Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Gopichand Nakkala | 9c070ad | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
| 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 | /* |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 22 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 23 | * |
| 24 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 25 | * |
| 26 | * |
| 27 | * Permission to use, copy, modify, and/or distribute this software for |
| 28 | * any purpose with or without fee is hereby granted, provided that the |
| 29 | * above copyright notice and this permission notice appear in all |
| 30 | * copies. |
| 31 | * |
| 32 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 33 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 34 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 35 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 36 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 37 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 38 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 39 | * PERFORMANCE OF THIS SOFTWARE. |
| 40 | */ |
| 41 | |
| 42 | |
| 43 | #if !defined( __SMEQOSINTERNAL_H ) |
| 44 | #define __SMEQOSINTERNAL_H |
| 45 | |
| 46 | |
| 47 | /**========================================================================= |
| 48 | |
| 49 | \file smeQosInternal.h |
| 50 | |
| 51 | \brief prototype for SME QoS APIs |
| 52 | |
| 53 | Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. |
| 54 | |
| 55 | Qualcomm Confidential and Proprietary. |
| 56 | |
| 57 | ========================================================================*/ |
| 58 | |
| 59 | /* $Header$ */ |
| 60 | |
| 61 | /*-------------------------------------------------------------------------- |
| 62 | Include Files |
| 63 | ------------------------------------------------------------------------*/ |
| 64 | #include "vos_lock.h" |
| 65 | #include "vos_trace.h" |
| 66 | #include "vos_memory.h" |
| 67 | #include "vos_types.h" |
| 68 | #include "aniGlobal.h" |
| 69 | #include "sirApi.h" |
| 70 | #include "sme_QosApi.h" |
| 71 | #include "smeInternal.h" |
| 72 | |
| 73 | /*-------------------------------------------------------------------------- |
| 74 | Type declarations |
| 75 | ------------------------------------------------------------------------*/ |
| 76 | #define SME_QOS_AP_SUPPORTS_APSD 0x80 |
| 77 | |
| 78 | /*--------------------------------------------------------------------------- |
| 79 | Enumeration of the various EDCA Access Categories: |
| 80 | Based on AC to ACI mapping in 802.11e spec (identical to WMM) |
| 81 | ---------------------------------------------------------------------------*/ |
| 82 | typedef enum |
| 83 | { |
| 84 | SME_QOS_EDCA_AC_BE = 0, /* Best effort access category */ |
| 85 | SME_QOS_EDCA_AC_BK = 1, /* Background access category */ |
| 86 | SME_QOS_EDCA_AC_VI = 2, /* Video access category */ |
| 87 | SME_QOS_EDCA_AC_VO = 3, /* Voice access category */ |
| 88 | |
| 89 | SME_QOS_EDCA_AC_MAX |
| 90 | } sme_QosEdcaAcType; |
| 91 | |
| 92 | |
| 93 | /*--------------------------------------------------------------------------- |
| 94 | Enumeration of the various CSR event indication types that would be reported |
| 95 | by CSR |
| 96 | ---------------------------------------------------------------------------*/ |
| 97 | typedef enum |
| 98 | { |
| 99 | SME_QOS_CSR_JOIN_REQ = 0, |
| 100 | SME_QOS_CSR_ASSOC_COMPLETE, |
| 101 | SME_QOS_CSR_REASSOC_REQ, |
| 102 | SME_QOS_CSR_REASSOC_COMPLETE, |
| 103 | SME_QOS_CSR_REASSOC_FAILURE, |
| 104 | SME_QOS_CSR_DISCONNECT_REQ, |
| 105 | SME_QOS_CSR_DISCONNECT_IND, |
| 106 | SME_QOS_CSR_HANDOFF_ASSOC_REQ, |
| 107 | SME_QOS_CSR_HANDOFF_COMPLETE, |
| 108 | SME_QOS_CSR_HANDOFF_FAILURE, |
| 109 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 110 | SME_QOS_CSR_PREAUTH_SUCCESS_IND, |
| 111 | SME_QOS_CSR_SET_KEY_SUCCESS_IND, |
| 112 | #endif |
| 113 | }sme_QosCsrEventIndType; |
| 114 | |
| 115 | #ifdef FEATURE_WLAN_DIAG_SUPPORT |
| 116 | typedef enum |
| 117 | { |
| 118 | SME_QOS_DIAG_ADDTS_REQ = 0, |
| 119 | SME_QOS_DIAG_ADDTS_RSP, |
| 120 | SME_QOS_DIAG_DELTS |
| 121 | |
| 122 | }sme_QosDiagQosEventSubtype; |
| 123 | |
| 124 | typedef enum |
| 125 | { |
| 126 | SME_QOS_DIAG_ADDTS_ADMISSION_ACCEPTED = 0, |
| 127 | SME_QOS_DIAG_ADDTS_INVALID_PARAMS, |
| 128 | SME_QOS_DIAG_ADDTS_RESERVED, |
| 129 | SME_QOS_DIAG_ADDTS_REFUSED, |
| 130 | SME_QOS_DIAG_USER_REQUESTED, |
| 131 | SME_QOS_DIAG_DELTS_IND_FROM_AP, |
| 132 | |
| 133 | }sme_QosDiagQosEventReasonCode; |
| 134 | |
| 135 | #endif //FEATURE_WLAN_DIAG_SUPPORT |
| 136 | /*--------------------------------------------------------------------------- |
| 137 | The association information structure to be passed by CSR after assoc or |
| 138 | reassoc is done |
| 139 | ---------------------------------------------------------------------------*/ |
| 140 | typedef struct |
| 141 | { |
| 142 | tSirBssDescription *pBssDesc; |
| 143 | tCsrRoamProfile *pProfile; |
| 144 | } sme_QosAssocInfo; |
| 145 | |
| 146 | /*-------------------------------------------------------------------------- |
| 147 | External APIs for CSR - Internal to SME |
| 148 | ------------------------------------------------------------------------*/ |
| 149 | |
| 150 | /* -------------------------------------------------------------------------- |
| 151 | \brief sme_QosOpen() - This function must be called before any API call to |
| 152 | SME QoS module. |
| 153 | |
| 154 | \param pMac - Pointer to the global MAC parameter structure. |
| 155 | |
| 156 | \return eHalStatus |
| 157 | ----------------------------------------------------------------------------*/ |
| 158 | eHalStatus sme_QosOpen(tpAniSirGlobal pMac); |
| 159 | |
| 160 | /* -------------------------------------------------------------------------- |
| 161 | \brief sme_QosClose() - To close down SME QoS module. There should not be |
| 162 | any API call into this module after calling this function until another |
| 163 | call of sme_QosOpen. |
| 164 | |
| 165 | \param pMac - Pointer to the global MAC parameter structure. |
| 166 | |
| 167 | \return eHalStatus |
| 168 | ----------------------------------------------------------------------------*/ |
| 169 | eHalStatus sme_QosClose(tpAniSirGlobal pMac); |
| 170 | |
| 171 | /*-------------------------------------------------------------------------- |
| 172 | \brief sme_QosSetParams() - This function is used by HDD to provide the |
| 173 | default TSPEC params to SME. |
| 174 | |
| 175 | \param pMac - Pointer to the global MAC parameter structure. |
| 176 | \param pQoSInfo - Pointer to sme_QosWmmTspecInfo which contains the WMM TSPEC |
| 177 | related info per AC as defined above, provided by HDD |
| 178 | |
| 179 | \return eHAL_STATUS_SUCCESS - Setparam is successful. |
| 180 | |
| 181 | \sa |
| 182 | |
| 183 | --------------------------------------------------------------------------*/ |
| 184 | eHalStatus sme_QosSetParams(tpAniSirGlobal pMac, sme_QosWmmTspecInfo * pQoSInfo); |
| 185 | |
| 186 | /*-------------------------------------------------------------------------- |
| 187 | \brief sme_QosMsgProcessor() - sme_ProcessMsg() calls this function for the |
| 188 | messages that are handled by SME QoS module. |
| 189 | |
| 190 | \param pMac - Pointer to the global MAC parameter structure. |
| 191 | \param msg_type - the type of msg passed by PE as defined in wniApi.h |
| 192 | \param pMsgBuf - a pointer to a buffer that maps to various structures base |
| 193 | on the message type. |
| 194 | The beginning of the buffer can always map to tSirSmeRsp. |
| 195 | |
| 196 | \return eHalStatus. |
| 197 | |
| 198 | \sa |
| 199 | |
| 200 | --------------------------------------------------------------------------*/ |
| 201 | eHalStatus sme_QosMsgProcessor( tpAniSirGlobal pMac, v_U16_t msg_type, |
| 202 | void *pMsgBuf); |
| 203 | |
| 204 | /*-------------------------------------------------------------------------- |
| 205 | Internal APIs for CSR |
| 206 | ------------------------------------------------------------------------*/ |
| 207 | |
| 208 | /*-------------------------------------------------------------------------- |
| 209 | \brief sme_QosValidateParams() - The SME QoS API exposed to CSR to validate AP |
| 210 | capabilities regarding QoS support & any other QoS parameter validation. |
| 211 | |
| 212 | \param pMac - Pointer to the global MAC parameter structure. |
| 213 | \param pBssDesc - Pointer to the BSS Descriptor information passed down by |
| 214 | CSR to PE while issuing the Join request |
| 215 | |
| 216 | \return eHAL_STATUS_SUCCESS - Validation is successful |
| 217 | |
| 218 | \sa |
| 219 | |
| 220 | --------------------------------------------------------------------------*/ |
| 221 | eHalStatus sme_QosValidateParams(tpAniSirGlobal pMac, |
| 222 | tSirBssDescription *pBssDesc); |
| 223 | |
| 224 | /*-------------------------------------------------------------------------- |
| 225 | \brief sme_QosCsrEventInd() - The QoS sub-module in SME expects notifications |
| 226 | from CSR when certain events occur as mentioned in sme_QosCsrEventIndType. |
| 227 | |
| 228 | \param pMac - Pointer to the global MAC parameter structure. |
| 229 | \param ind - The event occurred of type sme_QosCsrEventIndType. |
| 230 | \param pEvent_info - Information related to the event |
| 231 | |
| 232 | \return eHalStatus |
| 233 | |
| 234 | \sa |
| 235 | |
| 236 | --------------------------------------------------------------------------*/ |
| 237 | eHalStatus sme_QosCsrEventInd(tpAniSirGlobal pMac, |
| 238 | v_U8_t sessionId, |
| 239 | sme_QosCsrEventIndType ind, |
| 240 | void *pEvent_info); |
| 241 | |
| 242 | /*-------------------------------------------------------------------------- |
| 243 | \brief sme_QosGetACMMask() - The QoS sub-module API to find out on which ACs |
| 244 | AP mandates Admission Control (ACM = 1) |
| 245 | |
| 246 | \param pMac - Pointer to the global MAC parameter structure. |
| 247 | \param pSirBssDesc - The event occurred of type sme_QosCsrEventIndType. |
| 248 | \param pIes - the parsed IE for pSirBssDesc. This can be NULL. |
| 249 | |
| 250 | |
| 251 | \return a bit mask indicating for which ACs AP has ACM set to 1 |
| 252 | |
| 253 | \sa |
| 254 | |
| 255 | --------------------------------------------------------------------------*/ |
| 256 | v_U8_t sme_QosGetACMMask(tpAniSirGlobal pMac, tSirBssDescription *pSirBssDesc, tDot11fBeaconIEs *pIes); |
| 257 | |
| 258 | /* |
| 259 | sme_QosTriggerUapsdChange |
| 260 | It trigger a change on UAPSD (either disable/enable UAPSD) on current QoS flows |
| 261 | */ |
| 262 | sme_QosStatusType sme_QosTriggerUapsdChange( tpAniSirGlobal pMac ); |
| 263 | |
| 264 | #ifdef FEATURE_WLAN_CCX |
| 265 | v_U8_t sme_QosCCxRetrieveTspecInfo(tpAniSirGlobal pMac, v_U8_t sessionId, tTspecInfo *pTspecInfo); |
| 266 | |
| 267 | #endif |
| 268 | |
| 269 | #endif //#if !defined( __SMEQOSINTERNAL_H ) |