Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2012, Code Aurora Forum. 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 | |
| 22 | /* |
| 23 | * |
| 24 | * Airgo Networks, Inc proprietary. All rights reserved. |
| 25 | * This file aniSystemDefs.h contains definitions used by |
| 26 | * various ANI entities |
| 27 | * Author: Chandra Modumudi |
| 28 | * Date: 09/18/2002 |
| 29 | * History:- |
| 30 | * Date Modified by Modification Information |
| 31 | * -------------------------------------------------------------------- |
| 32 | */ |
| 33 | |
| 34 | #ifndef __ANI_SYSTEM_DEFS_H |
| 35 | #define __ANI_SYSTEM_DEFS_H |
| 36 | |
| 37 | #include "sirTypes.h" |
| 38 | #include "sirMacProtDef.h" |
| 39 | |
| 40 | #define ANI_OUI 0x000AF5 |
| 41 | |
| 42 | /// Max WDS info length. |
| 43 | #define ANI_WDS_INFO_MAX_LENGTH 64 |
| 44 | |
| 45 | |
| 46 | /// Max number of SSIDs to support Multiple SSID feature |
| 47 | #define ANI_MAX_NUM_OF_SSIDS 16 |
| 48 | |
| 49 | //This is to force compiler to use the maximum of an int for enum |
| 50 | #define SIR_MAX_ENUM_SIZE 0x7FFFFFFF |
| 51 | |
| 52 | /* Max key size including the WAPI and TKIP */ |
| 53 | #define WLAN_MAX_KEY_RSC_LEN 16 |
| 54 | #define WLAN_WAPI_KEY_RSC_LEN 16 |
| 55 | |
| 56 | |
| 57 | |
| 58 | #ifndef FALSE |
| 59 | #undef FALSE |
| 60 | #define FALSE 0 |
| 61 | #endif |
| 62 | #ifndef TRUE |
| 63 | #undef TRUE |
| 64 | #define TRUE 1 |
| 65 | #endif |
| 66 | |
| 67 | typedef enum eAniBool |
| 68 | { |
| 69 | eSIR_FALSE, |
| 70 | eSIR_TRUE, |
| 71 | eSIR_DONOT_USE_BOOL = SIR_MAX_ENUM_SIZE |
| 72 | } tAniBool; |
| 73 | |
| 74 | /// Authentication type enum used with peer |
| 75 | typedef enum eAniAuthType |
| 76 | { |
| 77 | eSIR_OPEN_SYSTEM, |
| 78 | eSIR_SHARED_KEY, |
| 79 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 80 | eSIR_FT_AUTH, |
| 81 | #endif |
| 82 | #if defined FEATURE_WLAN_CCX |
| 83 | eSIR_LEAP_AUTH = 0x80, |
| 84 | #endif |
| 85 | eSIR_AUTO_SWITCH, |
| 86 | eSIR_DONOT_USE_AUTH_TYPE = SIR_MAX_ENUM_SIZE |
| 87 | } tAniAuthType; |
| 88 | |
| 89 | /// Encryption type enum used with peer |
| 90 | typedef enum eAniEdType |
| 91 | { |
| 92 | eSIR_ED_NONE, |
| 93 | eSIR_ED_WEP40, |
| 94 | eSIR_ED_WEP104, |
| 95 | eSIR_ED_TKIP, |
| 96 | eSIR_ED_CCMP, |
| 97 | #if defined(FEATURE_WLAN_WAPI) |
| 98 | eSIR_ED_WPI, |
| 99 | #endif |
| 100 | /*DPU HW treats encryption mode 4 plus RMF bit set in TX BD as BIP. |
| 101 | Thus while setting BIP encryption mode in corresponding DPU Desc |
| 102 | eSIR_ED_AES_128_CMAC should be set to eSIR_ED_CCMP*/ |
| 103 | eSIR_ED_AES_128_CMAC, |
| 104 | eSIR_ED_NOT_IMPLEMENTED = SIR_MAX_ENUM_SIZE |
| 105 | } tAniEdType; |
| 106 | |
| 107 | |
| 108 | typedef enum eAniWepType |
| 109 | { |
| 110 | eSIR_WEP_STATIC, |
| 111 | eSIR_WEP_DYNAMIC, |
| 112 | } tAniWepType; |
| 113 | |
| 114 | /// Enum to specify whether key is used |
| 115 | /// for TX only, RX only or both |
| 116 | typedef enum eAniKeyDirection |
| 117 | { |
| 118 | eSIR_TX_ONLY, |
| 119 | eSIR_RX_ONLY, |
| 120 | eSIR_TX_RX, |
| 121 | #ifdef WLAN_SOFTAP_FEATURE |
| 122 | eSIR_TX_DEFAULT, |
| 123 | #endif |
| 124 | eSIR_DONOT_USE_KEY_DIRECTION = SIR_MAX_ENUM_SIZE |
| 125 | } tAniKeyDirection; |
| 126 | |
| 127 | /// Enum for rate |
| 128 | typedef enum eAniRate |
| 129 | { |
| 130 | eSIR_ANY_RATE |
| 131 | } tAniRate; |
| 132 | |
| 133 | typedef struct sAniSSID |
| 134 | { |
| 135 | tANI_U8 length; |
| 136 | tANI_U8 ssId[SIR_MAC_MAX_SSID_LENGTH]; |
| 137 | } tAniSSID, *tpAniSSID; |
| 138 | |
| 139 | typedef struct sAniApName |
| 140 | { |
| 141 | tANI_U8 length; |
| 142 | tANI_U8 name[SIR_MAC_MAX_SSID_LENGTH]; |
| 143 | } tAniApName, *tpAniApName; |
| 144 | |
| 145 | /// RSN IE information |
| 146 | typedef struct sSirRSNie |
| 147 | { |
| 148 | tANI_U16 length; |
| 149 | tANI_U8 rsnIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 150 | } tSirRSNie, *tpSirRSNie; |
| 151 | |
| 152 | /// Additional IE information : |
| 153 | /// This can include WSC IE, P2P IE, and/or FTIE from upper layer. |
| 154 | /// MAC layer transparently convey these IE info between peer STA and upper layer, |
| 155 | /// but never requires to parse it. |
| 156 | typedef struct sSirAddie |
| 157 | { |
| 158 | tANI_U16 length; |
| 159 | tANI_U8 addIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 160 | } tSirAddie, *tpSirAddie; |
| 161 | |
| 162 | #ifdef FEATURE_WLAN_CCX |
| 163 | |
| 164 | // The CCKM IE needs to be in the |
| 165 | // Join and Reassoc Req. |
| 166 | typedef struct sSirCCKMie |
| 167 | { |
| 168 | tANI_U16 length; |
| 169 | tANI_U8 cckmIEdata[SIR_MAC_MAX_IE_LENGTH+2]; |
| 170 | } tSirCCKMie, *tpSirCCKMie; |
| 171 | |
| 172 | #endif |
| 173 | |
| 174 | /// Need to refine structure definitions for Keying material, |
| 175 | /// QoS policy, etc |
| 176 | |
| 177 | /// Definition Quality of Service |
| 178 | typedef struct sSirQos |
| 179 | { |
| 180 | tANI_U16 temp1; // Need to define later |
| 181 | tANI_U16 temp2; // Need to define later |
| 182 | } tSirQos, *tpSirQos; |
| 183 | |
| 184 | /// Definition for Encryption Keys |
| 185 | typedef struct sSirKeys |
| 186 | { |
| 187 | tANI_U8 keyId; |
| 188 | tANI_U8 unicast; // 0 for multicast |
| 189 | tAniKeyDirection keyDirection; |
| 190 | tANI_U8 keyRsc[WLAN_MAX_KEY_RSC_LEN]; // Usage is unknown |
| 191 | tANI_U8 paeRole; // =1 for authenticator, |
| 192 | // =0 for supplicant |
| 193 | tANI_U16 keyLength; |
| 194 | tANI_U8 key[SIR_MAC_MAX_KEY_LENGTH]; |
| 195 | } tSirKeys, *tpSirKeys; |
| 196 | |
| 197 | /// Definition for Keying material |
| 198 | typedef struct sSirKeyMaterial |
| 199 | { |
| 200 | tANI_U16 length; // This is the length of all |
| 201 | // data that follows |
| 202 | tAniEdType edType; // Encryption/Decryption type |
| 203 | tANI_U8 numKeys; |
| 204 | tSirKeys key[1]; |
| 205 | } tSirKeyMaterial, *tpSirKeyMaterial; |
| 206 | |
| 207 | #define SIR_CIPHER_SEQ_CTR_SIZE 6 |
| 208 | /// Definition for MIC failure indication |
| 209 | typedef struct sSirMicFailureInfo |
| 210 | { |
| 211 | tSirMacAddr srcMacAddr; //address used to compute MIC |
| 212 | tSirMacAddr taMacAddr; //transmitter address |
| 213 | tSirMacAddr dstMacAddr; |
| 214 | tAniBool multicast; |
| 215 | tANI_U8 IV1; // first byte of IV |
| 216 | tANI_U8 keyId; // second byte of IV |
| 217 | tANI_U8 TSC[SIR_CIPHER_SEQ_CTR_SIZE]; // sequence number |
| 218 | tSirMacAddr rxMacAddr; // receive address |
| 219 | |
| 220 | } tSirMicFailureInfo, *tpSirMicFailureInfo; |
| 221 | |
| 222 | // Boa command. Used mainly for radar info persistance |
| 223 | typedef struct sBoaCommand |
| 224 | { |
| 225 | tANI_U8 length; |
| 226 | tANI_U8 cmd[64]; |
| 227 | }tBoaCommand; |
| 228 | |
| 229 | #endif /* __ANI_SYSTEM_DEFS_H */ |
| 230 | |