blob: 4007612291a44a88bc6dd4fff4b76ecad4c113d8 [file] [log] [blame]
Gopichand Nakkala818005c2013-04-17 11:58:12 -07001/*
Deepthi Gowri6a08e312016-03-31 19:10:14 +05302 * Copyright (c) 2011-2013, 2016 The Linux Foundation. All rights reserved.
Kiet Lam0fb93dd2014-02-19 00:32:59 -08003 *
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.
Gopichand Nakkala818005c2013-04-17 11:58:12 -070020 */
Kiet Lam0fb93dd2014-02-19 00:32:59 -080021
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070028/** ------------------------------------------------------------------------- *
29 ------------------------------------------------------------------------- *
30
31
32 \file palApi.h
33
34 \brief Exports and types for the Platform Abstraction Layer interfaces.
35
36 $Id$
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070037 This file contains all the interfaces for thge Platform Abstration Layer
38 functions. It is intended to be included in all modules that are using
39 the PAL interfaces.
40
41 ========================================================================== */
42#ifndef PALAPI_H__
43#define PALAPI_H__
44
45#include "halTypes.h"
46
47/**
48 \mainpage Platform Abstraction Layer (PAL)
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070049
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070050 \section intro Introduction
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070051
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070052 palApi is the Platform Abstration Layer.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070053
54 This is the latest attempt to abstract the entire Platform, including the
55 hardware, chip, OS and Bus into a generic API. We are doing this to give
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070056 the MAC the ability to call
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070057 generic APIs that will allow the MAC to function in an abstract manner
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070058 with any Airgo chipset, on any supported OS (Windows and Linux for now)
59 across any system bus interface (PCI, PCIe, Cardbus, USB, etc.).
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070060
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070061 \todo
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070062 - palReadRegister: register read
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070063 -# add an Open/Close abstraction to accomodate the PAL before the entire MAC is loaded.
64 -# Review with Linux folks to see this basic scructure works for them.
65 -# Figure out how to organize the directory structure
66 - palMemory: memory read/write
67 - include async versions of read/write register
68 - palTx: an abstraction for transmit frames that manages the Td and Tm rings
69 - palRx: an abstracion for receiving frames from a chip across any of the supported buses
70 - palInterrupt: abstract the interrupts into the HAL
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070071
72
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070073 \section impl_notes Implementation Notes
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070074
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070075 \subsection subsection_codeStructure Code strucure
76
77 */
78
79
80/** ---------------------------------------------------------------------------
81
82 \fn palReadRegister
83
84 \brief chip and bus agnostic funtion to read a register value
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070085
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070086 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070087
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070088 \param regAddress - address (offset) of the register to be read from the start
89 of register space.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070090
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070091 \param pRegValue - pointer to the memory where the register contents are written
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070092
93 \return eHalStatus - status of the register read. Note that this function
94 can fail. In particular, when the card is removed, this function will return
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070095 a failure.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -070096
Jeff Johnsonf27cfb22013-04-09 13:03:14 -070097 -------------------------------------------------------------------------------*/
98eHalStatus palReadRegister( tHddHandle hHdd, tANI_U32 regAddress, tANI_U32 *pRegValue );
99
100
101/** ---------------------------------------------------------------------------
102
103 \fn palWriteRegister
104
105 \brief chip and bus agnostic funtion to write a register value
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700106
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700107 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700108
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700109 \param regAddress - address (offset) of the register to be read from the start
110 of register space.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700111
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700112 \param pRegValue - pointer to the value being written into the register
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700113
114 \return eHalStatus - status of the register read. Note that this function
115 can fail. In particular, when the card is removed, this function will return
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700116 a failure.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700117
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700118 -------------------------------------------------------------------------------*/
119eHalStatus palWriteRegister( tHddHandle hHdd, tANI_U32 regAddress, tANI_U32 regValue );
120
121/** ---------------------------------------------------------------------------
122
123 \fn palAsyncWriteRegister
124
125 \brief chip and bus agnostic async funtion to write a register value
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700126
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700127 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700128
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700129 \param regAddress - address (offset) of the register to be written from the start
130 of register space.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700131
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700132 \param regValue - value being written into the register
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700133
134 \return eHalStatus - status of the register write. Note that this function
135 can fail. In particular, when the card is removed, this function will return
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700136 a failure.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700137
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700138 -------------------------------------------------------------------------------*/
139
140eHalStatus palAsyncWriteRegister( tHddHandle hHdd, tANI_U32 regAddress, tANI_U32 regValue );
141
142
143/** ---------------------------------------------------------------------------
144
145 \fn palReadDeviceMemory
146
147 \brief chip and bus agnostic funtion to read memory from the chip
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700148
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700149 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700150
151 \param memOffset - address (offset) of the memory from the top of the
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700152 memory map (as exposed to the host) where the memory will be read from.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700153
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700154 \param pBuffer - pointer to a buffer where the memory will be placed in host
155 memory space after retreived from the chip.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700156
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700157 \param numBytes - the number of bytes to be read.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700158
159 \return eHalStatus - status of the memory read. Note that this function
160 can fail. In particular, when the card is removed, this function will return
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700161 a failure.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700162
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700163 -------------------------------------------------------------------------------*/
164eHalStatus palReadDeviceMemory( tHddHandle hHdd, tANI_U32 memOffset, tANI_U8 *pBuffer, tANI_U32 numBytes );
165
166/** ---------------------------------------------------------------------------
167
168 \fn palWriteDeviceMemory
169
170 \brief chip and bus agnostic funtion to write memory to the chip
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700171
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700172 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700173
174 \param memOffset - address (offset) of the memory from the top of the on-chip
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700175 memory that will be written.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700176
177 \param pBuffer - pointer to a buffer that has the source data that will be
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700178 written to the chip.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700179
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700180 \param numBytes - the number of bytes to be written.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700181
182 \return eHalStatus - status of the memory read. Note that this function
183 can fail. In particular, when the card is removed, this function will return
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700184 a failure.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700185
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700186 -------------------------------------------------------------------------------*/
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700187eHalStatus palWriteDeviceMemory( tHddHandle hHdd, tANI_U32 memOffset, tANI_U8 *pBuffer, tANI_U32 numBytes );
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700188
189
190/** ---------------------------------------------------------------------------
191
192 \fn palAllocateMemory
193
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700194 \brief OS agnostic funtion to allocate host memory.
195
196 \note Host memory that needs to be shared between the host and the
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700197 device needs to be allocated with the palAllocateSharedMemory()
198 and free'd with palFreeSharedMemory() functions.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700199
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700200 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700201
202 \param ppMemory - pointer to a void pointer where the address of the
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700203 memory allocated will be placed upon return from this function.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700204
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700205 \param numBytes - the number of bytes to allocate.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700206
207 \return eHalStatus - status of the register read. Note that this function
208 can fail. In the case of a failure, a non-successful return code will be
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700209 returned and no memory will be allocated (the *ppMemory will be NULL so don't
210 try to use it unless the status returns success).
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700211
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700212 -------------------------------------------------------------------------------*/
Madan Mohan Koyyalamudi218122c2013-07-24 17:10:40 +0530213#ifndef FEATURE_WLAN_PAL_MEM_DISABLE
214
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700215#ifdef MEMORY_DEBUG
216#define palAllocateMemory(hHdd, ppMemory, numBytes) palAllocateMemory_debug(hHdd, ppMemory, numBytes, __FILE__, __LINE__)
217eHalStatus palAllocateMemory_debug( tHddHandle hHdd, void **ppMemory, tANI_U32 numBytes, char* fileName, tANI_U32 lineNum );
218#else
219eHalStatus palAllocateMemory( tHddHandle hHdd, void **ppMemory, tANI_U32 numBytes );
220#endif
221
222
223/** ---------------------------------------------------------------------------
224
225 \fn palFreeMemory
226
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700227 \brief OS agnostic funtion to free host memory that was allocated with
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700228 palAllcoateMemory() calls.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700229
230 \note Host memory that needs to be shared between the host and the
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700231 device needs to be allocated with the palAllocateSharedMemory()
232 and free'd with palFreeSharedMemory() functions.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700233
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700234 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700235
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700236 \param pMemory - pointer to memory that will be free'd.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700237
238 \return eHalStatus - status of the register read. Note that this function
239 can fail. In the case of a failure, a non-successful return code will be
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700240 returned and no memory will be allocated (the *ppMemory will be NULL so don't
241 try to use it unless the status returns success).
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700242
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700243 -------------------------------------------------------------------------------*/
244eHalStatus palFreeMemory( tHddHandle hHdd, void *pMemory );
245
246
247
248/** ---------------------------------------------------------------------------
249
250 \fn palFillMemory
251
252 \brief OS agnostic funtion to fill host memory with a specified byte value
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700253
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700254 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700255
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700256 \param pMemory - pointer to memory that will be filled.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700257
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700258 \param numBytes - the number of bytes to be filled.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700259
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700260 \param fillValue - the byte to be written to fill the memory with.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700261
262 \return eHalStatus - status of the register read. Note that this function
263 can fail. In the case of a failure, a non-successful return code will be
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700264 returned and no memory will be allocated (the *ppMemory will be NULL so don't
265 try to use it unless the status returns success).
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700266
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700267 -------------------------------------------------------------------------------*/
268eHalStatus palFillMemory( tHddHandle hHdd, void *pMemory, tANI_U32 numBytes, tANI_BYTE fillValue );
269
270/** ---------------------------------------------------------------------------
271
272 \fn palCopyMemory
273
274 \brief OS agnostic funtion to copy host memory from one location to another
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700275
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700276 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700277
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700278 \param pSrc - pointer to source memory location (to copy from)
279
280 \param pSrc - pointer to destination memory location (to copy to)
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700281
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700282 \param numBytes - the number of bytes to be be copied.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700283
284 \return eHalStatus - status of the memory copy
285
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700286 -------------------------------------------------------------------------------*/
287eHalStatus palCopyMemory( tHddHandle hHdd, void *pDst, const void *pSrc, tANI_U32 numBytes );
288
289/** ---------------------------------------------------------------------------
290
291 \fn palFillMemory
292
293 \brief OS agnostic funtion to fill host memory with a specified byte value
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700294
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700295 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700296
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700297 \param pMemory - pointer to memory that will be filled.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700298
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700299 \param numBytes - the number of bytes to be filled.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700300
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700301 \param fillValue - the byte to be written to fill the memory with.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700302
303 \return eHalStatus - status of the register read. Note that this function
304 can fail. In the case of a failure, a non-successful return code will be
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700305 returned and no memory will be allocated (the *ppMemory will be NULL so don't
306 try to use it unless the status returns success).
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700307
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700308 -------------------------------------------------------------------------------*/
309ANI_INLINE_FUNCTION
310eHalStatus palZeroMemory( tHddHandle hHdd, void *pMemory, tANI_U32 numBytes )
311{
312 return( palFillMemory( hHdd, pMemory, numBytes, 0 ) );
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700313}
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700314
315
316/** ---------------------------------------------------------------------------
317
318 \fn palEqualMemory
319
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700320 \brief OS agnostic funtion to compare two pieces of memory, similar to
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700321 memcmp function in standard C.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700322
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700323 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700324
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700325 \param pMemory1 - pointer to one location in memory to compare.
326
327 \param pMemory2 - pointer to second location in memory to compare.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700328
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700329 \param numBytes - the number of bytes to compare.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700330
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700331 \return tANI_BOOLEAN - returns a boolean value that tells if the memory
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700332 locations are equal or now equal.
333
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700334 -------------------------------------------------------------------------------*/
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700335tANI_BOOLEAN palEqualMemory( tHddHandle hHdd, void *pMemory1, void *pMemory2, tANI_U32 numBytes );
Madan Mohan Koyyalamudi218122c2013-07-24 17:10:40 +0530336#endif
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700337/** ---------------------------------------------------------------------------
338
339 \fn palFillDeviceMemory
340
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700341 \brief OS agnostic funtion to fill device memory with a specified
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700342 32bit value
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700343
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700344 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700345
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700346 \param memOffset - offset of the memory on the device to fill.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700347
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700348 \param numBytes - the number of bytes to be filled.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700349
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700350 \param fillValue - the byte pattern to fill into memory on the device
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700351
352 \return eHalStatus - status of the register read. Note that this function
353 can fail.
354
355 eHAL_STATUS_DEVICE_MEMORY_LENGTH_ERROR - length of the device memory is not
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700356 a multiple of 4 bytes.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700357
358 eHAL_STATUS_DEVICE_MEMORY_MISALIGNED - memory address is not aligned on a
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700359 4 byte boundary.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700360
361 \note return failure if the memOffset is not 32bit aligned and not a
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700362 multiple of 4 bytes (the device does not support anything else).
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700363
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700364 -------------------------------------------------------------------------------*/
365eHalStatus palFillDeviceMemory( tHddHandle hHdd, tANI_U32 memOffset, tANI_U32 numBytes, tANI_BYTE fillValue );
366
367
368/** ---------------------------------------------------------------------------
369
370 \fn palZeroDeviceMemory
371
372 \brief OS agnostic funtion to fill device memory with a specified byte value
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700373
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700374 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700375
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700376 \param memOffset - offset of the memory on the device to fill.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700377
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700378 \param numBytes - the number of bytes to be filled.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700379
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700380 \param fillValue - the 32bit pattern to fill the memory with.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700381
382 \return eHalStatus - status of the register read. Note that this function
383 can fail.
384
385 eHAL_STATUS_DEVICE_MEMORY_LENGTH_ERROR - length of the device memory is not
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700386 a multiple of 4 bytes.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700387
388 eHAL_STATUS_DEVICE_MEMORY_MISALIGNED - memory address is not aligned on a
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700389 4 byte boundary.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700390
391 \note return failure if the memOffset is not 32bit aligned and not a
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700392 multiple of 4 bytes (the device does not support anything else).
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700393
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700394 -------------------------------------------------------------------------------*/
395ANI_INLINE_FUNCTION
396eHalStatus palZeroDeviceMemory( tHddHandle hHdd, tANI_U32 memOffset, tANI_U32 numBytes )
397{
398 return( palFillDeviceMemory( hHdd, memOffset, numBytes, 0 ) );
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700399}
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700400
401/*----------------------------------------------------------------------------------
402
403 Allocate a packet for sending through the Tx APIs.
404
405 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700406
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700407 \param frmType - Frame type
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700408
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700409 \param size
410
411 \param data -
412
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700413 \param ppPacket -
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700414
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700415 \return eHalStatus -
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700416----------------------------------------------------------------------------------*/
417eHalStatus palPktAlloc(tHddHandle hHdd, eFrameType frmType, tANI_U16 size, void **data, void **ppPacket) ;
418
419
420// This should return Ssome sort of status.....
421void palPktFree( tHddHandle hHdd, eFrameType frmType, void* buf, void *pPacket);
422
423
424
425//PAL lock functions
426//pHandle -- pointer to a caller allocated tPalSpinLockHandle object
427eHalStatus palSpinLockAlloc( tHddHandle hHdd, tPalSpinLockHandle *pHandle );
428//hSpinLock -- a handle returned by palSpinLockAlloc
429eHalStatus palSpinLockFree( tHddHandle hHdd, tPalSpinLockHandle hSpinLock );
430//hSpinLock -- a handle returned by palSpinLockAlloc
431eHalStatus palSpinLockTake( tHddHandle hHdd, tPalSpinLockHandle hSpinLock );
432//hSpinLock -- a handle returned by palSpinLockAlloc
433eHalStatus palSpinLockGive( tHddHandle hHdd, tPalSpinLockHandle hSpinLock );
434//PAL lock functions end
435
436
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700437//This function send a message to MAC,
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700438//pMsgBuf is a buffer allocated by caller. The actual structure varies base on message type
439//The beginning of the buffer can always map to tSirMbMsg
440//This function must take care of padding if it is required for the OS
441eHalStatus palSendMBMessage(tHddHandle hHdd, void *pBuf);
442
443extern void palGetUnicastStats(tHddHandle hHdd, tANI_U32 *tx, tANI_U32 *rx);
444
445
446/*----------------------------------------------------------------------------------
447 this function is to return a tick count (one tick = ~10ms). It is used to calculate
448 time difference.
449
450 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700451
452 \return tick count.
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700453----------------------------------------------------------------------------------*/
Deepthi Gowri6a08e312016-03-31 19:10:14 +0530454tANI_TIMESTAMP palGetTickCount(tHddHandle hHdd);
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700455
456/** ---------------------------------------------------------------------------
457
458 \fn palReadRegMemory
459
460 \brief chip and bus agnostic function to read memory from the PHY register space as memory
461 i.e. to read more than 4 bytes from the contiguous register space
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700462
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700463 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700464
465 \param memOffset - address (offset) of the memory from the top of the
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700466 memory map (as exposed to the host) where the memory will be read from.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700467
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700468 \param pBuffer - pointer to a buffer where the memory will be placed in host
469 memory space after retreived from the chip.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700470
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700471 \param numBytes - the number of bytes to be read.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700472
473 \return eHalStatus - status of the memory read. Note that this function
474 can fail. In particular, when the card is removed, this function will return
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700475 a failure.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700476
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700477 -------------------------------------------------------------------------------*/
478eHalStatus palReadRegMemory( tHddHandle hHdd, tANI_U32 memOffset, tANI_U8 *pBuffer, tANI_U32 numBytes );
479
480/** ---------------------------------------------------------------------------
481
482 \fn palAsyncWriteRegMemory
483
484 \brief chip and bus agnostic function to write memory to the PHY register space as memory
485 i.e. to write more than 4 bytes from the contiguous register space. In USB interface, this
486 API does the write asynchronously.
487
488 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700489
490 \param memOffset - address (offset) of the memory from the top of the on-chip
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700491 memory that will be written.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700492
493 \param pBuffer - pointer to a buffer that has the source data that will be
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700494 written to the chip.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700495
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700496 \param numBytes - the number of bytes to be written.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700497
498 \return eHalStatus - status of the memory read. Note that this function
499 can fail. In particular, when the card is removed, this function will return
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700500 a failure.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700501
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700502 -------------------------------------------------------------------------------*/
503eHalStatus palAsyncWriteRegMemory( tHddHandle hHdd, tANI_U32 memOffset, tANI_U8 *pBuffer, tANI_U32 numBytes );
504
505/** ---------------------------------------------------------------------------
506
507 \fn palWriteRegMemory
508 \brief chip and bus agnostic function to write memory to the PHY register space as memory
509 i.e. to write more than 4 bytes from the contiguous register space. The difference from the
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700510 above routine is, in USB interface, this routine performs the write synchronously where as
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700511 the above routine performs it asynchronously.
512
513 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700514
515 \param memOffset - address (offset) of the memory from the top of the on-chip
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700516 memory that will be written.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700517
518 \param pBuffer - pointer to a buffer that has the source data that will be
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700519 written to the chip.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700520
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700521 \param numBytes - the number of bytes to be written.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700522
523 \return eHalStatus - status of the memory read. Note that this function
524 can fail. In particular, when the card is removed, this function will return
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700525 a failure.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700526
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700527 -------------------------------------------------------------------------------*/
528eHalStatus palWriteRegMemory( tHddHandle hHdd, tANI_U32 memOffset, tANI_U8 *pBuffer, tANI_U32 numBytes );
529
530
531/** ---------------------------------------------------------------------------
532
533 \fn palWaitRegVal
534
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700535 \brief is a blocking function which reads the register and waits for the given number of iterations
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700536 until the read value matches the waitRegVal. The delay between is perIterWaitInNanoSec(in nanoseconds)
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700537
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700538 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700539
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700540 \param reg - address of the register to be read
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700541
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700542 \param mask - mask to be applied for the read value
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700543
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700544 \param waitRegVal - expected value from the register after applying the mask.
545
546 \param perIterWaitInNanoSec - delay between the two iterations in nanoseconds
547
548 \param numIter - max number of reads before the timeout
549
550 \param pReadRegVal - the value read from the register
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700551
552 \return eHalStatus - status of the memory read. Note that this function
553 can fail. In particular, when the card is removed, this function will return
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700554 a failure.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700555
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700556 -------------------------------------------------------------------------------*/
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700557eHalStatus palWaitRegVal( tHddHandle hHdd, tANI_U32 reg, tANI_U32 mask,
558 tANI_U32 waitRegVal, tANI_U32 perIterWaitInNanoSec,
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700559 tANI_U32 numIter, tANI_U32 *pReadRegVal );
560
561/** ---------------------------------------------------------------------------
562
563 \fn palReadModifyWriteReg
564
565 \brief chip and bus agnostic function to read a PHY register apply the given masks(AND and OR masks)
566 and writes back the new value to the register
567
568 \param hHdd - HDD context handle
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700569
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700570 \param reg - address of the register to be modified.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700571
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700572 \param andMask - The value read will be ANDed with this mask
573
574 \parma orMask - The value after applying the andMask will be ORed with this value
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700575
576 \return eHalStatus - status of the memory read. Note that this function
577 can fail. In particular, when the card is removed, this function will return
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700578 a failure.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700579
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700580 -------------------------------------------------------------------------------*/
581eHalStatus palReadModifyWriteReg( tHddHandle hHdd, tANI_U32 reg, tANI_U32 andMask, tANI_U32 orMask );
582
583//PAL semaphore functions
584eHalStatus palSemaphoreAlloc( tHddHandle hHdd, tPalSemaphoreHandle *pHandle, tANI_S32 count );
585eHalStatus palSemaphoreFree( tHddHandle hHdd, tPalSemaphoreHandle hSemaphore );
586eHalStatus palSemaphoreTake( tHddHandle hHdd, tPalSemaphoreHandle hSemaphore );
587eHalStatus palSemaphoreGive( tHddHandle hHdd, tPalSemaphoreHandle hSemaphore );
588eHalStatus palMutexAlloc( tHddHandle hHdd, tPalSemaphoreHandle *pHandle) ;
589eHalStatus palMutexAllocLocked( tHddHandle hHdd, tPalSemaphoreHandle *pHandle) ;
590
591//PAL irq/softirq
592eAniBoolean pal_in_interrupt(void) ;
593void pal_local_bh_disable(void) ;
594void pal_local_bh_enable(void) ;
595
596//PAL byte swap
597tANI_U32 pal_be32_to_cpu(tANI_U32 x) ;
598tANI_U32 pal_cpu_to_be32(tANI_U32 x) ;
599tANI_U16 pal_be16_to_cpu(tANI_U16 x) ;
600tANI_U16 pal_cpu_to_be16(tANI_U16 x) ;
601
602
603#if defined( ANI_LITTLE_BYTE_ENDIAN )
604
605// Need to eliminate these and use the ani_cpu_to_le, etc. macros....
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700606ANI_INLINE_FUNCTION unsigned long i_htonl( unsigned long ul )
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700607{
608 return( ( ( ul & 0x000000ff ) << 24 ) |
609 ( ( ul & 0x0000ff00 ) << 8 ) |
610 ( ( ul & 0x00ff0000 ) >> 8 ) |
611 ( ( ul & 0xff000000 ) >> 24 ) );
612}
613
614ANI_INLINE_FUNCTION unsigned short i_htons( unsigned short us )
615{
616 return( ( ( us >> 8 ) & 0x00ff ) + ( ( us << 8 ) & 0xff00 ) );
617}
618
619ANI_INLINE_FUNCTION unsigned short i_ntohs( unsigned short us )
620{
621 return( i_htons( us ) );
622}
623
624ANI_INLINE_FUNCTION unsigned long i_ntohl( unsigned long ul )
625{
626 return( i_htonl( ul ) );
627}
628
629#endif //#if defined( ANI_LITTLE_BYTE_ENDIAN )
630
631
632/** ---------------------------------------------------------------------------
633
634 \fn pal_set_U32
635
636 \brief Assign 32-bit unsigned value to a byte array base on CPU's endianness.
637
638 \note Caller must validate the byte array has enough space to hold the vlaue
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700639
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700640 \param ptr - Starting address of a byte array
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700641
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700642 \param value - The value to assign to the byte array
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700643
644 \return - The address to the byte after the assignment. This may or may not
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700645 be valid. Caller to verify.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700646
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700647 -------------------------------------------------------------------------------*/
648ANI_INLINE_FUNCTION tANI_U8 * pal_set_U32(tANI_U8 *ptr, tANI_U32 value)
649{
650#if defined( ANI_BIG_BYTE_ENDIAN )
651 *(ptr) = ( tANI_U8 )( value >> 24 );
652 *(ptr + 1) = ( tANI_U8 )( value >> 16 );
653 *(ptr + 2) = ( tANI_U8 )( value >> 8 );
654 *(ptr + 3) = ( tANI_U8 )( value );
655#else
656 *(ptr + 3) = ( tANI_U8 )( value >> 24 );
657 *(ptr + 2) = ( tANI_U8 )( value >> 16 );
658 *(ptr + 1) = ( tANI_U8 )( value >> 8 );
659 *(ptr) = ( tANI_U8 )( value );
660#endif
661
662 return (ptr + 4);
663}
664
665
666/** ---------------------------------------------------------------------------
667
668 \fn pal_set_U16
669
670 \brief Assign 16-bit unsigned value to a byte array base on CPU's endianness.
671
672 \note Caller must validate the byte array has enough space to hold the vlaue
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700673
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700674 \param ptr - Starting address of a byte array
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700675
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700676 \param value - The value to assign to the byte array
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700677
678 \return - The address to the byte after the assignment. This may or may not
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700679 be valid. Caller to verify.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700680
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700681 -------------------------------------------------------------------------------*/
682ANI_INLINE_FUNCTION tANI_U8 * pal_set_U16(tANI_U8 *ptr, tANI_U16 value)
683{
684#if defined( ANI_BIG_BYTE_ENDIAN )
685 *(ptr) = ( tANI_U8 )( value >> 8 );
686 *(ptr + 1) = ( tANI_U8 )( value );
687#else
688 *(ptr + 1) = ( tANI_U8 )( value >> 8 );
689 *(ptr) = ( tANI_U8 )( value );
690#endif
691
692 return (ptr + 2);
693}
694
695
696/** ---------------------------------------------------------------------------
697
698 \fn pal_get_U16
699
700 \brief Retrieve a 16-bit unsigned value from a byte array base on CPU's endianness.
701
702 \note Caller must validate the byte array has enough space to hold the vlaue
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700703
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700704 \param ptr - Starting address of a byte array
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700705
706 \param pValue - Pointer to a caller allocated buffer for 16 bit value. Value is to assign
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700707 to this location.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700708
709 \return - The address to the byte after the assignment. This may or may not
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700710 be valid. Caller to verify.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700711
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700712 -------------------------------------------------------------------------------*/
713ANI_INLINE_FUNCTION tANI_U8 * pal_get_U16(tANI_U8 *ptr, tANI_U16 *pValue)
714{
715#if defined( ANI_BIG_BYTE_ENDIAN )
716 *pValue = (((tANI_U16) (*ptr << 8)) |
717 ((tANI_U16) (*(ptr+1))));
718#else
719 *pValue = (((tANI_U16) (*(ptr+1) << 8)) |
720 ((tANI_U16) (*ptr)));
721#endif
722
723 return (ptr + 2);
724}
725
726
727/** ---------------------------------------------------------------------------
728
729 \fn pal_get_U32
730
731 \brief Retrieve a 32-bit unsigned value from a byte array base on CPU's endianness.
732
733 \note Caller must validate the byte array has enough space to hold the vlaue
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700734
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700735 \param ptr - Starting address of a byte array
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700736
737 \param pValue - Pointer to a caller allocated buffer for 32 bit value. Value is to assign
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700738 to this location.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700739
740 \return - The address to the byte after the assignment. This may or may not
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700741 be valid. Caller to verify.
Gopichand Nakkala68d9d642013-04-17 20:22:17 -0700742
Jeff Johnsonf27cfb22013-04-09 13:03:14 -0700743 -------------------------------------------------------------------------------*/
744ANI_INLINE_FUNCTION tANI_U8 * pal_get_U32(tANI_U8 *ptr, tANI_U32 *pValue)
745{
746#if defined( ANI_BIG_BYTE_ENDIAN )
747 *pValue = ( (tANI_U32)(*(ptr) << 24) |
748 (tANI_U32)(*(ptr+1) << 16) |
749 (tANI_U32)(*(ptr+2) << 8) |
750 (tANI_U32)(*(ptr+3)) );
751#else
752 *pValue = ( (tANI_U32)(*(ptr+3) << 24) |
753 (tANI_U32)(*(ptr+2) << 16) |
754 (tANI_U32)(*(ptr+1) << 8) |
755 (tANI_U32)(*(ptr)) );
756#endif
757
758 return (ptr + 4);
759}
760
761
762#endif