📄 cb20_cb.h
字号:
* Link status bits */#define LS_NOBEACON 0x8000#define LS_MXRETRIES 0x8001#define LS_ASSFAIL 0x8400#define LS_ASSOC 0x0400/* SSID rid */#define RID_SSLIST 0xff11typedef struct { unsigned short SsidLen; unsigned char Ssid[32];}PC3500_SSID;typedef struct { unsigned short u16RidLen; PC3500_SSID aSsid[1];}PC3500_SID_LIST;/***********************Cb20 descriptor types *************//* * Card RID descriptor */typedef struct _CARD_RID_DESC{ unsigned RID :16; unsigned length :15; unsigned valid :1; unsigned long PhyHostAddress;} CARD_RID_DESC;/* * Host RID descriptor */typedef struct _HOST_RID_DESC{ unsigned char *CardRamOff; // offset into card memory of the descriptor CARD_RID_DESC RIDDesc; // card RID descriptor char *VirtualHostAddress; // virtual address of host receive buffer} HOST_RID_DESC;/* * Card receive descriptor */typedef struct _CARD_RX_DESC{ unsigned RxCtrl :15; unsigned RxDone :1; unsigned length :15; unsigned valid :1; unsigned long PhyHostAddress;} CARD_RX_DESC;/* * Card transmit descriptor */typedef struct _CARD_TX_DESC{ unsigned Offset :15; unsigned eoc :1; unsigned length :15; unsigned valid :1; unsigned long PhyHostAddress;} CARD_TX_DESC;/* * Host receive descriptor */typedef struct _HOST_TX_DESC{ unsigned char *CardRamOff; /* offset into card memory of the descriptor */ CARD_TX_DESC TxDesc; /* card transmit descriptor */ char *VirtualHostAddress; /* virtual address of host receive buffer */} HOST_TX_DESC;/* * Host transmit descriptor */typedef struct _HOST_RX_DESC{ unsigned char *CardRamOff; /* offset into card memory of the descriptor */ CARD_RX_DESC RxDesc; /* card receive descriptor */ char *VirtualHostAddress; /* virtual address of host receive buffer */ int pending; } HOST_RX_DESC;typedef u8 MacAddr[6];typedef struct _HDR_802_11 { u16 FrmCtrl; u16 duratation; MacAddr Addr1; MacAddr Addr2; MacAddr Addr3; u16 sequence; MacAddr Addr4;}HDR_802_11;typedef struct _HDR_802_3 { MacAddr destAddr; MacAddr srcAddr;}HDR_802_3;typedef struct _TXHDR_CTRL { u16 SWSupport0; /* 0 */ u16 SWSupport1; /* 2 */ u16 status; /* 4 */ u16 DataLen; /* 6 */ /* * TxCtrl * * bit meaning * ------------------------------------------ * 0 host set (on/off) FcWep as required * 1 host wants interrupt on Tx complete OK * 2 host wants interrupt on Tx exception * 3 ? * 4 1=payload is LLC, 0=payload is Ethertype * 5 don't release buffer when done * 6 don't retry packet * 7 clear AID failed state * 8 strict order multicast * 9 force RTS use * 10 short preamble * 11 ? * 12 \ * 13 > priority * 14 / * 15 ? * */ u16 TxCtrl; /*8 */ u16 AID; /*10*/ u16 TxRetries; /*12*/ u16 res1; /*14*/ }TXHDR_CTRL;typedef struct _TXFID_HDR{ TXHDR_CTRL txHdr; u16 Plcp0; u16 Plcp1; HDR_802_11 hdr_802_11; u16 GapLen; u16 status; /* * This field is actually in this structure but is left out and handled separately * for historical reasons. * * u16 payloadLen; */}TXFID_HDR;//====================================================// X500 commands Taken from windows cb20 drivertypedef enum { CMD_X500_NOP = 0x0000, CMD_X500_NOP10 = 0x0010, CMD_X500_Initialize = 0x0000, CMD_X500_Enable = 0x0001, CMD_X500_EnableMAC = 0x0001, CMD_X500_DisableMAC = 0x0002, CMD_X500_EnableRcv = 0x0201, CMD_X500_EnableEvents = 0x0401, CMD_X500_EnableAll = 0x0701, CMD_X500_Disable = 0x0002, CMD_X500_Diagnose = 0x0003, CMD_X500_Allocate = 0x000a, CMD_X500_AllocDescriptor = 0x0020, CMD_X500_Transmit = 0x000b, CMD_X500_Dellocate = 0x000c, CMD_X500_AccessRIDRead = 0x0021, CMD_X500_AccessRIDWrite = 0x0121, CMD_X500_EEReadConfig = 0x0008, CMD_X500_EEWriteConfig = 0x0108, CMD_X500_Preserve = 0x0000, CMD_X500_Program = 0x0000, CMD_X500_ReadMIF = 0x0000, CMD_X500_WriteMIF = 0x0000, CMD_X500_Configure = 0x0000, CMD_X500_SMO = 0x0000, CMD_X500_GMO = 0x0000, CMD_X500_Validate = 0x0000, CMD_X500_UpdateStatistics = 0x0000, CMD_X500_ResetStatistics = 0x0000, CMD_X500_RadioTransmitterTests = 0x0000, CMD_X500_GotoSleep = 0x0000, CMD_X500_SyncToBSSID = 0x0000, CMD_X500_AssocedToAP = 0x0000, CMD_X500_ResetCard = 0x0004, // (Go to download mode) CMD_X500_SiteSurveyMode = 0x0000, CMD_X500_SLEEP = 0x0005, CMD_X500_MagicPacketON = 0x0086, CMD_X500_MagicPacketOFF = 0x0186, CMD_X500_SetOperationMode = 0x0009, // CAM, PSP, .. CMD_X500_BssidListScan = 0x0103,}CMD_X500;/* * Descriptor types taken from * windows driver. */typedef enum _DESCRIPTOR_TYPE{ DESCRIPTOR_TX = 0x01, DESCRIPTOR_RX = 0x02, DESCRIPTOR_TXCMP = 0x04, DESCRIPTOR_HOSTWRITE = 0x08, DESCRIPTOR_HOSTREAD = 0x10, DESCRIPTOR_HOSTRW = 0x20, } DESCRIPTOR_TYPE;//:// 0xFF11typedef struct _STSSID { u16 num; u16 Len1; u8 ID1[32]; u16 Len2; u8 ID2[32]; u16 Len3; u8 ID3[32];}STSSID;//: Card status // FF50typedef struct _STSTATUS { u16 u16RidLen; // 0x0000 u8 au8MacAddress[6]; // 0x0002 u16 u16OperationalMode; // 0x0008 u16 u16ErrorCode; // 0x000A u16 u16SignalStrength; // 0x000C u16 SSIDlength; // 0x000E u8 SSID[32]; // 0x0010 u8 au8ApName[16]; // 0x0030 u8 au8CurrentBssid[6]; // 0x0040 u8 au8PreviousBssid1[6]; // 0x0046 u8 au8PreviousBssid2[6]; // 0x004C u8 au8PreviousBssid3[6]; // 0x0052 u16 u16BeaconPeriod; // 0x0058 u16 u16DtimPeriod; // 0x005A u16 u16AtimDuration; // 0x005C u16 u16HopPeriod; // 0x005E union dschannel{ u16 u16DsChannel; // 0x0060 u16 u16HopSet; // 0x0060 } channel; u16 u16HopPattern; // 0x0062 u16 u16HopsToBackbone; // 0x0064 u16 u16ApTotalLoad; // 0x0066 u16 u16OurGeneratedLoad; // 0x0068 u16 u16AccumulatedArl; // 0x006A u16 u16SignalQuality; // 0x006C u16 u16CurrentTxRate; // 0x006E u16 u16APDeviceType; // 0x0070 u16 u16NormalizedSignalStrength; // 0x0072 u16 u16UsingShortRFHeaders; // 0x0074 u8 AccessPointIPAddress[4]; // 0x0076 u16 u16MaxNoiseLevelLastSecond; // 0x007A u16 u16AvgNoiseLevelLastMinute; // 0x007C u16 u16MaxNoiseLevelLastMinute; // 0x007E u16 u16CurrentAPPacketLoad; // 0x0080 u8 AdoptedCarrierSet[4]; // 0x0082}STSTATUS;/* * 0xFF10 */typedef struct { u16 len; /* sizeof(ConfigRid) */ u16 opmode; /* operating mode */#define MODE_STA_IBSS 0#define MODE_STA_ESS 1#define MODE_AP 2#define MODE_AP_RPTR 3#define MODE_ETHERNET_HOST (0<<8) /* rx payloads converted */#define MODE_LLC_HOST (1<<8) /* rx payloads left as is */#define MODE_AIRONET_EXTEND (1<<9) /* enable Aironet extenstions */#define MODE_AP_INTERFACE (1<<10) /* enable ap interface extensions */#define MODE_ANTENNA_ALIGN (1<<11) /* enable antenna alignment */#define MODE_ETHER_LLC (1<<12) /* enable ethernet LLC */#define MODE_LEAF_NODE (1<<13) /* enable leaf node bridge */#define MODE_CF_POLLABLE (1<<14) /* enable CF pollable */ u16 rmode; /* receive mode */#define RXMODE_BC_MC_ADDR 0#define RXMODE_BC_ADDR 1 /* ignore multicasts */#define RXMODE_ADDR 2 /* ignore multicast and broadcast */#define RXMODE_RFMON 3 /* wireless monitor mode */#define RXMODE_RFMON_ANYBSS 4#define RXMODE_LANMON 5 /* lan style monitor -- data packets only */#define RXMODE_DISABLE_802_3_HEADER (1<<8) /* disables 802.3 header on rx */#define RXMODE_NORMALIZED_RSSI (1<<9) /* return normalized RSSI */ u16 fragThresh; u16 rtsThres; u8 macAddr[6]; u8 rates[8]; u16 shortRetryLimit; u16 longRetryLimit; u16 txLifetime; /* in kusec */ u16 rxLifetime; /* in kusec */ u16 stationary; u16 ordering; u16 u16deviceType; /* for overriding device type */ u16 cfpRate; u16 cfpDuration; u16 _reserved1[3]; /*---------- Scanning/Associating ----------*/ u16 scanMode;#define SCANMODE_ACTIVE 0#define SCANMODE_PASSIVE 1#define SCANMODE_AIROSCAN 2 u16 probeDelay; /* in kusec */ u16 probeEnergyTimeout; /* in kusec */ u16 probeResponseTimeout; u16 beaconListenTimeout; u16 joinNetTimeout; u16 authTimeout; u16 authType;#define AUTH_OPEN 0x1#define AUTH_ENCRYPT 0x101#define AUTH_SHAREDKEY 0x102#define AUTH_ALLOW_UNENCRYPTED 0x200 u16 associationTimeout; u16 specifiedApTimeout; u16 offlineScanInterval; u16 offlineScanDuration; u16 linkLossDelay; u16 maxBeaconLostTime; u16 refreshInterval;#define DISABLE_REFRESH 0xFFFF u16 _reserved1a[1]; /*---------- Power save operation ----------*/ u16 powerSaveMode;#define POWERSAVE_CAM 0#define POWERSAVE_PSP 1#define POWERSAVE_PSPCAM 2 u16 sleepForDtims; u16 listenInterval;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -