📄 hostcmd.h
字号:
#ifdef MRV_CHIP_8385H
#define HostCmd_SCAN_MIN_CH_TIME 100 //60
#define HostCmd_SCAN_MAX_CH_TIME 100 //60
#else
#define HostCmd_SCAN_MIN_CH_TIME 100 //100
#define HostCmd_SCAN_MAX_CH_TIME 100 //100
#endif
#define HostCmd_SCAN_PROBE_DELAY_TIME 0
// Define action or option for HostCmd_CMD_802_11_QUERY_STATUS
#define HostCmd_STATUS_FW_INIT 0x0000
#define HostCmd_STATUS_FW_IDLE 0x0001
#define HostCmd_STATUS_FW_WORKING 0x0002
#define HostCmd_STATUS_FW_ERROR 0x0003
#define HostCmd_STATUS_FW_POWER_SAVE 0x0004
#define HostCmd_STATUS_MAC_RX_ON 0x0001
#define HostCmd_STATUS_MAC_TX_ON 0x0002
#define HostCmd_STATUS_MAC_LOOP_BACK_ON 0x0004
#define HostCmd_STATUS_MAC_WEP_ENABLE 0x0008
#define HostCmd_STATUS_MAC_INT_ENABLE 0x0010
// Define action or option for HostCmd_CMD_MAC_CONTROL
#define HostCmd_ACT_MAC_RX_ON 0x0001
#define HostCmd_ACT_MAC_TX_ON 0x0002
#define HostCmd_ACT_MAC_LOOPBACK_ON 0x0004
#define HostCmd_ACT_MAC_WEP_ENABLE 0x0008
#define HostCmd_ACT_MAC_INT_ENABLE 0x0010
#define HostCmd_ACT_MAC_MULTICAST_ENABLE 0x0020
#define HostCmd_ACT_MAC_BROADCAST_ENABLE 0x0040
#define HostCmd_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
#define HostCmd_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
#ifdef WPA2
#define HostCmd_ACT_MAC_STRICT_PROTECTION_ENABLE 0x0400
#endif
//BugFix
#define HostCmd_ACT_MAC_WEP_TYPE 0x8000
// Define action or option or constant for HostCmd_CMD_MAC_MULTICAST_ADR
#define HostCmd_SIZE_MAC_ADR 6
#define HostCmd_MAX_MCAST_ADRS 32
// Define action or option for HostCmd_CMD_802_11_SNMP_MIB
#define HostCmd_TYPE_MIB_FLD_BOOLEAN 0x0001 // Boolean
#define HostCmd_TYPE_MIB_FLD_INTEGER 0x0002 // 32 UCHAR unsigned integer
#define HostCmd_TYPE_MIB_FLD_COUNTER 0x0003 // Counter
#define HostCmd_TYPE_MIB_FLD_OCT_STR 0x0004 // Octet string
#define HostCmd_TYPE_MIB_FLD_DISPLAY_STR 0x0005 // String
#define HostCmd_TYPE_MIB_FLD_MAC_ADR 0x0006 // MAC address
#define HostCmd_TYPE_MIB_FLD_IP_ADR 0x0007 // IP address
#define HostCmd_TYPE_MIB_FLD_WEP 0x0008 // WEP
// Define action or option for HostCmd_CMD_802_11_RADIO_CONTROL
//#ifdef MRVL_SET_RF_RADIO
#define HostCmd_TYPE_AUTO_PREAMBLE (0x0002 << 1)
#define HostCmd_TYPE_SHORT_PREAMBLE (0x0001 << 1)
#define HostCmd_TYPE_LONG_PREAMBLE (0x0000 << 1)
//#else
//#define HostCmd_TYPE_AUTO_PREAMBLE 0x0001
//#define HostCmd_TYPE_SHORT_PREAMBLE 0x0002
//#define HostCmd_TYPE_LONG_PREAMBLE 0x0003
//#endif
#define TURN_ON_RF 0x01
// Specific for CF
#define SET_AUTO_PREAMBLE 0x05
#define SET_SHORT_PREAMBLE 0x03
#define SET_LONG_PREAMBLE 0x01
// Define action or option for CMD_802_11_RF_CHANNEL
#define HostCmd_TYPE_802_11A 0x0001
#define HostCmd_TYPE_802_11B 0x0002
// Define action or option for HostCmd_CMD_802_11_RF_TX_POWER
#define HostCmd_ACT_TX_POWER_OPT_GET 0x0000
#define HostCmd_ACT_TX_POWER_OPT_SET 0x0001
#define HostCmd_ACT_TX_POWER_OPT_SET_HIGH 0x8007
#define HostCmd_ACT_TX_POWER_OPT_SET_MID 0x8004
#define HostCmd_ACT_TX_POWER_OPT_SET_LOW 0x8000
#define HostCmd_ACT_TX_POWER_OPT_SET_TPC 0x8fff //Auto Power
#define HostCmd_ACT_TX_POWER_INDEX_TPC 0xffff
#define HostCmd_ACT_TX_POWER_INDEX_HIGH 0x0007
#define HostCmd_ACT_TX_POWER_INDEX_MID 0x0004
#define HostCmd_ACT_TX_POWER_INDEX_LOW 0x0000
#define HostCmd_ACT_TX_POWER_LEVEL_MIN 0x000e // in dbm
#define HostCmd_ACT_TX_POWER_LEVEL_GAP 0x0001 // in dbm
// Define action or option for HostCmd_CMD_802_11_DATA_RATE
#define HostCmd_ACT_SET_TX_AUTO 0x0000
#define HostCmd_ACT_SET_TX_FIX_RATE 0x0001
#define HostCmd_ACT_GET_TX_RATE 0x0002
#define HostCmd_ACT_SET_RX 0x0001
#define HostCmd_ACT_SET_TX 0x0002
#define HostCmd_ACT_SET_BOTH 0x0003
#define HostCmd_ACT_GET_RX 0x0004
#define HostCmd_ACT_GET_TX 0x0008
#define HostCmd_ACT_GET_BOTH 0x000c
// TODO: Need to verify these values
// command option for QOS commands
#define HostCmd_ACT_SET 0x0001
#define HostCmd_ACT_GET 0x0000
#define HostCmd_ENABLE_RSN 0x0001
#define HostCmd_DISABLE_RSN 0x0000
#ifdef ADHOCAES
#define HostCmd_ACT_GET_AES 0x0002
#define HostCmd_ACT_SET_AES 0x0003
#define HostCmd_ACT_REMOVE_AES 0x0004
#endif
#define TYPE_ANTENNA_DIVERSITY 0xffff
// Define action or option for HostCmd_CMD_802_11_PS_MODE
#define HostCmd_TYPE_CAM 0x0000
#define HostCmd_TYPE_MAX_PSP 0x0001
#define HostCmd_TYPE_FAST_PSP 0x0002
#define HostCmd_SubCmd_Enter_PS 0x0030
#define HostCmd_SubCmd_Exit_PS 0x0031
#define HostCmd_SubCmd_TxPend_PS 0x0032
#define HostCmd_SubCmd_ChangeSet_PS 0x0033
#define HostCmd_SubCmd_Sleep_Confirmed 0x0034
#define HostCmd_SubCmd_Full_PowerDown 0x0035
#define HostCmd_SubCmd_Full_PowerUp 0x0036
// notify FW that there's no pending TX pkt
#define HostCmd_SubCmd_No_Tx_Pkt 0x0037
// action for CMD_EEPROM_ACCESS
#define HostCmd_ACT_READ 0x0000
#define HostCmd_ACT_WRITE 0x0001
#ifdef TLV_SCAN
#define HostCmd_SCAN_RADIO_TYPE_BG 0
#define HostCmd_SCAN_RADIO_TYPE_A 1
#define HostCmd_SCAN_PASSIVE_MAX_CH_TIME 100
#endif
#ifdef TLV_SCAN
#define TLV_TYPE_SSID 0x0000
#define TLV_TYPE_RATES 0x0001
#define TLV_TYPE_CHANLIST 0x0101
#define TLV_TYPE_PHY_FH 0x0002
#define TLV_TYPE_PHY_DS 0x0003
#define TLV_TYPE_CF 0x0004
#define TLV_TYPE_IBSS 0x0006
#endif
#ifdef ENABLE_802_11D
#define TLV_TYPE_DOMAIN 0x0007
#endif
#ifdef WPA
#ifdef WPA2
#define TLV_TYPE_KEY_MATERIAL 0x0100
#endif
#endif
#ifdef ENABLE_802_11H_TPC
#define TLV_TYPE_POWER_CONSTRAINT 0x0020
#define TLV_TYPE_POWER_CAPABILITY 0x0021
#endif
#define TLV_TYPE_RSSI 0x0104
#define TLV_TYPE_BCNMISS 0x0107
//////////////////////////////////////////////////////////////////
//
// IEEE scan.confirm data structure borrowed from station FW code
// Reference: IEEE 802.11 1999 Spec 10.3.2.2.2
//
//////////////////////////////////////////////////////////////////
#ifdef UNDER_CE_XSCALE
#pragma pack(1)
#endif // UNDER_CE_XSCALE
// In station FW code, enum type is 1 byte UCHAR,
typedef enum
{
SSID = 0,
SUPPORTED_RATES,
FH_PARAM_SET,
DS_PARAM_SET,
CF_PARAM_SET,
TIM,
IBSS_PARAM_SET,
COUNTRY_INFO = 7,
CHALLENGE_TEXT = 16,
POWER_CONSTRAINT = 32,
POWER_CAPABILITY = 33,
TPC_REQUEST = 34,
TPC_REPORT = 35,
EXTENDED_SUPPORTED_RATES = 50,
WPA_IE = 221,
WPA_OUI_TYPE=2,
WPA2_IE = 48,
EXTRA_IE = 133,
WMM_OUI_TYPE=2
} IEEEtypes_ElementId_e;
typedef struct IEEEtypes_CapInfo_t
{
USHORT Ess:1;
USHORT Ibss:1;
USHORT CfPollable:1;
USHORT CfPollRqst:1;
USHORT Privacy:1;
USHORT ShortPreamble:1;
USHORT Pbcc:1;
USHORT ChanAgility:1 ;
//USHORT Rsrvd89:2;
USHORT SpectrumMgmt:1;
USHORT Rsrvd9:1;
USHORT ShortSlotTime:1;
USHORT Rsrvd1112:2;
USHORT DSSSOFDM:1;
USHORT Rsrvd1415:2;
} IEEEtypes_CapInfo_t;
#pragma pack(1)
typedef struct _MrvlIEtypesHeader {
USHORT Type;
USHORT Len;
} MrvlIEtypesHeader_t;
#ifdef ENABLE_802_11D
typedef enum {
DISABLE_11D = 0,
ENABLE_11D = 1,
} state_11d_t;
// Data structure for Country IE
typedef struct _IEEEtypes_SubbandSet
{
UCHAR FirstChan;
UCHAR NoOfChan;
UCHAR MaxTxPwr;
} IEEEtypes_SubbandSet_t;
typedef struct _IEEEtypes_CountryInfoSet
{
UCHAR ElementId;
UCHAR Len;
UCHAR CountryCode[COUNTRY_CODE_LEN];
IEEEtypes_SubbandSet_t Subband[1];
} IEEEtypes_CountryInfoSet_t;
typedef struct _IEEEtypes_CountryInfoFullSet
{
UCHAR ElementId;
UCHAR Len;
UCHAR CountryCode[COUNTRY_CODE_LEN];
IEEEtypes_SubbandSet_t Subband[MRVDRV_MAX_SUBBAND_802_11D];
} IEEEtypes_CountryInfoFullSet_t;
typedef struct _MrvlIEtypes_DomainParamSet
{
MrvlIEtypesHeader_t Header;
UCHAR CountryCode[COUNTRY_CODE_LEN];
IEEEtypes_SubbandSet_t Subband[1];
} MrvlIEtypes_DomainParamSet_t;
// Define data structure for HostCmd_CMD_802_11D_DOMAIN_INFO
typedef struct _HostCmd_DS_802_11D_DOMAIN_INFO
{
USHORT Command;
USHORT Size;
USHORT SeqNum;
USHORT Result;
USHORT Action;
MrvlIEtypes_DomainParamSet_t Domain;
} HostCmd_DS_802_11D_DOMAIN_INFO, *PHostCmd_DS_802_11D_DOMAIN_INFO;
// Define data structure for HostCmd_RET_802_11D_DOMAIN_INFO
typedef struct _HostCmd_DS_802_11D_DOMAIN_INFO_RSP
{
USHORT Command;
USHORT Size;
USHORT SeqNum;
USHORT Result;
USHORT Action;
MrvlIEtypes_DomainParamSet_t Domain;
} HostCmd_DS_802_11D_DOMAIN_INFO_RSP, *PHostCmd_DS_802_11D_DOMIAN_INFO_RSP;
#endif
#ifdef WPA2
typedef union _KeyInfo_WEP_t
{
UCHAR Reserved; // bits 5-15: Reserved
UCHAR WepKeyIndex; // bits 1-4: Specifies the index of key
UCHAR isWepDefaultKey; // bit 0: Specifies that this key is to be used as the default for TX data packets
} KeyInfo_WEP_t;
typedef union _KeyInfo_TKIP_t
{
UCHAR Reserved; // bits 3-15: Reserved
UCHAR isKeyEnabled; // bit 2: Specifies that this key is enabled and valid to use
UCHAR isUnicastKey; // bit 1: Specifies that this key is to be used as the unicast key
UCHAR isMulticastKey; // bit 0: Specifies that this key is to be used as the multicast key
} KeyInfo_TKIP_t;
typedef union _KeyInfo_AES_t
{
UCHAR Reserved; // bits 3-15: Reserved */
UCHAR isKeyEnabled; // bit 2: Specifies that this key is enabled and valid to use
UCHAR isUnicastKey; // bit 1: Specifies that this key is to be used as the unicast key
UCHAR isMulticastKey; // bit 0: Specifies that this key is to be used as the multicast key
} KeyInfo_AES_t;
typedef struct _KeyMaterial_TKIP_t
{
UCHAR TkipKey[16]; // TKIP encryption/decryption key
UCHAR TkipTxMicKey[8]; // TKIP TX MIC Key
UCHAR TkipRxMicKey[8]; // TKIP RX MIC Key
} KeyMaterial_TKIP_t, *PKeyMaterial_TKIP_t;
typedef struct _KeyMaterial_AES_t
{
UCHAR AesKey[16]; // AES encryption/decryption key
} KeyMaterial_AES_t, *PKeyMaterial_AES_t;
typedef struct _MrvlIEtype_KeyParamSet_t
{
USHORT Type; // Type ID
USHORT Length; // Length of Payload
USHORT KeyTypeId; // Type of Key: WEP=0, TKIP=1, AES=2
USHORT KeyInfo; // Key Control Info specific to a KeyTypeId
USHORT KeyLen; // Length of key
UCHAR Key[32]; // Key material of size KeyLen
} MrvlIEtype_KeyParamSet_t, *PMrvlIEtype_KeyParamSet_t;
typedef struct _HostCmd_DS_802_11_KEY_MATERIAL
{
USHORT Command;
USHORT Size;
USHORT SeqNum;
USHORT Result;
USHORT Action;
MrvlIEtype_KeyParamSet_t KeyParamSet;
} HostCmd_DS_802_11_KEY_MATERIAL, *PHostCmd_DS_802_11_KEY_MATERIAL;
#endif /* WPA2 */
typedef struct IEEEtypes_CfParamSet_t
{
UCHAR ElementId;
UCHAR Len;
UCHAR CfpCnt;
UCHAR CfpPeriod;
USHORT CfpMaxDuration;
USHORT CfpDurationRemaining;
} IEEEtypes_CfParamSet_t;
typedef struct IEEEtypes_IbssParamSet_t
{
UCHAR ElementId;
UCHAR Len;
USHORT AtimWindow;
} IEEEtypes_IbssParamSet_t;
typedef union IEEEtypes_SsParamSet_t
{
IEEEtypes_CfParamSet_t CfParamSet;
IEEEtypes_IbssParamSet_t IbssParamSet;
} IEEEtypes_SsParamSet_t;
typedef struct IEEEtypes_FhParamSet_t
{
UCHAR ElementId;
UCHAR Len;
USHORT DwellTime;
UCHAR HopSet;
UCHAR HopPattern;
UCHAR HopIndex;
} IEEEtypes_FhParamSet_t;
typedef struct IEEEtypes_DsParamSet_t
{
UCHAR ElementId;
UCHAR Len;
UCHAR CurrentChan;
} IEEEtypes_DsParamSet_t;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -