rtmp.h
来自「Ralink RT61 SoftAP Driver source code. 」· C头文件 代码 · 共 1,769 行 · 第 1/5 页
H
1,769 行
NDIS_802_11_PRIVACY_FILTER PrivacyFilter; // PrivacyFilter enum for 802.1X
CIPHER_KEY PairwiseKey;
ULONG pAd; // save pAdapter's address for retrytimer usage
INT PMKID_CacheIdx;
UCHAR PMKID[LEN_PMKID];
UCHAR Addr[MAC_ADDR_LEN];
UCHAR PsMode;
SST Sst;
AUTH_STATE AuthState; // for SHARED KEY authentication state machine used only
USHORT Aid;
USHORT CapabilityInfo;
UCHAR MaxSupportedRate;
UCHAR CurrTxRate;
UCHAR LastTxRate;
UCHAR LastRssi;
ULONG NoDataIdleCount;
ULONG PsQIdleCount;
QUEUE_HEADER PsQueue;
struct _MAC_TABLE_ENTRY *pNext;
// to record the each TX rate's quality. 0 is best, the bigger the worse.
USHORT TxQuality[MAX_LEN_OF_SUPPORTED_RATES];
UCHAR PER[MAX_LEN_OF_SUPPORTED_RATES];
USHORT OneSecTxOkCount;
USHORT OneSecTxRetryOkCount;
USHORT OneSecTxFailCount;
UCHAR TxRateUpPenalty; // extra # of second penalty due to last unstable condition
ULONG CurrTxRateStableTime; // # of second in current TX rate
BOOLEAN fNoisyEnvironment;
UCHAR LastSecTxRateChangeAction; // 0: no change, 1:rate UP, 2:rate down
// Multiple SSID
UCHAR ApIdx;
COUNTER_HOTSPOT HSCounter;
// a bitmap of BOOLEAN flags. each bit represent an operation status of a particular
// BOOLEAN control, either ON or OFF. These flags should always be accessed via
// CLIENT_STATUS_TEST_FLAG(), CLIENT_STATUS_SET_FLAG(), CLIENT_STATUS_CLEAR_FLAG() macros.
// see fOP_STATUS_xxx in RTMP_DEF.C for detail bit definition
ULONG ClientStatusFlags;
BOOLEAN bAPSDCapablePerAC[4]; // 0:AC_BK, 1:AC_BE, 2:AC_VI, 3:AC_VO
UCHAR MaxSPLength;
BOOLEAN bDlsInit;
BOOLEAN bDot1xDynamicWep;
} MAC_TABLE_ENTRY, *PMAC_TABLE_ENTRY;
typedef struct _MAC_TABLE {
UCHAR Size;
MAC_TABLE_ENTRY *Hash[HASH_TABLE_SIZE];
MAC_TABLE_ENTRY Content[MAX_LEN_OF_MAC_TABLE];
QUEUE_HEADER McastPsQueue;
ULONG PsQIdleCount;
BOOLEAN fAnyStationInPsm; // TRUE, then outgoing BCAST/MCAST frame should
// be put into McastPsQueue until DtimCount=0
} MAC_TABLE, *PMAC_TABLE;
typedef struct {
BOOLEAN Enable;
UCHAR Delta;
BOOLEAN PlusSign;
} CCK_TX_POWER_CALIBRATE, *PCCK_TX_POWER_CALIBRATE;
// SYNC State Machine Aux data structure
typedef struct _SYNC_AUX {
UCHAR Addr[MAC_ADDR_LEN];
UCHAR Bssid[MAC_ADDR_LEN];
UCHAR BssType;
UCHAR SsidLen;
CHAR Ssid[MAX_LEN_OF_SSID];
UCHAR ScanType;
UCHAR Channel;
struct timer_list BeaconTimer, ScanTimer;
} SYNC_AUX;
// CNTL State Machine Aux data structure
typedef struct _CNTL_AUX {
UCHAR Ssid[MAX_LEN_OF_SSID];
UCHAR SsidLen;
UCHAR Bssid[MAC_ADDR_LEN];
ULONG BssIdx;
ULONG RoamIdx;
BOOLEAN CurrReqIsFromNdis; // TRUE - then we should call NdisMSetInformationComplete()
// FALSE - req is from driver itself.
// no NdisMSetInformationComplete() is required
} CNTL_AUX, *PCNTL_AUX;
// AUTH-RSP State Machine Aux data structure
typedef struct _AUTH_RSP_AUX {
UCHAR Addr[MAC_ADDR_LEN];
USHORT Alg;
CHAR Challenge[CIPHER_TEXT_LEN];
} AUTH_RSP_AUX, *PAUTH_RSP_AUX;
typedef struct _MLME_STRUCT {
STATE_MACHINE AssocMachine, AuthMachine, AuthRspMachine, SyncMachine, WpaPskMachine, DlsMachine;
STATE_MACHINE_FUNC AssocFunc[ASSOC_FUNC_SIZE], DlsFunc[DLS_FUNC_SIZE];
STATE_MACHINE_FUNC AuthFunc[AUTH_FUNC_SIZE], AuthRspFunc[AUTH_RSP_FUNC_SIZE];
STATE_MACHINE_FUNC SyncFunc[SYNC_FUNC_SIZE], WpaPskFunc[WPA_FUNC_SIZE];
#ifdef APCLI_SUPPORT
STA_STATE_MACHINE ApCliAuthMachine;
STA_STATE_MACHINE ApCliAssocMachine;
STA_STATE_MACHINE ApCliCtrlMachine;
STA_STATE_MACHINE ApCliSyncMachine;
STA_STATE_MACHINE ApCliWpaPskMachine;
STA_STATE_MACHINE_FUNC ApCliAuthFunc[STA_AUTH_FUNC_SIZE];
STA_STATE_MACHINE_FUNC ApCliAssocFunc[STA_ASSOC_FUNC_SIZE];
STA_STATE_MACHINE_FUNC ApCliCtrlFunc[STA_CTRL_FUNC_SIZE];
STA_STATE_MACHINE_FUNC ApCliSyncFunc[STA_SYNC_FUNC_SIZE];
STA_STATE_MACHINE_FUNC ApCliWpaPskFunc[STA_WPA_PSK_FUNC_SIZE];
#endif
SYNC_AUX SyncAux;
AUTH_RSP_AUX AuthRspAux;
UCHAR ErpIeContent;
ULONG Now32;
ULONG LastOLBCDetectTime;
ULONG ChannelQuality; // 0..100, Channel Quality Indication for Roaming
BOOLEAN bRunning;
spinlock_t TaskLock;
spinlock_t MemLock; //Memory handler spinlock
MLME_QUEUE Queue;
UINT ShiftReg;
struct timer_list PeriodicTimer;
struct timer_list DFSPeriodicTimer;
ULONG PeriodicRound;
UCHAR DtimCount; // 0.. DtimPeriod-1
UCHAR DtimPeriod; // default = 3
} MLME_STRUCT, *PMLME_STRUCT;
//
// Receive Tuple Cache Format
//
typedef struct _TUPLE_CACHE {
BOOLEAN Valid;
UCHAR MacAddress[MAC_ADDR_LEN];
USHORT Sequence;
USHORT Frag;
} TUPLE_CACHE, *PTUPLE_CACHE;
//
// Fragment Frame structure
//
typedef struct _FRAGMENT_FRAME {
UCHAR Header802_3[14];
UCHAR Header_LLC[8];
UCHAR Buffer[LENGTH_802_3 + MAX_FRAME_SIZE];
ULONG RxSize;
USHORT Sequence;
USHORT LastFrag;
ULONG Flags; // Some extra frame information. bit 0: LLC presented
} FRAGMENT_FRAME, *PFRAGMENT_FRAME;
//
// Tkip Key structure which RC4 key & MIC calculation
//
typedef struct _TKIP_KEY_INFO {
UINT nBytesInM; // # bytes in M for MICKEY
ULONG IV16;
ULONG IV32;
ULONG K0; // for MICKEY Low
ULONG K1; // for MICKEY Hig
ULONG L; // Current state for MICKEY
ULONG R; // Current state for MICKEY
ULONG M; // Message accumulator for MICKEY
UCHAR RC4KEY[16];
UCHAR MIC[8];
} TKIP_KEY_INFO, *PTKIP_KEY_INFO;
//
// Private / Misc data, counters for driver internal use
//
typedef struct __PRIVATE_STRUC {
ULONG SystemResetCnt; // System reset counter
ULONG TxRingFullCnt; // Tx ring full occurrance number
ULONG ResetCountDown; // Count down before issue reset
ULONG CCAErrCnt; // CCA error count, for debug purpose, might move to global counter
ULONG PhyRxErrCnt; // PHY Rx error count, for debug purpose, might move to global counter
ULONG PhyTxErrCnt; // PHY Tx error count, for debug purpose, might move to global counter
// Variables for WEP encryption / decryption in rtmp_wep.c
ULONG FCSCRC32;
ULONG RxSetCnt;
ULONG DecryptCnt;
ARCFOURCONTEXT WEPCONTEXT;
// Tkip stuff
TKIP_KEY_INFO Tx;
TKIP_KEY_INFO Rx;
} PRIVATE_STRUC, *PPRIVATE_STRUC;
#ifdef RALINK_ATE
typedef struct _ATE_INFO {
UCHAR Mode;
CHAR TxPower;
UCHAR Addr1[6];
UCHAR Addr2[6];
UCHAR Addr3[6];
UCHAR Channel;
ULONG TxLength;
ULONG TxCount;
ULONG TxDoneCount;
ULONG TxRate;
ULONG RFFreqOffset;
BOOLEAN bRxFer;
ULONG RxTotalCnt;
ULONG RxCntPerSec;
} ATE_INFO, *PATE_INFO;
#endif // RALINK_ATE
// structure to tune BBP R17 "RX AGC VGC init"
typedef struct _BBP_R17_TUNING {
BOOLEAN bEnable;
UCHAR R17LowerBoundG;
UCHAR R17LowerBoundA;
UCHAR R17UpperBoundG;
UCHAR R17UpperBoundA;
// UCHAR LastR17Value;
// SHORT R17Dec; // R17Dec = 0x79 - RssiToDbm, for old version R17Dec = 0.
// // This is signed value
USHORT FalseCcaLowerThreshold; // default 100
USHORT FalseCcaUpperThreshold; // default 512
UCHAR R17Delta; // R17 +- R17Delta whenever false CCA over UpperThreshold or lower than LowerThreshold
} BBP_R17_TUNING, *PBBP_R17_TUNING;
// structure for radar detection and channel switch
typedef struct _RADAR_DETECT_STRUCT {
BOOLEAN IEEE80211H; // 0: disable, 1: enable IEEE802.11h
UCHAR CSCount; //Channel switch counter
UCHAR CSPeriod; //Channel switch period (beacon count)
UCHAR RDCount; //Radar detection counter
UCHAR RDMode; //Radar Detection mode
UCHAR BBPR16;
UCHAR BBPR17;
UCHAR BBPR18;
UCHAR BBPR21;
UCHAR BBPR22;
UCHAR BBPR64;
ULONG InServiceMonitorCount; // unit: sec
UCHAR DetectPattern;
} RADAR_DETECT_STRUCT, *PRADAR_DETECT_STRUCT;
// structure to store channel TX power
typedef struct _CHANNEL_TX_POWER {
UCHAR Channel;
UCHAR Power;
USHORT RemainingTimeForUse; //unit: sec
} CHANNEL_TX_POWER, *PCHANNEL_TX_POWER;
//
// Multiple SSID structure
//
typedef struct _MULTISSID_STRUCT {
UCHAR Bssid[MAC_ADDR_LEN];
UCHAR SsidLen;
CHAR Ssid[MAX_LEN_OF_SSID];
USHORT CapabilityInfo;
struct net_device *MSSIDDev;
NDIS_802_11_AUTHENTICATION_MODE AuthMode;
NDIS_802_11_WEP_STATUS WepStatus;
NDIS_802_11_WEP_STATUS GroupKeyWepStatus;
ULONG TxOkCount;
ULONG RxOkCount;
ULONG ReceivedByteCount;
ULONG TransmittedByteCount;
CIPHER_KEY SharedKey[SHARE_KEY_NUM];
UCHAR DefaultKeyId;
UCHAR IndividualWepKeyIdx;
UCHAR TxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11, ...
UCHAR DesiredRates[MAX_LEN_OF_SUPPORTED_RATES];// OID_802_11_DESIRED_RATES
UCHAR DesiredRatesIndex;
UCHAR MaxTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11
ULONG TimBitmap; // bit0 for broadcast, 1 for AID1, 2 for AID2, ...so on
ULONG TimBitmap2; // b0 for AID32, b1 for AID33, ... and so on
// WPA
UCHAR GMK[32];
UCHAR PMK[64];
BOOLEAN IEEE8021X;
BOOLEAN PreAuth;
UCHAR GNonce[32];
UCHAR PortSecured;
NDIS_802_11_PRIVACY_FILTER PrivacyFilter;
UCHAR BANClass3Data;
ULONG IsolateInterStaTraffic;
UCHAR RSNIE_Len[2];
UCHAR RSN_IE[2][MAX_LEN_OF_RSNIE];
UCHAR TimIELocationInBeacon;
UCHAR CapabilityInfoLocationInBeacon;
NDIS_802_11_PMKID PMKIDCache;
// outgoing BEACON frame buffer and corresponding TXD
TXD_STRUC BeaconTxD;
CHAR BeaconBuf[256]; // NOTE: BeaconBuf should be 4-byte aligned
BOOLEAN bHideSsid;
USHORT VLAN_VID;
USHORT VLAN_Priority;
RT_802_11_ACL AccessControlList;
// EDCA Qos
BOOLEAN bWmmCapable; // 0:disable WMM, 1:enable WMM
BOOLEAN bDLSCapable; // 0:disable DLS, 1:enable DLS
UCHAR DlsPTK[64]; // Due to windows dirver count on meetinghouse to handle 4-way shake
#ifdef RTL865X_SOC
unsigned int mylinkid;
#endif
} MULTISSID_STRUCT, *PMULTISSID_STRUCT;
// structure to define WPA Group Key Rekey Interval
typedef struct _RT_802_11_WPA_REKEY {
ULONG ReKeyMethod; // mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based
ULONG ReKeyInterval; // time-based: seconds, packet-based: kilo-packets
} RT_WPA_REKEY,*PRT_WPA_REKEY,RT_802_11_WPA_REKEY, *PRT_802_11_WPA_REKEY;
typedef enum _ABGBAND_STATE_ {
UNKNOWN_BAND,
BG_BAND,
A_BAND,
} ABGBAND_STATE;
// PortConfig
typedef struct _PORT_CONFIG {
USHORT BeaconPeriod;
// Multiple SSID
UCHAR BssidNum;
MULTISSID_STRUCT MBSSID[MAX_MBSSID_NUM];
BOOLEAN bEnableHSCounter;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?