2 * Copyright (c) 2007-2008 Atheros Communications Inc.
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #include "../oal_dt.h"
23 /* Buffer management */
24 #ifdef ZM_ENABLE_BUFFER_DEBUG
25 extern zbuf_t
* zfwBufAllocateWithContext(zdev_t
* dev
, u16_t len
, u8_t
*functionName
, ULONG line
);
26 #define zfwBufAllocate(dev, len) zfwBufAllocateWithContext(dev, len, (u8_t *)__func__, __LINE__)
28 extern zbuf_t
* zfwBufAllocate(zdev_t
* dev
, u16_t len
);
30 extern void zfwBufFree(zdev_t
* dev
, zbuf_t
* buf
, u16_t errCode
);
31 extern u16_t
zfwBufChain(zdev_t
* dev
, zbuf_t
** head
, zbuf_t
* tail
);
32 extern u16_t
zfwBufCopy(zdev_t
* dev
, zbuf_t
* dst
, zbuf_t
* src
);
33 extern u16_t
zfwBufSetSize(zdev_t
* dev
, zbuf_t
* buf
, u16_t size
);
34 extern u16_t
zfwBufRemoveHead(zdev_t
* dev
, zbuf_t
* buf
, u16_t size
);
35 extern u16_t
zfwBufGetSize(zdev_t
* dev
, zbuf_t
* buf
);
36 extern void zfwCopyBufContext(zdev_t
* dev
, zbuf_t
* source
, zbuf_t
* dest
);
38 /* Memory management */
39 extern void* zfwMemAllocate(zdev_t
* dev
, u32_t size
);
40 extern void zfwMemFree(zdev_t
* dev
, void* mem
, u32_t size
);
41 extern void zfwMemoryCopy(u8_t
* dst
, u8_t
* src
, u16_t length
);
42 extern void zfwMemoryMove(u8_t
* dst
, u8_t
* src
, u16_t length
);
43 extern void zfwZeroMemory(u8_t
* va
, u16_t length
);
44 extern u8_t
zfwMemoryIsEqual(u8_t
* m1
, u8_t
* m2
, u16_t length
);
47 extern void zfwSleep(zdev_t
* dev
, u32_t ms
);
48 extern u16_t
zfwGetVapId(zdev_t
* dev
);
49 extern u16_t
zfwStaAddIeWpaRsn(zdev_t
* dev
, zbuf_t
* buf
, u16_t offset
, u8_t frameType
);
50 extern u32_t
zfwWaitForEvent(zdev_t
*dev
, u32_t event
, u32_t timeout
);
51 extern void zfwSendEvent(zdev_t
* dev
);
52 extern void zfwGetActiveScanDur(zdev_t
* dev
, u8_t
* Dur
);
53 extern void zfwGetShowZeroLengthSSID(zdev_t
* dev
, u8_t
* Dur
);
55 extern void zfwDumpBuf(zdev_t
* dev
, zbuf_t
* buf
);
56 extern void zfwDbgReadRegDone(zdev_t
* dev
, u32_t addr
, u32_t val
);
58 extern void zfwDbgDownloadFwInitDone(zdev_t
* dev
);
59 extern void zfwDbgReadFlashDone(zdev_t
* dev
, u32_t addr
, u32_t
* rspdata
, u32_t datalen
);
60 extern void zfwDbgGetFlashChkSumDone(zdev_t
* dev
, u32_t
* rspdata
);
61 extern void zfwDbgProgrameFlashDone(zdev_t
* dev
);
62 extern void zfwDbgProgrameFlashChkDone(zdev_t
* dev
);
63 extern void zfwDbgWriteRegDone(zdev_t
* dev
, u32_t addr
, u32_t val
);
64 extern void zfwDbgWriteEepromDone(zdev_t
* dev
, u32_t addr
, u32_t val
);
65 extern void zfwDbgReadTallyDone(zdev_t
* dev
);
66 extern void zfwWlanReadRegDone(zdev_t
* dev
, u32_t addr
, u32_t val
);
67 extern void zfwWlanWriteRegDone(zdev_t
* dev
, u32_t addr
, u32_t val
);
68 extern void zfwWlanReadTallyDone(zdev_t
* dev
);
69 extern void zfwDbgQueryHwTxBusyDone(zdev_t
* dev
, u32_t val
);
70 extern u32_t
zfwReadReg(zdev_t
* dev
, u32_t offset
);
71 extern u32_t
zfwReadEeprom(zdev_t
* dev
, u32_t addr
);
73 /* Reserved for Vista, please return 0 */
74 extern u8_t
zfwGetPktEncExemptionActionType(zdev_t
* dev
, zbuf_t
* buf
);
77 /* Reserved for CENC, please return 0 */
78 extern u8_t
zfwCencHandleBeaconProbrespon(zdev_t
* dev
, u8_t
*pWIEc
,
79 u8_t
*pPeerSSIDc
, u8_t
*pPeerAddrc
);
80 #endif //ZM_ENABLE_CENC
82 #ifdef ZM_HALPLUS_LOCK
83 extern asmlinkage
struct zsWlanDev
*zfwGetWlanDev(zdev_t
* dev
);
84 extern asmlinkage
void zfwEnterCriticalSection(zdev_t
* dev
);
85 extern asmlinkage
void zfwLeaveCriticalSection(zdev_t
* dev
);
86 extern asmlinkage u8_t
zfwBufReadByte(zdev_t
* dev
, zbuf_t
* buf
, u16_t offset
);
87 extern asmlinkage u16_t
zfwBufReadHalfWord(zdev_t
* dev
, zbuf_t
* buf
, u16_t offset
);
88 extern asmlinkage
void zfwBufWriteByte(zdev_t
* dev
, zbuf_t
* buf
, u16_t offset
, u8_t value
);
89 extern asmlinkage
void zfwBufWriteHalfWord(zdev_t
* dev
, zbuf_t
* buf
, u16_t offset
, u16_t value
);
90 extern asmlinkage u8_t
*zfwGetBuffer(zdev_t
* dev
, zbuf_t
* buf
);