📄 zdapi.h
字号:
CAM_AP_CLIENT,
CAM_AP_VAP
};
typedef struct card_Setting_s
{
U8 EncryOnOff; //0: encryption off, 1: encryption on
U8 OperationMode; //0: IBSS, 1: AP, 2: STA, 3: WDS, 4: AP Client, 5: Virtual AP
U8 PreambleType; //0: long preamble, 1: short preamble
U8 TxRate; //0: 1M, 1: 2M, 2: 5.5M, 3: 11M, 4: 16.5M
U8 FixedRate; // fixed Tx Rate
U8 CurrTxRate; //
U8 AuthMode; //0: open system only, 1: shared key only, 2: auto
U8 HiddenSSID; //0: disable, 1:enable
U8 LimitedUser; //limited client number max to 32 user
U8 RadioOn; //0: radio off, 1: radio on
U8 BlockBSS; //0: don't block intra-bss traffic, 1: block
U8 TxPowerLevel; //0: 17dbm, 1: 14dbm, 2: 11dbm
U8 BasicRate; //
U8 EncryMode; //0: no wep, 2: wep63, 3:wep128
U8 EncryKeyId; //encryption key id
U8 BcKeyId; //broadcast key id for dynamic key
U8 SwCipher; //
U8 WepKeyLen; //WEP key length
U8 BcKeyLen; //Broadcast key length
U8 DynKeyMode; //Dynamic key mode, 1: WEP64, 2: WEP128, 4:TKIP
U16 Channel; //channel number
U16 FragThreshold; //fragment threshold, from 256~2432
U16 RTSThreshold; //RTS threshold, from 256~2432
U16 BeaconInterval; //default 100 ms
U16 DtimPeriod; //default 1
U8 MacAddr[8];
// ElementID(1), Len(1), SSID
U8 Info_SSID[36]; //include element ID, element Length, and element content
// ElementID(1), Len(1), SupportedRates(1-8)
U8 Info_SupportedRates[NUM_SUPPORTED_RATE]; //include element ID, element Length, and element content
U8 keyVector[4][32];
U8 BcKeyVector[16];
U8 WPAIe[128];
U8 WPAIeLen;
U8 WPASupport;
U8 Rate275;
U8 WpaBcKeyLen;
U8 BssType;
U16 ATIMWindow;
//added for G
U8 Ext_SupportedRates[NUM_SUPPORTED_RATE];
U8 MacMode;
U8 ShortSlotTime;
U8 BarkerPreamble;
// for UART support
//U8 UartEnable;
//U8 BaudRate;
U8 LastSentTxRate;
U8 ap_scan;
#ifdef OFDM
U8 HighestTxRate;
#endif
} card_Setting_t;
#define ZD_MAX_FRAG_NUM 8
typedef struct fragInfo_s{
U8 *macHdr[ZD_MAX_FRAG_NUM];
U8 *macBody[ZD_MAX_FRAG_NUM];
U32 bodyLen[ZD_MAX_FRAG_NUM];
U32 nextBodyLen[ZD_MAX_FRAG_NUM];
#if ZDCONF_LP_SUPPORT == 1
U8 EthHdr[14];
#endif
U8 hdrLen;
U8 totalFrag;
U8 bIntraBss;
U8 msgID;
U8 rate;
U8 preamble;
U8 encryType;
U8 burst;
U16 vapId;
U16 aid;
U8 CalSwMic[MIC_LNG+1];
//U8 keyInstalled;
//U8 bWaitingMIC;
//U8 bSwCalcMIC;
//U32 HwMicPhys;
void *buf;
} fragInfo_t;
typedef struct rxInfo_s{
U8 rate;
U8 bDataFrm;
U8 SaIndex;
U8 signalStrength;
U8 signalQuality;
U8 bSwCheckMIC;
} rxInfo_t;
typedef struct bss_info_s {
U8 bssid[6];
U16 beaconInterval;
U16 cap;
U16 atimWindow;
U8 ssid[36];
U8 supRates[NUM_SUPPORTED_RATE];
U8 extRates[NUM_SUPPORTED_RATE];
#if ZDCONF_LP_SUPPORT == 1
U8 zdIE_Info_BURST[16];
U8 zdIE_Info_AMSDU[16];
#endif
#if ZDCONF_SES_SUPPORT == 1
BOOLEAN SES_Element_Valid;
Element SES_Element;
#endif
U8 WPAIe[128];
U8 RSNIe[128];
U8 channel;
U8 signalStrength;
U8 signalQuality;
U8 apMode;
} bss_info_t;
//for pdot11Obj->QueueFlag
#define TX_QUEUE_SET 0x01
#define MGT_QUEUE_SET 0x02
#define AWAKE_QUEUE_SET 0x04
//for mRequestFlag
#define CONNECT_TOUT_SET 0x0001
#define DIS_CONNECT_SET 0x0002
#define BSS_CONNECT_SET 0x0004
#define CHANNEL_SCAN_SET 0x0008
#define PS_CHANGE_SET 0x0010
#define PS_POLL_SET 0x0020
#define IBSS_CONNECT_SET 0x0040
#define ROAMING_SET 0x0080
//for pdot11Obj->ConfigFlag
#define ENABLE_PROTECTION_SET 0x0001
#define BARKER_PREAMBLE_SET 0x0002
#define SHORT_SLOT_TIME_SET 0x0004
#define NON_ERP_PRESENT_SET 0x0008
#define PASSIVE_CHANNEL_SCAN_SET 0x0010
#define ACTIVE_CHANNEL_SCAN_SET 0x0020
#define IBSS_CHANNEL_SCAN_SET 0x0040
#define SCAN_AND_CONNECT_SET 0x0080
#define JUST_CHANNEL_SCAN 0x1000
// Feature Bit Map
#define FBM_ANTTENA_DIVERSITY 0x00000001
#define FBM_802_11D 0x00000002
#define FBM_27_5_MBPS 0x00000004
#define FBM_SINGLE_LED 0x00000008
// Define debug command
#define DBG_CMD_BEACON 0x0001
//driver to provide callback functions for 802.11 protocol stack
typedef struct zd_80211Obj_s
{
void *reg; //Input
U8 QueueFlag; //Output
U16 ConfigFlag; //Output
U8 BasicRate;
U8 bDeviceInSleep;
BOOLEAN bMoreData;
U8 BssType;
U8 bOverWritePhyRegFromE2P;
U8 bIsNormalSize;
U16 BeaconInterval;
U16 Channel;
U16 Aid;
U32 rfMode;
U32 HWFeature;
U32 RegionCode;
U32 S_bit_cnt;
U32 AllowedChannel;
U32 dbg_cmd;
U8 TxGainSetting;
U8 TxGainSetting2;
U8 CR31Flag;
U8 CR122Flag;
U8 CR203Flag;
U8 PhyTest;
U8 IsUSB2_0;
U8 bContinueTx;
U8 bChScanning;
U16 IntValue[14];
U8 CurrSsid[34];
BOOLEAN UW2453ChannelSelectAntennaAUX[14];
U32 UW2453SelectAntennaAUX;
BOOLEAN UW2453NoTXfollowRX;
U32 UW2453RFTableIndex;
U32 UWDefaultAntenna;
BOOLEAN UW2453MiniCard;
#if ZDCONF_LP_SUPPORT == 1
BOOLEAN LP_MODE;
BOOLEAN BURST_MODE;
#endif
#ifdef ZD1211B
U8 LengthDiff;
#endif
BOOLEAN MIC_CNT;
U8 UWCurrentTxLevel;
U8 UWDefaulTxLevel;
BOOLEAN UWPowerControlFlag;
BOOLEAN PHYNEWLayout ;
BOOLEAN PHY_Decrease_CR128_state;
void (* ReleaseBuffer)(void *buf); // release rx buffer
void (* StartTimer)(U32 timeout, U32 event); // start a chanllege timer (shared key authentication)
void (* StopTimer)(U32 TimerId); // stop the challenge timer
void (* RxInd)(U8 *pData, U32 length, void *buf, U32 LP_MAP); // rx indication
void (* TxCompleted)(void); // tx completed
BOOLEAN (* SetupNextSend)(fragInfo_t *pFragInfo); // send to HMAC
void (* SetReg)(void *reg, U32 offset, U32 value); // set HMAC register
U32 (* GetReg)(void *reg, U32 offset); // get HMAC register
U16 (* StatusNotify)(U16 status, U8 *StaAddr); // association notify for bridge management
void (* ExitCS)(U32 flags); // enable interrupt
U32 (* EnterCS)(void); // disable interrupt
U32 (* Vir2PhyAddr)(U32 virtAddr); // translate virtual address to physical address
BOOLEAN (* CheckTCBAvail)(U8 NumOfFrag); // check TCB available
void (* DelayUs)(U16 ustime); // delay function
void * (* AllocBuffer)(U16 dataSize, U8 **pData); // allocate wireless forwarding buffer
int (* Rand)(U32 seed);
void (* AcquireDoNotSleep)(void);
void (* ReleaseDoNotSleep)(void);
// wpa support
void (* MicFailure)(unsigned char *addr);
int (* AssocRequest)(U8 *addr, U8* data, U16 size);
int (* WpaIe)(U8 *buffer, int length);
}zd_80211Obj_t;
//802.11 export functions for driver use
extern void zd_SigProcess(void); // protocol statck entry point
extern BOOLEAN zd_SendPkt(U8 *pEthHdr, U8 *pBody, U32 bodyLen, void *buf, U8 bEapol, void *pHash); // tx request
extern void zd_ReceivePkt(U8 *pHdr, U32 hdrLen, U8 *pBody, U32 bodyLen, void *buf, U8 *pEthHdr, rxInfo_t *pRxInfo, BOOLEAN LP); // rx indication
extern BOOLEAN zd_CmdProcess(U16 CmdId, void *parm1, U32 parm2); //command process
extern void zd_EventNotify(U16 EventId, U32 parm1, U32 parm2, U32 parm3); //event notify
extern void zd_UpdateCardSetting(card_Setting_t *pSetting);
extern BOOLEAN zd_CleanupTxQ(void);
extern BOOLEAN zd_CleanupAwakeQ(void);
extern int zd_SetKeyInfo(U8 *addr, U8 encryMode, U8 keyLength, U8 KeyId, U8 *pKeyContent);
extern void zd_PerSecTimer(void);
extern BOOLEAN zd_CheckIvSeq(U8 aid, U16 iv16, U32 iv32);
extern void zd_RateMoniter(void);
extern BOOLEAN zd_QueryStaTable(U8 *sta, void **ppHash);
extern void zd_ConnectMon(void);
extern U8 zd_GetBssList(bss_info_t *pBssList);
extern U16 zd_AidLookUp(U8 *addr);
extern void zd_makeRateInfoMAP(U8 *pRates, U16 *basicRateMap, U16 *supRateMap);
extern void zd_UpdateIbssInfo(U8 *addr, U8 maxRate, U8 preamble, U8 erpSta);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -