blob: 7705753647523331a793ef993c16cdad312ba9b5 [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lamaa8e15a2014-02-11 23:30:06 -08002 * Copyright (c) 2012-2013 Qualcomm Atheros, Inc.
3 * All Rights Reserved.
4 * Qualcomm Atheros Confidential and Proprietary.
Gopichand Nakkala92f07d82013-01-08 21:16:34 -08005 */
Jeff Johnson295189b2012-06-20 16:38:30 -07006#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 Johnson295189b2012-06-20 16:38:30 -070031#include "halLegacyPalTypes.h"
Jeff Johnson295189b2012-06-20 16:38:30 -070032
33#ifndef MK_IMAGE_HDR
Jeff Johnson295189b2012-06-20 16:38:30 -070034
35//
36// Validate the Bus type being built....
37//
38#if defined(ANI_BUS_TYPE_PCI)
39
Jeff Johnsonbc676b42013-02-14 16:04:08 -080040#if defined( ANI_BUS_TYPE_PCIe ) || defined( ANI_BUS_TYPE_PLATFORM )
Jeff Johnson295189b2012-06-20 16:38:30 -070041#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 Johnsonbc676b42013-02-14 16:04:08 -080046#if defined( ANI_BUS_TYPE_PCI ) || defined( ANI_BUS_TYPE_PLATFORM )
Jeff Johnson295189b2012-06-20 16:38:30 -070047#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 Johnsonbc676b42013-02-14 16:04:08 -080052#if defined( ANI_BUS_TYPE_PCIe ) || defined(ANI_BUS_TYPE_PCI)
Jeff Johnson295189b2012-06-20 16:38:30 -070053#error "more than one ANI_BUS_TYPE_xxx is defined for this build"
54#endif
55
Jeff Johnsonbc676b42013-02-14 16:04:08 -080056#elif !( defined( ANI_BUS_TYPE_PCIe ) || defined(ANI_BUS_TYPE_PCI) || defined( ANI_BUS_TYPE_PLATFORM ) )
Jeff Johnson295189b2012-06-20 16:38:30 -070057
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 Veetil2aad8d82013-02-07 12:31:28 -080066
Jeff Johnson77165482013-03-07 08:15:44 -080067#if defined(ANI_OS_TYPE_ANDROID) // ANDROID
Mahesh Kumar Kalikot Veetil2aad8d82013-02-07 12:31:28 -080068
Jeff Johnson77165482013-03-07 08:15:44 -080069#if defined(ANI_OS_TYPE_QNX)
Mahesh Kumar Kalikot Veetil2aad8d82013-02-07 12:31:28 -080070#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 Johnson77165482013-03-07 08:15:44 -080075#if defined(ANI_OS_TYPE_ANDROID)
Mahesh Kumar Kalikot Veetil2aad8d82013-02-07 12:31:28 -080076#error "more than one ANI_OS_TYPE_xxx is defined for this build"
77#endif
78
Jeff Johnson295189b2012-06-20 16:38:30 -070079
Jeff Johnson77165482013-03-07 08:15:44 -080080#elif !defined(ANI_OS_TYPE_ANDROID) && !defined(ANI_OS_TYPE_QNX) // NONE
Jeff Johnson295189b2012-06-20 16:38:30 -070081#error "NONE of the ANI_OS_TYPE_xxx are defined for this build"
Jeff Johnson295189b2012-06-20 16:38:30 -070082#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 Johnson295189b2012-06-20 16:38:30 -0700123
Jeff Johnson295189b2012-06-20 16:38:30 -0700124typedef tANI_U32 tANI_U32_OR_PTR;
Jeff Johnson295189b2012-06-20 16:38:30 -0700125
126// Buffer address; could be virt or phys; could be 32- or 64-bit depending on compile option
127typedef tANI_U32_OR_PTR tANI_BUFFER_ADDR;
128// which boolean is the most usefule...or both ?
Jeff Johnson295189b2012-06-20 16:38:30 -0700129
130typedef 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 )
149typedef 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 -------------------------------------------------------------------------- */
168typedef 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 Johnson295189b2012-06-20 16:38:30 -0700181
182
183/*
184This 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.
187typedef 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 */
194typedef void * tPalSemaphoreHandle;
195
196
197#define PAL_TICKS_PER_SECOND 100
198
Jeff Johnson295189b2012-06-20 16:38:30 -0700199#endif