⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hostcmd.h

📁 marvell wifi driver GSPI-8385-LINUX-OMAP1510-5.0.10.p0-144-src.rar
💻 H
📖 第 1 页 / 共 3 页
字号:
/******************** (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
 */

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

    EXTENDED_SUPPORTED_RATES = 50,
    
    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 */
} __ATTRIB_PACK__ TxPD, *PTxPD;

//	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;

#if defined(__KERNEL__) || !defined(linux)

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 */
	u32 IELength;
	u8 IEs[1];
#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;
	IEEEtypes_TPCReport_t TPCReport;
#endif

#ifdef ENABLE_802_11D
	IEEEtypes_CountryInfoFullSet_t CountryInfo;
#endif

#ifdef WPA
	WPA_SUPPLICANT		wpa_supplicant;
#ifdef WPA2
	WPA_SUPPLICANT		wpa2_supplicant;
#endif /* WPA2 */

#ifdef CCX
    CCX_BSS_Info_t ccx_bss_info;
#endif

#endif 

} WLAN_802_11_BSSID, *PWLAN_802_11_BSSID __ATTRIB_PACK__;

typedef u32 WLAN_802_11_FRAGMENTATION_THRESHOLD;
typedef u32 WLAN_802_11_RTS_THRESHOLD;
typedef u32 WLAN_802_11_ANTENNA;

typedef struct _wlan_offset_value {
	u32	offset;
	u32	value;
} wlan_offset_value;

typedef struct _WLAN_802_11_FIXED_IEs {
	u8	Timestamp[8];
	u16	BeaconInterval;
	u16	Capabilities;
} WLAN_802_11_FIXED_IEs, *PWLAN_802_11_FIXED_IEs;

typedef struct _WLAN_802_11_VARIABLE_IEs {
	u8	ElementID;
	u8	Length;
	u8	data[1];
} WLAN_802_11_VARIABLE_IEs, *PWLAN_802_11_VARIABLE_IEs;

typedef struct _WLAN_802_11_AI_RESFI {
	u16	Capabilities;
	u16	StatusCode;
	u16	AssociationId;
} WLAN_802_11_AI_RESFI, *PWLAN_802_11_AI_RESFI;

typedef struct _WLAN_802_11_AI_REQFI {
	u16	Capabilities;
	u16	ListenInterval;
	WLAN_802_11_MAC_ADDRESS	CurrentAPAddress;
} WLAN_802_11_AI_REQFI, *PWLAN_802_11_AI_REQFI;

typedef struct _WLAN_802_11_ASSOCIATION_INFORMATION {
	u32			Length;
	u16			AvailableRequestFixedIEs;
	WLAN_802_11_AI_REQFI	RequestFixedIEs;
	u32			RequestIELength;
	u32			OffsetRequestIEs;
	u16			AvailableResponseFixedIEs;
	WLAN_802_11_AI_RESFI	ResponseFixedIEs;
	u32			ResponseIELength;
	u32			OffsetResponseIEs;
} WLAN_802_11_ASSOCIATION_INFORMATION, *PWLAN_802_11_ASSOCIATION_INFORMATION;

/* Linux Dynamic Power Management,
 *  If the user has enabled the deep sleep, user has the highest privilege.
 *  The Kernel PM takes the next priority
 */
/*
 *	Definition of data structure for each command
 */

/* Define general data structure */
typedef struct _HostCmd_DS_GEN {
	u16	Command;
	u16	Size;
	u16	SeqNum;
	u16	Result;
} __ATTRIB_PACK__ HostCmd_DS_GEN, *PHostCmd_DS_GEN
#ifdef DEEP_SLEEP
    ,HostCmd_DS_802_11_DEEP_SLEEP, *PHostCmd_DS_802_11_DEEP_SLEEP
#endif /* DEEP_SLEEP */
	;

/*
 * Define data structure for HostCmd_CMD_GET_HW_SPEC
 * This structure defines the response for the GET_HW_SPEC command
 */

typedef struct _HostCmd_DS_GET_HW_SPEC
{
	u16	HWIfVersion;		// HW Interface version number
	u16	Version;		// HW version number
	u16	NumOfTxPD;		// Max number of TxPD FW can handle
	u16	NumOfMCastAdr;		// Max no of Multicast address 
					// FW can handle
	u8	PermanentAddr[6];	// MAC address
	u16	RegionCode;		// Region Code
	u16	NumberOfAntenna;	// Number of antenna used
	u32	FWReleaseNumber;	// FW release number, 
					// example 0x1234=1.2.3.4
	u32	WcbBase; 		// Base Address of TxPD queue
	u32	RxPdRdPtr;		// Read Pointer of RxPd queue
	u32	RxPdWrPtr;		// Write Pointer of RxPd queue
	u32	fwCapInfo;
} __ATTRIB_PACK__ HostCmd_DS_GET_HW_SPEC, *PHostCmd_DS_GET_HW_SPEC;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -