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