Merge branch 'for-linus' of git://www.jni.nu/cris
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / staging / otus / 80211core / cfunc.h
CommitLineData
4bd43f50
LR
1/*
2 * Copyright (c) 2007-2008 Atheros Communications Inc.
3 *
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.
7 *
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.
15 */
16/* */
17/* Module Name : func_extr.c */
18/* */
19/* Abstract */
20/* This module contains function prototype. */
21/* */
22/* NOTES */
23/* None */
24/* */
25/************************************************************************/
26
27#ifndef _CFUNC_H
28#define _CFUNC_H
29
30#include "queue.h"
31
32/* amsdu.c */
33void zfDeAmsdu(zdev_t* dev, zbuf_t* buf, u16_t vap, u8_t encryMode);
34
35/* cscanmgr.c */
36void zfScanMgrInit(zdev_t* dev);
37u8_t zfScanMgrScanStart(zdev_t* dev, u8_t scanType);
38void zfScanMgrScanStop(zdev_t* dev, u8_t scanType);
39void zfScanMgrScanAck(zdev_t* dev);
40
41/* cpsmgr.c */
42void zfPowerSavingMgrInit(zdev_t* dev);
43void zfPowerSavingMgrSetMode(zdev_t* dev, u8_t mode);
44void zfPowerSavingMgrMain(zdev_t* dev);
45void zfPowerSavingMgrWakeup(zdev_t* dev);
46u8_t zfPowerSavingMgrIsSleeping(zdev_t *dev);
47void zfPowerSavingMgrProcessBeacon(zdev_t* dev, zbuf_t* buf);
48void zfPowerSavingMgrAtimWinExpired(zdev_t* dev);
49void zfPowerSavingMgrConnectNotify(zdev_t *dev);
50void zfPowerSavingMgrPreTBTTInterrupt(zdev_t *dev);
51
52/* ccmd.c */
53u16_t zfWlanEnable(zdev_t* dev);
54
55/* cfunc.c */
56u8_t zfQueryOppositeRate(zdev_t* dev, u8_t dst_mac[6], u8_t frameType);
57void zfCopyToIntTxBuffer(zdev_t* dev, zbuf_t* buf, u8_t* src,
58 u16_t offset, u16_t length);
59void zfCopyToRxBuffer(zdev_t* dev, zbuf_t* buf, u8_t* src,
60 u16_t offset, u16_t length);
61void zfCopyFromIntTxBuffer(zdev_t* dev, zbuf_t* buf, u8_t* dst,
62 u16_t offset, u16_t length);
63void zfCopyFromRxBuffer(zdev_t* dev, zbuf_t* buf, u8_t* dst,
64 u16_t offset, u16_t length);
65void zfMemoryCopy(u8_t* dst, u8_t* src, u16_t length);
66void zfMemoryMove(u8_t* dst, u8_t* src, u16_t length);
67void zfZeroMemory(u8_t* va, u16_t length);
68u8_t zfMemoryIsEqual(u8_t* m1, u8_t* m2, u16_t length);
69u8_t zfRxBufferEqualToStr(zdev_t* dev, zbuf_t* buf, const u8_t* str,
70 u16_t offset, u16_t length);
71void zfTxBufferCopy(zdev_t*dev, zbuf_t* dst, zbuf_t* src,
72 u16_t dstOffset, u16_t srcOffset, u16_t length);
73void zfRxBufferCopy(zdev_t*dev, zbuf_t* dst, zbuf_t* src,
74 u16_t dstOffset, u16_t srcOffset, u16_t length);
75
76void zfCollectHWTally(zdev_t*dev, u32_t* rsp, u8_t id);
77void zfTimerInit(zdev_t* dev);
78u16_t zfTimerSchedule(zdev_t* dev, u16_t event, u32_t tick);
79u16_t zfTimerCancel(zdev_t* dev, u16_t event);
80void zfTimerClear(zdev_t* dev);
81u16_t zfTimerCheckAndHandle(zdev_t* dev);
82void zfProcessEvent(zdev_t* dev, u16_t* eventArray, u8_t eventCount);
83
84void zfBssInfoCreate(zdev_t* dev);
85void zfBssInfoDestroy(zdev_t* dev);
86
87struct zsBssInfo* zfBssInfoAllocate(zdev_t* dev);
88void zfBssInfoFree(zdev_t* dev, struct zsBssInfo* pBssInfo);
89void zfBssInfoReorderList(zdev_t* dev);
90void zfBssInfoInsertToList(zdev_t* dev, struct zsBssInfo* pBssInfo);
91void zfBssInfoRemoveFromList(zdev_t* dev, struct zsBssInfo* pBssInfo);
92void zfBssInfoRefresh(zdev_t* dev, u16_t mode);
93void zfCoreSetFrequencyComplete(zdev_t* dev);
94void zfCoreSetFrequency(zdev_t* dev, u16_t frequency);
95void zfCoreSetFrequencyV2(zdev_t* dev, u16_t frequency,
96 zfpFreqChangeCompleteCb cb);
97void zfCoreSetFrequencyEx(zdev_t* dev, u16_t frequency, u8_t bw40,
98 u8_t extOffset, zfpFreqChangeCompleteCb cb);
99void zfCoreSetFrequencyExV2(zdev_t* dev, u16_t frequency, u8_t bw40,
100 u8_t extOffset, zfpFreqChangeCompleteCb cb, u8_t forceSetFreq);
101void zfReSetCurrentFrequency(zdev_t* dev);
102u32_t zfCoreSetKey(zdev_t* dev, u8_t user, u8_t keyId, u8_t type,
103 u16_t* mac, u32_t* key);
104void zfCoreSetKeyComplete(zdev_t* dev);
105void zfCoreReinit(zdev_t* dev);
106void zfCoreMacAddressNotify(zdev_t* dev, u8_t *addr);
107void zfCoreSetIsoName(zdev_t* dev, u8_t* isoName);
108void zfGenerateRandomBSSID(zdev_t* dev, u8_t *MACAddr, u8_t *BSSID);
109void zfCoreHalInitComplete(zdev_t* dev);
110
111u16_t zfFindCleanFrequency(zdev_t* dev, u32_t adhocMode);
112u16_t zfFindMinimumUtilizationChannelIndex(zdev_t* dev, u16_t* array, u16_t count);
113u8_t zfCompareWithBssid(zdev_t* dev, u16_t* bssid);
114
115/* chb.c */
116void zfDumpBssList(zdev_t* dev);
117
118
119u16_t zfIssueCmd(zdev_t* dev, u32_t* cmd, u16_t cmdLen, u16_t src, u8_t* buf);
120
121
122/* cic.c */
123void zfUpdateBssid(zdev_t* dev, u8_t* bssid);
124void zfResetSupportRate(zdev_t* dev, u8_t type);
125void zfUpdateSupportRate(zdev_t* dev, u8_t* rateArray);
126u8_t zfIsGOnlyMode(zdev_t* dev, u16_t frequency, u8_t* rateArray);
127void zfGatherBMode(zdev_t* dev, u8_t* rateArray, u8_t* extrateArray);
128u8_t zfPSDeviceSleep(zdev_t* dev);
129u16_t zfGetRandomNumber(zdev_t* dev, u16_t initValue);
130void zfCoreEvent(zdev_t* dev, u16_t event, u8_t* rsp);
131void zfBeaconCfgInterrupt(zdev_t* dev, u8_t* rsp);
132void zfEndOfAtimWindowInterrupt(zdev_t* dev);
133
134/* cinit.c */
135u16_t zfTxGenWlanHeader(zdev_t* dev, zbuf_t* buf, u16_t* header, u16_t seq,
136 u8_t flag, u16_t plusLen, u16_t minusLen, u16_t port,
137 u16_t* da, u16_t* sa, u8_t up, u16_t *micLen,
138 u16_t* snap, u16_t snapLen, struct aggControl *aggControl);
139u16_t zfTxGenMmHeader(zdev_t* dev, u8_t frameType, u16_t* dst,
140 u16_t* header, u16_t len, zbuf_t* buf, u16_t vap, u8_t encrypt);
141void zfInitMacApMode(zdev_t* dev);
142u16_t zfChGetNextChannel(zdev_t* dev, u16_t frequency, u8_t* pbPassive);
143u16_t zfChGetFirstChannel(zdev_t* dev, u8_t* pbPassive);
144u16_t zfChGetFirst2GhzChannel(zdev_t* dev);
145u16_t zfChGetFirst5GhzChannel(zdev_t* dev);
146u16_t zfChGetLastChannel(zdev_t* dev, u8_t* pbPassive);
147u16_t zfChGetLast5GhzChannel(zdev_t* dev);
148u16_t zfChNumToFreq(zdev_t* dev, u8_t ch, u8_t freqBand);
149u8_t zfChFreqToNum(u16_t freq, u8_t* bIs5GBand);
150
151/* cmm.c */
152void zfProcessManagement(zdev_t* dev, zbuf_t* buf, struct zsAdditionInfo* AddInfo); //CWYang(m)
153void zfSendMmFrame(zdev_t* dev, u8_t frameType, u16_t* dst,
154 u32_t p1, u32_t p2, u32_t p3);
155u16_t zfFindElement(zdev_t* dev, zbuf_t* buf, u8_t eid);
156u16_t zfFindWifiElement(zdev_t* dev, zbuf_t* buf, u8_t type, u8_t subtype);
157u16_t zfFindSuperGElement(zdev_t* dev, zbuf_t* buf, u8_t type);
158u16_t zfFindXRElement(zdev_t* dev, zbuf_t* buf, u8_t type);
159u16_t zfRemoveElement(zdev_t* dev, u8_t* buf, u16_t size, u8_t eid);
160u16_t zfUpdateElement(zdev_t* dev, u8_t* buf, u16_t size, u8_t* updateeid);
161void zfProcessProbeReq(zdev_t* dev, zbuf_t* buf, u16_t* src);
162void zfProcessProbeRsp(zdev_t* dev, zbuf_t* buf, struct zsAdditionInfo* AddInfo);
163u16_t zfSendProbeReq(zdev_t* dev, zbuf_t* buf, u16_t offset, u8_t bWithSSID);
164u16_t zfMmAddIeSupportRate(zdev_t* dev, zbuf_t* buf,
165 u16_t offset, u8_t eid, u8_t rateSet);
166u16_t zfMmAddIeDs(zdev_t* dev, zbuf_t* buf, u16_t offset);
167u16_t zfMmAddIeErp(zdev_t* dev, zbuf_t* buf, u16_t offset);
168void zfUpdateDefaultQosParameter(zdev_t* dev, u8_t mode);
169u16_t zfMmAddIeWpa(zdev_t* dev, zbuf_t* buf, u16_t offset, u16_t apId);
170u16_t zfMmAddHTCapability(zdev_t* dev, zbuf_t* buf, u16_t offset); //CWYang(+)
171u16_t zfMmAddPreNHTCapability(zdev_t* dev, zbuf_t* buf, u16_t offset);
172u16_t zfMmAddExtendedHTCapability(zdev_t* dev, zbuf_t* buf, u16_t offset); //CWYang(+)
173u16_t zfFindATHExtCap(zdev_t* dev, zbuf_t* buf, u8_t type, u8_t subtype);
174u16_t zfFindBrdcmMrvlRlnkExtCap(zdev_t* dev, zbuf_t* buf);
175u16_t zfFindMarvelExtCap(zdev_t* dev, zbuf_t* buf);
176u16_t zfFindBroadcomExtCap(zdev_t* dev, zbuf_t* buf);
177u16_t zfFindRlnkExtCap(zdev_t* dev, zbuf_t* buf);
178
179/* cmmap.c */
180void zfMmApTimeTick(zdev_t* dev);
181void zfApAgingSta(zdev_t* dev);
182u16_t zfApAddSta(zdev_t* dev, u16_t* addr, u16_t state, u16_t apId, u8_t type,
183 u8_t qosType, u8_t qosInfo);
184void zfApProtctionMonitor(zdev_t* dev);
185void zfApProcessBeacon(zdev_t* dev, zbuf_t* buf);
186void zfApProcessAuth(zdev_t* dev, zbuf_t* buf, u16_t* src, u16_t apId);
187void zfApProcessAsocReq(zdev_t* dev, zbuf_t* buf, u16_t* src, u16_t apId);
188void zfApProcessAsocRsp(zdev_t* dev, zbuf_t* buf);
189void zfApProcessDeauth(zdev_t* dev, zbuf_t* buf, u16_t* src, u16_t apId);
190void zfApProcessDisasoc(zdev_t* dev, zbuf_t* buf, u16_t* src, u16_t apId);
191void zfApProcessProbeRsp(zdev_t* dev, zbuf_t* buf, struct zsAdditionInfo* AddInfo);
192void zfApStoreAsocReqIe(zdev_t* dev, zbuf_t* buf, u16_t aid);
193u16_t zfApAddIeSsid(zdev_t* dev, zbuf_t* buf, u16_t offset, u16_t vap);
194void zfApSendBeacon(zdev_t* dev);
195u16_t zfApGetSTAInfo(zdev_t* dev, u16_t* addr, u16_t* state, u8_t* vap);
196u16_t zfIntrabssForward(zdev_t* dev, zbuf_t* buf, u8_t srcVap);
197u16_t zfApBufferPsFrame(zdev_t* dev, zbuf_t* buf, u16_t port);
198void zfApInitStaTbl(zdev_t* dev);
199void zfApGetStaTxRateAndQosType(zdev_t* dev, u16_t* addr, u32_t* phyCtrl,
200 u8_t* qosType, u16_t* rcProbingFlag);
201void zfApGetStaQosType(zdev_t* dev, u16_t* addr, u8_t* qosType);
202void zfApSetStaTxRate(zdev_t* dev, u16_t* addr, u32_t phyCtrl);
203struct zsMicVar* zfApGetRxMicKey(zdev_t* dev, zbuf_t* buf);
204struct zsMicVar* zfApGetTxMicKey(zdev_t* dev, zbuf_t* buf, u8_t* qosType);
205u16_t zfApAddIeWmePara(zdev_t* dev, zbuf_t* buf, u16_t offset, u16_t vap);
206u16_t zfApUpdatePsBit(zdev_t* dev, zbuf_t* buf, u8_t* vap, u8_t* uapsdTrig);
207void zfApProcessPsPoll(zdev_t* dev, zbuf_t* buf);
208u16_t zfApFindSta(zdev_t* dev, u16_t* addr);
209void zfApGetStaEncryType(zdev_t* dev, u16_t* addr, u8_t* encryType);
210void zfApGetStaWpaIv(zdev_t* dev, u16_t* addr, u16_t* iv16, u32_t* iv32);
211void zfApSetStaWpaIv(zdev_t* dev, u16_t* addr, u16_t iv16, u32_t iv32);
212void zfApClearStaKey(zdev_t* dev, u16_t* addr);
213#ifdef ZM_ENABLE_CENC
214void zfApGetStaCencIvAndKeyIdx(zdev_t* dev, u16_t* addr, u32_t *iv,
215 u8_t *keyIdx);
216void zfApSetStaCencIv(zdev_t* dev, u16_t* addr, u32_t *iv);
217#endif //ZM_ENABLE_CENC
218void zfApSetProtectionMode(zdev_t* dev, u16_t mode);
219void zfApFlushBufferedPsFrame(zdev_t* dev);
220void zfApSendFailure(zdev_t* dev, u8_t* addr);
221u8_t zfApRemoveFromPsQueue(zdev_t* dev, u16_t id, u16_t* src);
222void zfApProcessAction(zdev_t* dev, zbuf_t* buf);
223/* cmmsta.c */
224void zfMmStaTimeTick(zdev_t* dev);
225void zfReWriteBeaconStartAddress(zdev_t* dev); // Mxzeng
226void zfStaProcessBeacon(zdev_t* dev, zbuf_t* buf, struct zsAdditionInfo* AddInfo); //CWYang(m)
227void zfStaProcessAuth(zdev_t* dev, zbuf_t* buf, u16_t* src, u16_t apId);
228void zfStaProcessAsocReq(zdev_t* dev, zbuf_t* buf, u16_t* src, u16_t apId);
229void zfStaProcessAsocRsp(zdev_t* dev, zbuf_t* buf);
230void zfStaProcessDeauth(zdev_t* dev, zbuf_t* buf);
231void zfStaProcessDisasoc(zdev_t* dev, zbuf_t* buf);
232void zfStaProcessProbeRsp(zdev_t* dev, zbuf_t* buf, struct zsAdditionInfo* AddInfo);
233void zfStaProcessAtim(zdev_t* dev, zbuf_t* buf);
234void zfStaStoreAsocRspIe(zdev_t* dev, zbuf_t* buf);
235void zfStaChannelManagement(zdev_t* dev, u8_t scan);
236void zfIbssConnectNetwork(zdev_t* dev);
237void zfInfraConnectNetwork(zdev_t* dev);
238u8_t zfCheckAuthentication(zdev_t* dev, struct zsBssInfo* pBssInfo);
239u8_t zfChangeAdapterState(zdev_t* dev, u8_t newState);
240u16_t zfStaAddIeSsid(zdev_t* dev, zbuf_t* buf, u16_t offset);
241u16_t zfStaAddIeWpaRsn(zdev_t* dev, zbuf_t* buf, u16_t offset, u8_t frameType);
242u16_t zfStaAddIeIbss(zdev_t* dev, zbuf_t* buf, u16_t offset);
243void zfStaStartConnect(zdev_t* dev, u8_t bIsSharedKey);
244u8_t zfStaIsConnected(zdev_t* dev);
245u8_t zfStaIsConnecting(zdev_t* dev);
246u8_t zfStaIsDisconnect(zdev_t* dev);
247void zfStaSendBeacon(zdev_t* dev);
248void zfSendNullData(zdev_t* dev, u8_t type);
249void zfSendPSPoll(zdev_t* dev);
250void zfSendBA(zdev_t* dev, u16_t start_seq, u8_t *bitmap);
251void zdRateInfoCountTx(zdev_t* dev, u16_t* macAddr);
252struct zsMicVar* zfStaGetRxMicKey(zdev_t* dev, zbuf_t* buf);
253struct zsMicVar* zfStaGetTxMicKey(zdev_t* dev, zbuf_t* buf);
254u16_t zfStaRxValidateFrame(zdev_t* dev, zbuf_t* buf);
255void zfStaMicFailureHandling(zdev_t* dev, zbuf_t* buf);
256u8_t zfStaBlockWlanScan(zdev_t* dev);
257void zfStaIbssPSCheckState(zdev_t* dev, zbuf_t* buf);
258u8_t zfStaIbssPSQueueData(zdev_t* dev, zbuf_t* buf);
259void zfStaIbssPSSend(zdev_t* dev);
260void zfStaResetStatus(zdev_t* dev, u8_t bInit);
261u16_t zfStaAddIeWmeInfo(zdev_t* dev, zbuf_t* buf, u16_t offset, u8_t qosInfo);
262void zfInitPartnerNotifyEvent(zdev_t* dev, zbuf_t* buf, struct zsPartnerNotifyEvent *event);
263void zfStaInitOppositeInfo(zdev_t* dev);
264void zfStaIbssMonitoring(zdev_t* dev, u8_t reset);
265struct zsBssInfo* zfStaFindBssInfo(zdev_t* dev, zbuf_t* buf, struct zsWlanProbeRspFrameHeader *pProbeRspHeader);
266u8_t zfStaInitBssInfo(zdev_t* dev, zbuf_t* buf,
267 struct zsWlanProbeRspFrameHeader *pProbeRspHeader,
268 struct zsBssInfo* pBssInfo, struct zsAdditionInfo* AddInfo, u8_t type);
269s8_t zfStaFindFreeOpposite(zdev_t* dev, u16_t *sa, int *pFoundIdx);
270s8_t zfStaFindOppositeByMACAddr(zdev_t* dev, u16_t *sa, u8_t *pFoundIdx);
271void zfStaRefreshBlockList(zdev_t* dev, u16_t flushFlag);
272void zfStaConnectFail(zdev_t* dev, u16_t reason, u16_t* bssid, u8_t weight);
273void zfStaGetTxRate(zdev_t* dev, u16_t* macAddr, u32_t* phyCtrl,
274 u16_t* rcProbingFlag);
275u16_t zfStaProcessAction(zdev_t* dev, zbuf_t* buf);
276struct zsTkipSeed* zfStaGetRxSeed(zdev_t* dev, zbuf_t* buf);
277#ifdef ZM_ENABLE_CENC
278/* CENC */
279u16_t zfStaAddIeCenc(zdev_t* dev, zbuf_t* buf, u16_t offset);
280#endif //ZM_ENABLE_CENC
281void zfStaEnableSWEncryption(zdev_t *dev, u8_t value);
282void zfStaDisableSWEncryption(zdev_t *dev);
283u16_t zfComputeBssInfoWeightValue(zdev_t *dev, u8_t isBMode, u8_t isHT, u8_t isHT40, u8_t signalStrength);
284u16_t zfStaAddIbssAdditionalIE(zdev_t* dev, zbuf_t* buf, u16_t offset);
285
286/* ctkip.c */
287void zfTkipInit(u8_t* key, u8_t* ta, struct zsTkipSeed* pSeed, u8_t* initIv);
288void zfMicSetKey(u8_t* key, struct zsMicVar* pMic);
289void zfMicAppendByte(u8_t b, struct zsMicVar* pMic);
290void zfMicClear(struct zsMicVar* pMic);
291void zfMicAppendTxBuf(zdev_t* dev, zbuf_t* buf, u8_t* da, u8_t* sa,
292 u16_t removeLen, u8_t* mic);
293u8_t zfMicRxVerify(zdev_t* dev, zbuf_t* buf);
294void zfMicGetMic(u8_t* dst, struct zsMicVar* pMic);
295void zfCalTxMic(zdev_t *dev, zbuf_t *buf, u8_t *snap, u16_t snapLen, u16_t offset, u16_t *da, u16_t *sa, u8_t up, u8_t *mic);
296void zfTKIPEncrypt(zdev_t *dev, zbuf_t *buf, u8_t *snap, u16_t snapLen, u16_t offset, u8_t keyLen, u8_t* key, u32_t* icv);
297u16_t zfTKIPDecrypt(zdev_t *dev, zbuf_t *buf, u16_t offset, u8_t keyLen, u8_t* key);
298void zfTkipGetseeds(u16_t iv16, u8_t *RC4Key, struct zsTkipSeed *Seed);
299u8_t zfTkipPhase1KeyMix(u32_t iv32, struct zsTkipSeed* pSeed);
300u8_t zfTkipPhase2KeyMix(u16_t iv16, struct zsTkipSeed* pSeed);
301void zfWEPEncrypt(zdev_t *dev, zbuf_t *buf, u8_t *snap, u16_t snapLen, u16_t offset, u8_t keyLen, u8_t* WepKey, u8_t *iv);
302u16_t zfWEPDecrypt(zdev_t *dev, zbuf_t *buf, u16_t offset, u8_t keyLen, u8_t* WepKey, u8_t *iv);
303
304/* ctxrx.c */
305u16_t zfSend80211Frame(zdev_t* dev, zbuf_t* buf);
306void zfIsrPciTxComp(zdev_t* dev);
307void zfTxPciDmaStart(zdev_t* dev);
308u16_t zfTxPortControl(zdev_t* dev, zbuf_t* buf, u16_t port);
309u16_t zfTxSendEth(zdev_t* dev, zbuf_t* buf, u16_t port,
310 u16_t bufType, u16_t flag);
311u16_t zfTxGenWlanTail(zdev_t* dev, zbuf_t* buf, u16_t* snap, u16_t snaplen,
312 u16_t* mic);
313u16_t zfTxGenWlanSnap(zdev_t* dev, zbuf_t* buf, u16_t* snap, u16_t* snaplen);
314void zfTxGetIpTosAndFrag(zdev_t* dev, zbuf_t* buf, u8_t* up, u16_t* fragOff);
315u16_t zfPutVtxq(zdev_t* dev, zbuf_t* buf);
316void zfPushVtxq(zdev_t* dev);
317u8_t zfIsVtxqEmpty(zdev_t* dev);
318u16_t zfGetSeqCtrl(zdev_t* dev, zbuf_t* buf, u16_t offset);
319u8_t zfGetFragNo(zdev_t* dev, zbuf_t* buf);
320void zfShowRxEAPOL(zdev_t* dev, zbuf_t* buf, u16_t offset);
321void zfShowTxEAPOL(zdev_t* dev, zbuf_t* buf, u16_t offset);
322void zfCoreRecv(zdev_t* dev, zbuf_t* buf, struct zsAdditionInfo* addInfo);
323u16_t zfPutVmmq(zdev_t* dev, zbuf_t* buf);
324void zfFlushVtxq(zdev_t* dev);
325void zfAgingDefragList(zdev_t* dev, u16_t flushFlag);
326
327void zfLed100msCtrl(zdev_t* dev);
328void zf80211FrameSend(zdev_t* dev, zbuf_t* buf, u16_t* header, u16_t snapLen,
329 u16_t* da, u16_t* sa, u8_t up, u16_t headerLen, u16_t* snap,
330 u16_t* tail, u16_t tailLen, u16_t offset, u16_t bufType,
331 u8_t ac, u8_t keyIdx);
332void zfCheckIsRIFSFrame(zdev_t* dev, zbuf_t* buf, u16_t frameSubType);
333
334/* queue.c */
335struct zsQueue* zfQueueCreate(zdev_t* dev, u16_t size);
336void zfQueueDestroy(zdev_t* dev, struct zsQueue* q);
337u16_t zfQueuePutNcs(zdev_t* dev, struct zsQueue* q, zbuf_t* buf, u32_t tick);
338u16_t zfQueuePut(zdev_t* dev, struct zsQueue* q, zbuf_t* buf, u32_t tick);
339zbuf_t* zfQueueGet(zdev_t* dev, struct zsQueue* q);
340zbuf_t* zfQueueGetWithMac(zdev_t* dev, struct zsQueue* q, u8_t* addr, u8_t* mb);
341void zfQueueFlush(zdev_t* dev, struct zsQueue* q);
342void zfQueueAge(zdev_t* dev, struct zsQueue* q, u32_t tick, u32_t msAge);
343void zfQueueGenerateUapsdTim(zdev_t* dev, struct zsQueue* q,
344 u8_t* uniBitMap, u16_t* highestByte);
345
346/* hpmain.c */
347u16_t zfHpInit(zdev_t* dev, u32_t frequency);
348u16_t zfHpRelease(zdev_t* dev);
349void zfHpSetFrequencyEx(zdev_t* dev, u32_t frequency, u8_t bw40,
350 u8_t extOffset, u8_t initRF);
351u16_t zfHpStartRecv(zdev_t* dev);
352u16_t zfHpStopRecv(zdev_t* dev);
353u16_t zfHpResetKeyCache(zdev_t* dev);
354u16_t zfHpSetApStaMode(zdev_t* dev, u8_t mode);
355u16_t zfHpSetBssid(zdev_t* dev, u8_t* bssid);
356u16_t zfHpSetSnifferMode(zdev_t* dev, u16_t on);
357u8_t zfHpUpdateQosParameter(zdev_t* dev, u16_t* cwminTbl, u16_t* cwmaxTbl,
358 u16_t* aifsTbl, u16_t* txopTbl);
359void zfHpSetAtimWindow(zdev_t* dev, u16_t atimWin);
360void zfHpEnableBeacon(zdev_t* dev, u16_t mode, u16_t bcnInterval, u16_t dtim, u8_t enableAtim);
361void zfHpDisableBeacon(zdev_t* dev);
362void zfHpSetBasicRateSet(zdev_t* dev, u16_t bRateBasic, u16_t gRateBasic);
363void zfHpSetRTSCTSRate(zdev_t* dev, u32_t rate);
364void zfHpSetMacAddress(zdev_t* dev, u16_t* macAddr, u16_t macAddrId);
365u32_t zfHpGetMacAddress(zdev_t* dev);
366u32_t zfHpGetTransmitPower(zdev_t* dev);
367void zfHpSetMulticastList(zdev_t* dev, u8_t size, u8_t* pList, u8_t bAllMulticast);
368
369u16_t zfHpRemoveKey(zdev_t* dev, u16_t user);
370u32_t zfHpSetKey(zdev_t* dev, u8_t user, u8_t keyId, u8_t type,
371 u16_t* mac, u32_t* key);
372//u32_t zfHpSetStaPairwiseKey(zdev_t* dev, u16_t* apMacAddr, u8_t type,
373// u32_t* key, u32_t* micKey);
374//u32_t zfHpSetStaGroupKey(zdev_t* dev, u16_t* apMacAddr, u8_t type,
375// u32_t* key, u32_t* micKey);
376u32_t zfHpSetApPairwiseKey(zdev_t* dev, u16_t* staMacAddr, u8_t type,
377 u32_t* key, u32_t* micKey, u16_t staAid);
378u32_t zfHpSetApGroupKey(zdev_t* dev, u16_t* apMacAddr, u8_t type,
379 u32_t* key, u32_t* micKey, u16_t vapId);
380u32_t zfHpSetDefaultKey(zdev_t* dev, u8_t keyId, u8_t type, u32_t* key, u32_t* micKey);
381u32_t zfHpSetPerUserKey(zdev_t* dev, u8_t user, u8_t keyId, u8_t* mac, u8_t type, u32_t* key, u32_t* micKey);
382
383void zfHpSendBeacon(zdev_t* dev, zbuf_t* buf, u16_t len);
384u16_t zfHpGetPayloadLen(zdev_t* dev,
385 zbuf_t* buf,
386 u16_t len,
387 u16_t plcpHdrLen,
388 u32_t *rxMT,
389 u32_t *rxMCS,
390 u32_t *rxBW,
391 u32_t *rxSG
392 );
393u32_t zfHpGetFreeTxdCount(zdev_t* dev);
394u32_t zfHpGetMaxTxdCount(zdev_t* dev);
395u16_t zfHpSend(zdev_t* dev, u16_t* header, u16_t headerLen,
396 u16_t* snap, u16_t snapLen, u16_t* tail, u16_t tailLen, zbuf_t* buf,
397 u16_t offset, u16_t bufType, u8_t ac, u8_t keyIdx);
398void zfHpGetRegulationTablefromRegionCode(zdev_t* dev, u16_t regionCode);
399void zfHpGetRegulationTablefromCountry(zdev_t* dev, u16_t CountryCode);
400u8_t zfHpGetRegulationTablefromISO(zdev_t* dev, u8_t *countryInfo, u8_t length);
401const char* zfHpGetisoNamefromregionCode(zdev_t* dev, u16_t regionCode);
402u16_t zfHpGetRegionCodeFromIsoName(zdev_t* dev, u8_t *countryIsoName);
403u8_t zfHpGetRegulatoryDomain(zdev_t* dev);
404void zfHpLedCtrl(zdev_t* dev, u16_t ledId, u8_t mode);
405u16_t zfHpResetTxRx(zdev_t* dev);
406u16_t zfHpDeleteAllowChannel(zdev_t* dev, u16_t freq);
407u16_t zfHpAddAllowChannel(zdev_t* dev, u16_t freq);
408u32_t zfHpCwmUpdate(zdev_t* dev);
409u32_t zfHpAniUpdate(zdev_t* dev);
410u32_t zfHpAniUpdateRssi(zdev_t* dev, u8_t rssi);
411void zfHpAniAttach(zdev_t* dev);
412void zfHpAniArPoll(zdev_t* dev, u32_t listenTime, u32_t phyCnt1, u32_t phyCnt2);
413void zfHpHeartBeat(zdev_t* dev);
414void zfHpPowerSaveSetState(zdev_t* dev, u8_t psState);
415void zfHpPowerSaveSetMode(zdev_t* dev, u8_t staMode, u8_t psMode, u16_t bcnInterval);
416u16_t zfHpIsDfsChannel(zdev_t* dev, u16_t freq);
417u16_t zfHpIsDfsChannelNCS(zdev_t* dev, u16_t freq);
418u16_t zfHpFindFirstNonDfsChannel(zdev_t* dev, u16_t aBand);
419u16_t zfHpIsAllowedChannel(zdev_t* dev, u16_t freq);
420void zfHpDisableDfsChannel(zdev_t* dev, u8_t disableFlag);
421void zfHpSetTTSIFSTime(zdev_t* dev, u8_t sifs_time);
422
423void zfHpQueryMonHalRxInfo(zdev_t* dev, u8_t *monHalRxInfo);
424
425void zfDumpSSID(u8_t length, u8_t *value);
426void zfHpSetAggPktNum(zdev_t* dev, u32_t num);
427void zfHpSetMPDUDensity(zdev_t* dev, u8_t density);
428void zfHpSetSlotTime(zdev_t* dev, u8_t type);
429void zfHpSetSlotTimeRegister(zdev_t* dev, u8_t type);
430void zfHpSetRifs(zdev_t* dev, u8_t ht_enable, u8_t ht2040, u8_t g_mode);
431void zfHpBeginSiteSurvey(zdev_t* dev, u8_t status);
432void zfHpFinishSiteSurvey(zdev_t* dev, u8_t status);
433u16_t zfHpEnableHwRetry(zdev_t* dev);
434u16_t zfHpDisableHwRetry(zdev_t* dev);
435void zfHpSWDecrypt(zdev_t* dev, u8_t enable);
436void zfHpSWEncrypt(zdev_t* dev, u8_t enable);
437u32_t zfHpCapability(zdev_t* dev);
438void zfHpSetRollCallTable(zdev_t* dev);
439u8_t zfHpregulatoryDomain(zdev_t* dev);
440u16_t zfStaAddIePowerCap(zdev_t* dev, zbuf_t* buf, u16_t offset);
441u8_t zfHpGetMaxTxPower(zdev_t* dev);
442u8_t zfHpGetMinTxPower(zdev_t* dev);
443u16_t zfStaAddIeSupportCh(zdev_t* dev, zbuf_t* buf, u16_t offset);
444void zfHpEnableRifs(zdev_t* dev, u8_t mode24g, u8_t modeHt, u8_t modeHt2040);
445void zfHpDisableRifs(zdev_t* dev);
446u16_t zfHpUsbReset(zdev_t* dev);
447
448
449#endif /* #ifndef _CFUNC_H */