📄 hostcmd.h
字号:
/******************** (c) Marvell Semiconductor, Inc., 2001 ********************
*
* $HEADER$
*
* File: hostcmd.h
*
* Purpose:
*
* This file contains the function prototypes, data structure and defines
* for all the host/station commands. Please check the 802.11
* GUI/Driver/Station Interface Specification for detailed command
* information
*
* Notes:
*
*****************************************************************************/
#ifndef __HOSTCMD__H
#define __HOSTCMD__H
/*
* IEEE scan.confirm data structure borrowed from station FW code
* Reference: IEEE 802.11 1999 Spec 10.3.2.2.2
*/
/* In station FW code, enum type is 1 byte u8 */
typedef enum
{
SSID = 0,
SUPPORTED_RATES,
FH_PARAM_SET,
DS_PARAM_SET,
CF_PARAM_SET,
TIM,
IBSS_PARAM_SET,
#ifdef ENABLE_802_11D
COUNTRY_INFO = 7,
#endif
CHALLENGE_TEXT = 16,
#ifdef ENABLE_802_11H_TPC
POWER_CONSTRAINT = 32,
POWER_CAPABILITY = 33,
TPC_REQUEST = 34,
TPC_REPORT = 35,
#endif
#ifdef FWVERSION3
EXTENDED_SUPPORTED_RATES = 50,
#endif
VENDOR_SPECIFIC_221 = 221,
#ifdef WMM
WMM_IE = 221,
#endif /* WMM */
#ifdef WPA
WPA_IE = 221,
#ifdef WPA2
WPA2_IE = 48,
#endif //WPA2
#endif //WPA
EXTRA_IE = 133,
} __ATTRIB_PACK__ IEEEtypes_ElementId_e;
#ifdef WMM
#define WMM_OUI_TYPE 2
#endif /* WMM */
#define CAPINFO_MASK (~( W_BIT_15 | W_BIT_14 | \
W_BIT_12 | W_BIT_11 | W_BIT_9) )
#ifdef BIG_ENDIAN
typedef struct IEEEtypes_CapInfo_t {
u8 Rsrvd1:2;
u8 DSSSOFDM:1;
u8 Rsvrd2:2;
u8 ShortSlotTime:1;
u8 Rsrvd3:1;
u8 SpectrumMgmt:1;
u8 ChanAgility:1;
u8 Pbcc:1;
u8 ShortPreamble:1;
u8 Privacy:1;
u8 CfPollRqst:1;
u8 CfPollable:1;
u8 Ibss:1;
u8 Ess:1;
} __ATTRIB_PACK__ IEEEtypes_CapInfo_t;
#else
typedef struct IEEEtypes_CapInfo_t {
u8 Ess:1;
u8 Ibss:1;
u8 CfPollable:1;
u8 CfPollRqst:1;
u8 Privacy:1;
u8 ShortPreamble:1;
u8 Pbcc:1;
u8 ChanAgility:1;
u8 SpectrumMgmt:1;
u8 Rsrvd3:1;
u8 ShortSlotTime:1;
u8 Apsd:1;
u8 Rsvrd2:1;
u8 DSSSOFDM:1;
u8 Rsrvd1:2;
} __ATTRIB_PACK__ IEEEtypes_CapInfo_t;
#endif /* BIG_ENDIAN */
typedef struct IEEEtypes_CfParamSet_t {
u8 ElementId;
u8 Len;
u8 CfpCnt;
u8 CfpPeriod;
u16 CfpMaxDuration;
u16 CfpDurationRemaining;
} __ATTRIB_PACK__ IEEEtypes_CfParamSet_t;
typedef struct IEEEtypes_IbssParamSet_t {
u8 ElementId;
u8 Len;
u16 AtimWindow;
} __ATTRIB_PACK__ IEEEtypes_IbssParamSet_t;
typedef union IEEEtypes_SsParamSet_t {
IEEEtypes_CfParamSet_t CfParamSet;
IEEEtypes_IbssParamSet_t IbssParamSet;
} __ATTRIB_PACK__ IEEEtypes_SsParamSet_t;
typedef struct IEEEtypes_FhParamSet_t {
u8 ElementId;
u8 Len;
u16 DwellTime;
u8 HopSet;
u8 HopPattern;
u8 HopIndex;
} __ATTRIB_PACK__ IEEEtypes_FhParamSet_t;
typedef struct IEEEtypes_DsParamSet_t {
u8 ElementId;
u8 Len;
u8 CurrentChan;
} __ATTRIB_PACK__ IEEEtypes_DsParamSet_t;
typedef union IEEEtypes_PhyParamSet_t {
IEEEtypes_FhParamSet_t FhParamSet;
IEEEtypes_DsParamSet_t DsParamSet;
} __ATTRIB_PACK__ IEEEtypes_PhyParamSet_t;
/////////////////////////////////////////////////////////////////
//
// 802.11-related definitions
//
/////////////////////////////////////////////////////////////////
//
// Define TxPD and RxPD
//
// TxPD descriptor
//
// Status : Current Tx packet transmit status
// PktPtr : Physical address of the Tx Packet on host PC memory
// PktLen : Tx packet length
// u8 DestMACAdrHi[2] : First 2 byte of destination MAC address
// DestMACAdrLow[4] : Last 4 byte of destination MAC address
// DataRate : Driver uses this field to specify data
// : rate for the Tx packet
// NextTxPDPtr : Address to next TxPD (Used by the driver)
//
typedef struct _TxPD
{
u32 TxStatus;
u32 TxControl;
u32 TxPacketLocation;
u16 TxPacketLength;
u8 TxDestAddrHigh[2];
u8 TxDestAddrLow[4];
#ifdef WMM
u8 Priority;
u8 PowerMgmt;
u8 Reserved[2];
#endif /* WMM */
// struct _TxPD *NextTxPDPtr;
} __ATTRIB_PACK__ TxPD, *PTxPD; // size = 32 bytes
// RxPD descirptor
//
// Control : Ownership indication
// RSSI : FW uses this field to report last Rx packet RSSI
// Status : Rx packet type
// PktLen : FW uses this field to report last Rx packet length
// SQBody : Signal quality for packet body
// Rate : In FW.
// PktPtr : Driver uses this field to report host memory buffer size
// NextRxPDPtr : Physical address of the next RxPD
//
typedef struct _RxPD {
u16 Status;
u8 SNR;
u8 RxControl;
u16 PktLen;
u8 NF; /* Noise Floor */
u8 RxRate;
u32 PktPtr;
u32 NextRxPDPtr;
#ifdef WMM
u8 Priority;
u8 Reserved[3];
#endif /* WMM */
} __ATTRIB_PACK__ RxPD, *PRxPD;
//
// Tx control node data structure
//
// Tx control node is used by the driver to keep ready to send Tx packet
// information.
//
// Status :
// NPTxPacket : Packet reference
// LocalTxPD : Local TxPD reference
// SQTxPD : On-chip SQ memory TxPD reference
// BufVirtualAddr : Tx staging buffer logical address
// BufPhyAddr : Tx staging buffer physical address
// NextNode : link to next Tx control node
//
#if defined(__KERNEL__) || !defined(linux)
//
// Next : Link to nect command control node
// Status : Current command execution status
// PendingOID : Set or query OID passed
// PendingInfo : Init, Reset, Set OID, Get OID, Host command, etc.
// INTOption : USE_INT or NO_INT
// BytesWritten : For async OID processing
// BytesRead : For async OID processing
// BytesNeeded : For async OID processing
// InformationBuffer : For async OID processing
// BufVirtualAddr : Command buffer logical address
// BufPhyAddr : Command buffer physical address
//
typedef struct _CmdCtrlNode
{
struct list_head list;
u32 Status;
u32 PendingOID;
u16 PendingInfo; // Init, Reset, Set OID,
// Get OID, Host command, etc.
u16 INTOption;
void *InformationBuffer; // For async OID processing
u8 *BufVirtualAddr;
long long BufPhyAddr;
int retcode; /* Return status of the command */
#ifdef STDCMD
u16 CmdFlags;
#endif /* STDCMD */
u16 CmdWaitQWoken;
wait_queue_head_t cmdwait_q __ATTRIB_ALIGN__; // This has to be the last entry
} __ATTRIB_PACK__ CmdCtrlNode, *PCmdCtrlNode;
#endif
typedef struct _MRVL_WEP_KEY
{ // Based on WLAN_802_11_WEP, we extend the WEP buffer length to 128 bits
u32 Length;
u32 KeyIndex;
u32 KeyLength;
u8 KeyMaterial[MRVL_KEY_BUFFER_SIZE_IN_BYTE];
} __ATTRIB_PACK__ MRVL_WEP_KEY, *PMRVL_WEP_KEY;
typedef ULONGLONG WLAN_802_11_KEY_RSC;
typedef struct _WLAN_802_11_KEY
{
u32 Length;
u32 KeyIndex;
u32 KeyLength;
WLAN_802_11_MAC_ADDRESS BSSID;
WLAN_802_11_KEY_RSC KeyRSC;
u8 KeyMaterial[MRVL_MAX_KEY_WPA_KEY_LENGTH];
} __ATTRIB_PACK__ WLAN_802_11_KEY, *PWLAN_802_11_KEY;
#ifdef WPA
typedef struct _MRVL_WPA_KEY {
u32 KeyIndex;
u32 KeyLength;
u32 KeyRSC;
u8 KeyMaterial[MRVL_MAX_KEY_WPA_KEY_LENGTH];
} MRVL_WPA_KEY, *PMRVL_WPA_KEY;
typedef struct _MRVL_WLAN_WPA_KEY {
u8 EncryptionKey[16];
u8 MICKey1[8];
u8 MICKey2[8];
} MRVL_WLAN_WPA_KEY, *PMRVL_WLAN_WPA_KEY;
typedef struct _IE_WPA {
u8 Elementid;
u8 Len;
u8 oui[4];
u16 version;
} IE_WPA,*PIE_WPA;
#endif /* WPA */
/*
* Received Signal Strength Indication
*/
typedef LONG WLAN_802_11_RSSI; // in dBm
typedef struct _WLAN_802_11_CONFIGURATION_FH
{
u32 Length; // Length of structure
u32 HopPattern; // As defined by 802.11, MSB set
u32 HopSet; // to one if non-802.11
u32 DwellTime; // units are Kusec
} WLAN_802_11_CONFIGURATION_FH, *PWLAN_802_11_CONFIGURATION_FH
__ATTRIB_PACK__;
typedef struct _WLAN_802_11_CONFIGURATION
{
u32 Length; // Length of structure
u32 BeaconPeriod; // units are Kusec
u32 ATIMWindow; // units are Kusec
u32 DSConfig; // Frequency, units are kHz
WLAN_802_11_CONFIGURATION_FH FHConfig;
} WLAN_802_11_CONFIGURATION, *PWLAN_802_11_CONFIGURATION
__ATTRIB_PACK__;
typedef struct _WLAN_802_11_WEP
{
u32 Length; // Length of this structure
u32 KeyIndex; // 0 is the per-client key, 1-N are the
// global keys
u32 KeyLength; // length of key in bytes
u8 KeyMaterial[1]; // variable length depending on above field
} WLAN_802_11_WEP, *PWLAN_802_11_WEP __ATTRIB_PACK__;
typedef struct _WLAN_802_11_SSID {
u32 SsidLength; // length of SSID field below, in bytes;
// this can be zero.
u8 Ssid[WLAN_MAX_SSID_LENGTH]; // SSID information field
} WLAN_802_11_SSID, *PWLAN_802_11_SSID __ATTRIB_PACK__;
typedef struct _WPA_SUPPLICANT {
u8 Wpa_ie[256];
u8 Wpa_ie_len;
} WPA_SUPPLICANT, *PWPA_SUPPLICANT;
typedef struct _WLAN_802_11_BSSID {
u32 Length; // Length of this structure
WLAN_802_11_MAC_ADDRESS MacAddress; // BSSID
u8 Reserved[2];
WLAN_802_11_SSID Ssid; // SSID
u32 Privacy; // WEP encryption requirement
WLAN_802_11_RSSI Rssi; // receive signal
u32 Channel;
// strength in dBm
WLAN_802_11_NETWORK_TYPE NetworkTypeInUse;
WLAN_802_11_CONFIGURATION Configuration;
WLAN_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
WLAN_802_11_RATES SupportedRates;
#ifdef WMM
u8 Wmm_IE[WMM_PARA_IE_LENGTH + 2];
u8 Wmm_ie_len;
#endif /* WMM */
#ifdef FWVERSION3
u32 IELength;
u8 IEs[1];
#endif
#ifdef MULTI_BANDS
u16 bss_band; /* Network band.
BAND_B(0x01): 'b' band
BAND_G(0x02): 'g' band
BAND_A(0X04): 'a' band */
#endif
int extra_ie;
u8 TimeStamp[8];
IEEEtypes_PhyParamSet_t PhyParamSet;
IEEEtypes_SsParamSet_t SsParamSet;
IEEEtypes_CapInfo_t Cap;
u8 DataRates[WLAN_SUPPORTED_RATES];
#ifdef ENABLE_802_11H_TPC
u8 Sensed11H;
IEEEtypes_PowerConstraint_t PowerConstraint;
IEEEtypes_PowerCapability_t PowerCapability;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -