Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame^] | 2 | * Copyright (c) 2012-2013 Qualcomm Atheros, Inc. |
| 3 | * All Rights Reserved. |
| 4 | * Qualcomm Atheros Confidential and Proprietary. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 5 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6 | #if !defined( PALTYPES_H__ ) |
| 7 | #define PALTYPES_H__ |
| 8 | |
| 9 | /** ------------------------------------------------------------------------- * |
| 10 | ------------------------------------------------------------------------- * |
| 11 | |
| 12 | |
| 13 | \file palTypes.h |
| 14 | |
| 15 | \brief Exports and types for the Platform Abstraction Layer typedefs. |
| 16 | These are common typedefs that can be used across Platforms (OS/compiler |
| 17 | and bus types). All common code should adhere to these common types. |
| 18 | |
| 19 | $Id$ |
| 20 | |
| 21 | Copyright (C) 2006 Airgo Networks, Incorporated |
| 22 | |
| 23 | ... description... |
| 24 | |
| 25 | ========================================================================== */ |
| 26 | #ifndef WINXP_APPS_BUILD |
| 27 | #include "vos_types.h" |
| 28 | #include "vos_api.h" |
| 29 | #endif /* WINXP_APPS_BUILD */ |
| 30 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 31 | #include "halLegacyPalTypes.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 32 | |
| 33 | #ifndef MK_IMAGE_HDR |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 34 | |
| 35 | // |
| 36 | // Validate the Bus type being built.... |
| 37 | // |
| 38 | #if defined(ANI_BUS_TYPE_PCI) |
| 39 | |
Jeff Johnson | bc676b4 | 2013-02-14 16:04:08 -0800 | [diff] [blame] | 40 | #if defined( ANI_BUS_TYPE_PCIe ) || defined( ANI_BUS_TYPE_PLATFORM ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 41 | #error "more than one ANI_BUS_TYPE_xxx is defined for this build" |
| 42 | #endif // |
| 43 | |
| 44 | #elif defined( ANI_BUS_TYPE_PCIe ) |
| 45 | |
Jeff Johnson | bc676b4 | 2013-02-14 16:04:08 -0800 | [diff] [blame] | 46 | #if defined( ANI_BUS_TYPE_PCI ) || defined( ANI_BUS_TYPE_PLATFORM ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 47 | #error "more than one ANI_BUS_TYPE_xxx is defined for this build" |
| 48 | #endif |
| 49 | |
| 50 | #elif defined( ANI_BUS_TYPE_PLATFORM ) |
| 51 | |
Jeff Johnson | bc676b4 | 2013-02-14 16:04:08 -0800 | [diff] [blame] | 52 | #if defined( ANI_BUS_TYPE_PCIe ) || defined(ANI_BUS_TYPE_PCI) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 53 | #error "more than one ANI_BUS_TYPE_xxx is defined for this build" |
| 54 | #endif |
| 55 | |
Jeff Johnson | bc676b4 | 2013-02-14 16:04:08 -0800 | [diff] [blame] | 56 | #elif !( defined( ANI_BUS_TYPE_PCIe ) || defined(ANI_BUS_TYPE_PCI) || defined( ANI_BUS_TYPE_PLATFORM ) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 57 | |
| 58 | #error "NONE of the ANI_BUS_TYPE_xxx are defined for this build" |
| 59 | |
| 60 | #endif |
| 61 | |
| 62 | |
| 63 | // |
| 64 | // Validate the OS Type being built... |
| 65 | // |
Mahesh Kumar Kalikot Veetil | 2aad8d8 | 2013-02-07 12:31:28 -0800 | [diff] [blame] | 66 | |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 67 | #if defined(ANI_OS_TYPE_ANDROID) // ANDROID |
Mahesh Kumar Kalikot Veetil | 2aad8d8 | 2013-02-07 12:31:28 -0800 | [diff] [blame] | 68 | |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 69 | #if defined(ANI_OS_TYPE_QNX) |
Mahesh Kumar Kalikot Veetil | 2aad8d8 | 2013-02-07 12:31:28 -0800 | [diff] [blame] | 70 | #error "more than one ANI_OS_TYPE_xxx is defined for this build" |
| 71 | #endif |
| 72 | |
| 73 | #elif defined( ANI_OS_TYPE_QNX ) // QNX |
| 74 | |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 75 | #if defined(ANI_OS_TYPE_ANDROID) |
Mahesh Kumar Kalikot Veetil | 2aad8d8 | 2013-02-07 12:31:28 -0800 | [diff] [blame] | 76 | #error "more than one ANI_OS_TYPE_xxx is defined for this build" |
| 77 | #endif |
| 78 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 79 | |
Jeff Johnson | 7716548 | 2013-03-07 08:15:44 -0800 | [diff] [blame] | 80 | #elif !defined(ANI_OS_TYPE_ANDROID) && !defined(ANI_OS_TYPE_QNX) // NONE |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 81 | #error "NONE of the ANI_OS_TYPE_xxx are defined for this build" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 82 | #endif |
| 83 | |
| 84 | |
| 85 | // |
| 86 | // Validate the compiler... |
| 87 | // |
| 88 | #if ( defined( ANI_COMPILER_TYPE_MSVC ) && defined( ANI_COMPILER_TYPE_GCC ) && defined( ANI_COMPILER_TYPE_RVCT ) ) |
| 89 | #error "more than one ANI_COMPILER_TYPE_xxx is defined for this build" |
| 90 | |
| 91 | #elif !( defined( ANI_COMPILER_TYPE_MSVC ) || defined( ANI_COMPILER_TYPE_GCC ) || defined( ANI_COMPILER_TYPE_RVCT ) ) |
| 92 | #error "NONE of the ANI_COMPILER_TYPE_xxx are defined for this build" |
| 93 | |
| 94 | #endif |
| 95 | |
| 96 | |
| 97 | |
| 98 | // some differences related to the compiler being used... |
| 99 | #if defined ( ANI_COMPILER_TYPE_GCC ) |
| 100 | |
| 101 | #define ANI_INLINE_FUNCTION static __inline__ |
| 102 | |
| 103 | #elif defined( ANI_COMPILER_TYPE_MSVC ) |
| 104 | |
| 105 | #define ANI_INLINE_FUNCTION __inline |
| 106 | |
| 107 | #elif defined( ANI_COMPILER_TYPE_RVCT ) |
| 108 | |
| 109 | #define ANI_INLINE_FUNCTION INLINE |
| 110 | |
| 111 | #else |
| 112 | |
| 113 | #error "invalid ANI_COMPILER_TYPE definition" |
| 114 | |
| 115 | #endif |
| 116 | #endif |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | // Common type definitions... |
| 122 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 123 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 124 | typedef tANI_U32 tANI_U32_OR_PTR; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 125 | |
| 126 | // Buffer address; could be virt or phys; could be 32- or 64-bit depending on compile option |
| 127 | typedef tANI_U32_OR_PTR tANI_BUFFER_ADDR; |
| 128 | // which boolean is the most usefule...or both ? |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 129 | |
| 130 | typedef enum tagAniBoolean |
| 131 | { |
| 132 | eANI_BOOLEAN_FALSE = 0, |
| 133 | eANI_BOOLEAN_TRUE, |
| 134 | |
| 135 | eANI_BOOLEAN_OFF = 0, |
| 136 | eANI_BOOLEAN_ON = 1, |
| 137 | } eAniBoolean; |
| 138 | |
| 139 | |
| 140 | |
| 141 | // |
| 142 | // MAC address data type... |
| 143 | // |
| 144 | // review the usefulness of this type. I suspect this type is not |
| 145 | // real useful unless we provide some 'helper' functions to manage |
| 146 | // the MAC addresses. |
| 147 | // |
| 148 | #define ANI_MAC_ADDR_SIZE ( 6 ) |
| 149 | typedef tANI_U8 tAniMacAddr[ ANI_MAC_ADDR_SIZE ]; |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | /** ------------------------------------------------------------------------- * |
| 156 | |
| 157 | \typedef tHddHandle |
| 158 | |
| 159 | \brief Handle to the HDD. The HDD handle is given to the HAL from |
| 160 | the HDD on halOpen. The HDD handle is an input to all HDD/PAL function |
| 161 | calls and represents an opaque handle to the HDD instance that is tied |
| 162 | to the HAL instance, opened through halOpen. |
| 163 | |
| 164 | The HDD must be able to derive it's internal instance structure pointer |
| 165 | through this handle. hint hint... |
| 166 | |
| 167 | -------------------------------------------------------------------------- */ |
| 168 | typedef void *tHddHandle; |
| 169 | // define a value for an invalid HAL handle..... |
| 170 | #define HDD_INVALID_HDD_HANDLE ( NULL ) |
| 171 | |
| 172 | |
| 173 | // For packet classification routines |
| 174 | #define PAL_BIT_MASK(offset) (1 << (offset)) |
| 175 | #define PAL_PKT_FLD_DSCP_OFFSET 0 |
| 176 | #define PAL_PKT_FLD_8021P_OFFSET 1 |
| 177 | |
| 178 | #define PAL_PKT_FLD_DSCP_MASK PAL_BIT_MASK(PAL_PKT_FLD_DSCP_OFFSET) |
| 179 | #define PAL_PKT_FLD_8021P_MASK PAL_BIT_MASK(PAL_PKT_FLD_8021P_OFFSET) |
| 180 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 181 | |
| 182 | |
| 183 | /* |
| 184 | This represent an object for a spin lock and it is platform dependant |
| 185 | */ |
| 186 | //User of this variable must initialize it to PAL_INVALID_SPINLOCK_HANDLE in order for validation to work. |
| 187 | typedef void * tPalSpinLockHandle; |
| 188 | |
| 189 | #define PAL_INVALID_SPINLOCK_HANDLE (NULL) |
| 190 | |
| 191 | /* |
| 192 | * This represent an object for a semaphore and it is platform dependant |
| 193 | */ |
| 194 | typedef void * tPalSemaphoreHandle; |
| 195 | |
| 196 | |
| 197 | #define PAL_TICKS_PER_SECOND 100 |
| 198 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 199 | #endif |