📄 rtmp.h
字号:
// Copy supported rate from desired AP's beacon. We are trying to match
// AP's supported and extended rate settings.
UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
UCHAR SupRateLen;
UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
UCHAR ExtRateLen;
UCHAR ExpectedACKRate[MAX_LEN_OF_SUPPORTED_RATES];
ULONG BasicRateBitmap; // backup basic ratebitmap
//
// other parameters not defined in standard MIB
//
UCHAR DesireRate[MAX_LEN_OF_SUPPORTED_RATES]; // OID_802_11_DESIRED_RATES
UCHAR MaxDesiredRate;
UCHAR BasicMlmeRate; // Default Rate for sending MLME frames
UCHAR MlmeRate;
UCHAR RtsRate; // RATE_xxx
UCHAR TxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11, ...
UCHAR MaxTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11
UCHAR Bssid[MAC_ADDR_LEN];
USHORT BeaconPeriod;
CHAR Ssid[MAX_LEN_OF_SSID]; // NOT NULL-terminated
UCHAR SsidLen; // the actual ssid length in used
UCHAR LastSsidLen; // the actual ssid length in used
CHAR LastSsid[MAX_LEN_OF_SSID]; // NOT NULL-terminated
UCHAR LastBssid[MAC_ADDR_LEN];
UCHAR BssType; // BSS_INFRA or BSS_ADHOC
USHORT AtimWin; // used when starting a new IBSS
UCHAR RssiTrigger;
UCHAR RssiTriggerMode; // RSSI_TRIGGERED_UPON_BELOW_THRESHOLD or RSSI_TRIGGERED_UPON_EXCCEED_THRESHOLD
USHORT DefaultListenCount; // default listen count;
ULONG WindowsPowerMode; // Power mode for AC power
ULONG WindowsBatteryPowerMode; // Power mode for battery if exists
BOOLEAN bWindowsACCAMEnable; // Enable CAM power mode when AC on
BOOLEAN bAutoReconnect; // Set to TRUE when setting OID_802_11_SSID with no matching BSSID
UCHAR LastRssi; // last received BEACON's RSSI
UCHAR LastRssi2; // last received BEACON's RSSI for smart antenna
USHORT AvgRssi; // last 8 BEACON's average RSSI
USHORT AvgRssiX8; // sum of last 8 BEACON's RSSI
ULONG NumOfAvgRssiSample;
ULONG LastBeaconRxTime; // OS's timestamp of the last BEACON RX time
ULONG Last11bBeaconRxTime; // OS's timestamp of the last 11B BEACON RX time
ULONG LastScanTime; // Record last scan time for issue BSSID_SCAN_LIST
ULONG ScanCnt; // Scan counts since most recent SSID, BSSID, SCAN OID request
BOOLEAN bSwRadio; // Software controlled Radio On/Off, TRUE: On
BOOLEAN bHwRadio; // Hardware controlled Radio On/Off, TRUE: On
BOOLEAN bRadio; // Radio state, And of Sw & Hw radio state
BOOLEAN bHardwareRadio; // Hardware controlled Radio enabled
BOOLEAN bShowHiddenSSID; // Show all known SSID in SSID list get operation
// PHY specification
UCHAR PhyMode; // PHY_11A, PHY_11B, PHY_11BG_MIXED, PHY_ABG_MIXED
USHORT Dsifs; // in units of usec
USHORT TxPreamble; // Rt802_11PreambleLong, Rt802_11PreambleShort, Rt802_11PreambleAuto
// New for WPA, windows want us to to keep association information and
// Fixed IEs from last association response
NDIS_802_11_ASSOCIATION_INFORMATION AssocInfo;
UCHAR ReqVarIELen; // Length of next VIE include EID & Length
UCHAR ReqVarIEs[MAX_VIE_LEN];
UCHAR ResVarIELen; // Length of next VIE include EID & Length
UCHAR ResVarIEs[MAX_VIE_LEN];
ULONG EnableTurboRate; // 1: enable 72/100 Mbps whenever applicable, 0: never use 72/100 Mbps
ULONG UseBGProtection; // 0:AUTO, 1-always ON,2-always OFF
ULONG UseShortSlotTime; // 0: disable, 1 - use short slot (9us)
// EDCA Qos
BOOLEAN bWmmCapable; // 0:disable WMM, 1:enable WMM
QOS_CAPABILITY_PARM APQosCapability; // QOS capability of the current associated AP
EDCA_PARM APEdcaParm; // EDCA parameters of the current associated AP
QBSS_LOAD_PARM APQbssLoad; // QBSS load of the current associated AP
BOOLEAN bEnableTxBurst; // 0: disable, 1: enable TX PACKET BURST
BOOLEAN bAggregationCapable; // 1: enable TX aggregation when the peer supports it
BOOLEAN bUseZeroToDisableFragment; // Microsoft use 0 as disable
BOOLEAN bIEEE80211H; // 1: enable IEEE802.11h spec.
// 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
// OPSTATUS_TEST_FLAG(), OPSTATUS_SET_FLAG(), OP_STATUS_CLEAR_FLAG() macros.
// see fOP_STATUS_xxx in RTMP_DEF.C for detail bit definition
ULONG OpStatusFlags;
UCHAR AckPolicy[4]; // ACK policy of the specified AC. see ACK_xxx
ABGBAND_STATE BandState; // For setting BBP used on B/G or A mode
ULONG AdhocMode; // 0:WIFI mode (11b rates only), 1: b/g mixed, 2: 11g only, 3: 11a only, 4: 11abg mixed
RALINK_TIMER_STRUCT QuickResponeForRateUpTimer;
BOOLEAN QuickResponeForRateUpTimerRunning;
// Fast Roaming
BOOLEAN bFastRoaming; // 0:disable fast roaming, 1:enable fast roaming
ULONG dBmToRoam; // the condition to roam when receiving Rssi less than this value. It's negative value.
RADAR_DETECT_STRUCT RadarDetect;
BOOLEAN bGetAPConfig;
BOOLEAN bWscCapable; // 1:use simple config, 0:otherwise
WSC_LV_INFO WscIEProbeReq;
WSC_LV_INFO WscIEBeacon;
} PORT_CONFIG, *PPORT_CONFIG;
// This data structure keep the current active BSS/IBSS's configuration that this STA
// had agreed upon joining the network. Which means these parameters are usually decided
// by the BSS/IBSS creator instead of user configuration. Data in this data structurre
// is valid only when either ADHOC_ON(pAd) or INFRA_ON(pAd) is TRUE.
// Normally, after SCAN or failed roaming attempts, we need to recover back to
// the current active settings.
typedef struct _ACTIVE_CONFIG {
USHORT Aid;
USHORT AtimWin; // in kusec; IBSS parameter set element
USHORT CapabilityInfo;
USHORT CfpMaxDuration;
USHORT CfpPeriod;
// Copy supported rate from desired AP's beacon. We are trying to match
// AP's supported and extended rate settings.
UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
UCHAR SupRateLen;
UCHAR ExtRateLen;
} ACTIVE_CONFIG, *PACTIVE_CONFIG;
//
// The miniport adapter structure
//
typedef struct _RTMP_ADAPTER
{
//----------------------------
// Linux specific
//----------------------------
CHAR nickn[IW_ESSID_MAX_SIZE+1]; // nickname, only used in the iwconfig i/f
struct usb_device *pUsb_Dev;
struct net_device *net_dev;
struct tasklet_struct rx_bh;
struct usb_config_descriptor *config;
devctrlrequest *devreq;
/* The device we're working with
* It's important to note:
* (o) you must hold dev_semaphore to change pUsb_Dev
*/
struct semaphore usbdev_semaphore; /* protect usb */
// Thread
struct semaphore mlme_semaphore; /* to sleep thread on */
struct semaphore RTUSBCmd_semaphore; /* to sleep thread on */
struct completion notify; /* thread begin/end */
pid_t MLMEThr_pid;
pid_t RTUSBCmdThr_pid;
wait_queue_head_t *wait;
#if WIRELESS_EXT >= 12
struct iw_statistics iw_stats;
#endif
struct net_device_stats stats;
ULONG VendorDesc; // VID/PID
// resource for software backlog queues
QUEUE_HEADER TxSwQueue[NUM_OF_TX_RING]; // 4 AC + 1 HCCA
MGMT_STRUC MgmtRing[MGMT_RING_SIZE];
// outgoing BEACON frame buffer and corresponding TXD
TXD_STRUC BeaconTxD;
CHAR BeaconBuf[256]; // NOTE: BeaconBuf should be 4-byte aligned
// pre-build PS-POLL and NULL frame upon link up. for efficiency purpose.
PSPOLL_FRAME PsPollFrame;
HEADER_802_11 NullFrame;
// configuration: read from Registry & E2PROM
BOOLEAN bLocalAdminMAC; // Use user changed MAC
UCHAR PermanentAddress[MAC_ADDR_LEN]; // Factory default MAC address
UCHAR CurrentAddress[MAC_ADDR_LEN]; // User changed MAC address
MLME_STRUCT Mlme;
// ---------------------------
// STA specific configuration
// ---------------------------
PORT_CONFIG PortCfg; // user desired settings
ACTIVE_CONFIG ActiveCfg; // valid only when ADHOC_ON(pAd) || INFRA_ON(pAd)
MLME_AUX MlmeAux; // temporary settings used during MLME state machine
BSS_TABLE ScanTab; // store the latest SCAN result
// encryption/decryption KEY tables
CIPHER_KEY SharedKey[4];
// CIPHER_KEY PairwiseKey[64]; // for AP only
// Boolean control for packet filter
BOOLEAN bAcceptDirect;
BOOLEAN bAcceptMulticast;
BOOLEAN bAcceptBroadcast;
BOOLEAN bAcceptAllMulticast;
// 802.3 multicast support
ULONG NumberOfMcastAddresses; // Number of mcast entry exists
UCHAR McastTable[MAX_MCAST_LIST_SIZE][MAC_ADDR_LEN]; // Mcast list
// RX Tuple chahe for duplicate frame check
TUPLE_CACHE TupleCache[MAX_CLIENT]; // Maximum number of tuple caches, only useful in Ad-Hoc
UCHAR TupleCacheLastUpdateIndex; // 0..MAX_CLIENT-1
// RX re-assembly buffer for fragmentation
FRAGMENT_FRAME FragFrame; // Frame storage for fragment frame
// various Counters
COUNTER_802_3 Counters8023; // 802.3 counters
COUNTER_802_11 WlanCounters; // 802.11 MIB counters
COUNTER_RALINK RalinkCounters; // Ralink propriety counters
COUNTER_DRS DrsCounters; // counters for Dynamic TX Rate Switching
PRIVATE_STRUC PrivateInfo; // Private information & counters
// Counters for 802.3 & generic.
// Add 802.11 specific counters later
COUNTER_802_3 Counters; // 802.3 counters
COUNTER_QA QACounters; // Ralink propriety counters
// flags, see fRTMP_ADAPTER_xxx flags
ULONG Flags; // Represent current device status
// current TX sequence #
USHORT Sequence;
// Control disconnect / connect event generation
ULONG LinkDownTime;
ULONG LastRxRate;
BOOLEAN bConfigChanged; // Config Change flag for the same SSID setting
ULONG ExtraInfo; // Extra information for displaying status
ULONG SystemErrorBitmap; // b0: E2PROM version error
// ---------------------------
// E2PROM
// ---------------------------
ULONG EepromVersion; // byte 0: version, byte 1: revision, byte 2~3: unused
UCHAR EEPROMAddressNum; // 93c46=6 93c66=8
USHORT EEPROMDefaultValue[NUM_EEPROM_BBP_PARMS];
ULONG FirmwareVersion; // byte 0: Minor version, byte 1: Major version, otherwise unused.
// ---------------------------
// BBP Control
// ---------------------------
UCHAR BbpWriteLatch[110]; // record last BBP register value written via BBP_IO_WRITE/BBP_IO_WRITE_VY_REG_ID
UCHAR BbpRssiToDbmDelta;
BBP_R17_TUNING BbpTuning;
// ----------------------------
// RFIC control
// ----------------------------
UCHAR RfIcType; // RFIC_xxx
ULONG RfFreqOffset; // Frequency offset for channel switching
BOOLEAN bAutoTxAgc; // Enable driver auto Tx Agc control
RTMP_RF_REGS LatchRfRegs; // latch th latest RF programming value since RF IC doesn't support READ
// CCK_TX_POWER_CALIBRATE CckTxPowerCalibrate; // 2004-05-25 add CCK TX power caliberation based on E2PROM settings
UCHAR RFProgSeq;
EEPROM_ANTENNA_STRUC Antenna; // Since ANtenna definition is different for a & g. We need to save it for future reference.
EEPROM_NIC_CONFIG2_STRUC NicConfig2;
CHANNEL_TX_POWER TxPower[MAX_NUM_OF_CHANNELS]; // Store Tx power value for all channels.
CHANNEL_TX_POWER ChannelList[MAX_NUM_OF_CHANNELS]; // list all supported channels for site survey
UCHAR ChannelListNum; // number of channel in ChannelList[]
EEPROM_TXPOWER_DELTA_STRUC TxPowerDeltaConfig; // Compensate the Tx power BBP94 with this configurate value
UCHAR Bbp94;
BOOLEAN BbpForCCK;
// UCHAR ChannelTssiRef[MAX_NUM_OF_CHANNELS]; // Store Tssi Reference value for all channels.
// UCHAR ChannelTssiDelta; // Store Tx TSSI delta increment / decrement value
// This soft Rx Antenna Diversity mechanism is used only when user set
// RX Antenna = DIVERSITY ON
SOFT_RX_ANT_DIVERSITY RxAnt;
BOOLEAN bAutoTxAgcA; // Enable driver auto Tx Agc control
UCHAR TssiRefA; // Store Tssi reference value as 25 tempature.
UCHAR TssiPlusBoundaryA[5]; // Tssi boundary for increase Tx power to compensate.
UCHAR TssiMinusBoundaryA[5]; // Tssi boundary for decrease Tx power to compensate.
UCHAR TxAgcStepA; // Store Tx TSSI delta increment / decrement value
CHAR TxAgcCompensateA; // Store the compensation (TxAgcStep * (idx-1))
BOOLEAN bAutoTxAgcG; // Enable driver auto Tx Agc control
UCHAR TssiRefG; // Store Tssi reference value as 25 tempature.
UCHAR TssiPlusBoundaryG[5]; // Tssi boundary for increase Tx power to compensate.
UCHAR TssiMinusBoundaryG[5]; // Tssi boundary for decrease Tx power to compensate.
UCHAR TxAgcStepG; // Store Tx TSSI delta increment / decrement value
CHAR TxAgcCompensateG; // Store the compensation (TxAgcStep * (idx-1))
CHAR BGRssiOffset1; // Store B/G RSSI#1 Offset value on EEPROM 0x9Ah
CHAR BGRssiOffset2; // Store B/G RSSI#2 Offset value
CHAR ARssiOffset1; // Store A RSSI#1 Offset value on EEPROM 0x9Ch
CHAR ARssiOffset2;
// ----------------------------
// LED control
// ----------------------------
MCU_LEDCS_STRUC LedCntl;
USHORT LedIndicatorStrength;
// ----------------------------
// DEBUG paramerts
// ----------------------------
// ULONG DebugSetting[4];
//////////////////////////////////////////////////////////////////////
// USB
//////////////////////////////////////////////////////////////////////
USHORT BulkOutMaxPacketSize; // 64 in XP
USHORT BulkInMaxPacketSize;
CmdQ CmdQ;
CmdQElmt CmdQElements[COMMAND_QUEUE_SIZE];
BOOLEAN DeQueueRunning[4]; // for ensuring RTUSBDeQueuePacket get call once
// SpinLocks
spinlock_t SendTxWaitQueueLock[4]; // SendTxWaitQueue spinlock
spinlock_t DataQLock[4];
spinlock_t DeQueueLock[4];
spinlock_t MLMEWaitQueueLock; // SendTxWaitQueue spinlock
spinlock_t CmdQLock; // SendTxWaitQueue spinlock
spinlock_t BulkOutLock[4]; // SendTxWaitQueue spinlock for 4 ACs
// spinlock_t ControlLock; // SendTxWaitQueue spinlock
spinlock_t MLMEQLock; // SendTxWaitQueue spinlock
// spinlock_t GenericLock; // SendTxWaitQueue spinlock
/////////////////////
// Transmit Path
/////////////////////
TX_CONTEXT MLMEContext[PRIO_RING_SIZE];
TX_CONTEXT BeaconContext[BEACON_RING_SIZE];
TX_CONTEXT NullContext;
TX_CONTEXT PsPollContext;
TX_CONTEXT RTSContext;
// PUCHAR TxBuffer;
// TX_BUFFER TxMgmtBuf;
// PURB pTxMgmtUrb;
// PIRP pTxMgmtIrp;
QUEUE_HEADER SendTxWaitQueue[4];
UINT32 TxRingTotalNumber[4];
UCHAR NextTxIndex[4]; // Next TxD write pointer
UCHAR NextMLMEIndex; // Next PrioD write pointer
UCHAR PushMgmtIndex; // Next SW management ring index
UCHAR PopMgmtIndex; // Next SW management ring index
atomic_t MgmtQueueSize; // Number of Mgmt request stored in MgmtRing
UCHAR NextRxBulkInIndex;
// 4 sets of Bulk Out index and pending flag
UCHAR NextBulkOutIndex[4];
BOOLEAN BulkOutPending[4];
// BOOLEAN ControlPending;
ULONG PrioRingTxCnt;
UCHAR PrioRingFirstIndex;
atomic_t TxCount; // Number of Bulkout waiting to be send.
LONG PendingTx;
// Data related context and AC specified, 4 AC supported
TX_CONTEXT TxContext[4][TX_RING_SIZE];
LONG NumPacketsQueued[4];
// PURB pTxUrb[4];
// PIRP pTxIrp[4];
/////////////////////
// Receive Path
/////////////////////
RX_CONTEXT RxContext[RX_RING_SIZE];
// PURB pRxUrb;
// PIRP pRxIrp;
// PUCHAR RxBuffer;
atomic_t PendingRx;
/////////////////////
// Control Flags
/////////////////////
// atomic_t PendingIoCount;
// Flags for bulk out data priority
ULONG BulkFlags;
// spinlock_t MemLock; // need to check
ULONG BulkOutDataOneSecCount;
ULONG BulkInDataOneSecCount;
ULONG BulkLastOneSecCount; // BulkOutDataOneSecCount + BulkInDataOneSecCount
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -