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

📄 wlan_defs.h

📁 marvell wifi driver GSPI-8385-LINUX-OMAP1510-5.0.10.p0-144-src.rar
💻 H
📖 第 1 页 / 共 2 页
字号:
/*****************************************************************************
 *
 *  	File:	wlan_defs.h
 *
 *****************************************************************************/

#ifndef _WLAN_DEFS_H_
#define _WLAN_DEFS_H_

#include	"os_defs.h"

/* Bit definition */

#define DW_BIT_0	0x00000001
#define DW_BIT_1	0x00000002
#define DW_BIT_2	0x00000004
#define DW_BIT_3	0x00000008
#define DW_BIT_4	0x00000010
#define DW_BIT_5	0x00000020
#define DW_BIT_6	0x00000040
#define DW_BIT_7	0x00000080
#define DW_BIT_8	0x00000100
#define DW_BIT_9	0x00000200
#define DW_BIT_10	0x00000400
#define DW_BIT_11       0x00000800
#define DW_BIT_12       0x00001000
#define DW_BIT_13       0x00002000
#define DW_BIT_14       0x00004000
#define DW_BIT_15       0x00008000
#define DW_BIT_16       0x00010000
#define DW_BIT_17       0x00020000
#define DW_BIT_18       0x00040000
#define DW_BIT_19       0x00080000
#define DW_BIT_20       0x00100000
#define DW_BIT_21       0x00200000
#define DW_BIT_22       0x00400000
#define DW_BIT_23       0x00800000
#define DW_BIT_24       0x01000000
#define DW_BIT_25       0x02000000
#define DW_BIT_26       0x04000000
#define DW_BIT_27       0x08000000
#define DW_BIT_28       0x10000000
#define DW_BIT_29       0x20000000
#define DW_BIT_30	0x40000000
#define DW_BIT_31	0x80000000

#define W_BIT_0		0x0001
#define W_BIT_1		0x0002
#define W_BIT_2		0x0004
#define W_BIT_3		0x0008
#define W_BIT_4		0x0010
#define W_BIT_5		0x0020
#define W_BIT_6		0x0040
#define W_BIT_7		0x0080
#define W_BIT_8		0x0100
#define W_BIT_9		0x0200
#define W_BIT_10	0x0400
#define W_BIT_11	0x0800
#define W_BIT_12	0x1000
#define W_BIT_13	0x2000
#define W_BIT_14	0x4000
#define W_BIT_15	0x8000

#define B_BIT_0		0x01
#define B_BIT_1		0x02
#define B_BIT_2		0x04
#define B_BIT_3		0x08
#define B_BIT_4		0x10
#define B_BIT_5		0x20
#define B_BIT_6		0x40
#define B_BIT_7		0x80

#ifdef	DEBUG_LEVEL1
#ifndef DEBUG_LEVEL0
#define	DEBUG_LEVEL0
#endif
#endif

#ifdef	DEBUG_LEVEL2
#ifndef DEBUG_LEVEL0
#define	DEBUG_LEVEL0
#endif
#ifndef DEBUG_LEVEL1
#define	DEBUG_LEVEL1
#endif
#endif

#ifdef	DEBUG_LEVEL0

#define	HEXDUMP1(x, y, z)	HexDump(x, y, z)
#define HEXDUMP(x, y, z)	HexDump(x, y, z)

#ifdef CONFIG_X86
#define	PRINTK(x...)		printk(KERN_DEBUG x)
#else
#define	PRINTK(x...)		printk(x)
#endif 

#else

#define	PRINTK(x...)		
#define HEXDUMP(x,y,z)
#define HEXDUMP1(x,y,z)

#endif  /* DEBUG_LEVEL0 */

#ifdef	DEBUG_LEVEL1

#ifdef CONFIG_X86
#define	PRINTK1(x...)		printk(KERN_DEBUG x)
#else
#define	PRINTK1(x...)		printk(x)
#endif 

#else  

#define	PRINTK1(...)

#endif  /* DEBUG_LEVEL1 */

/* Enable this flag if u want to see a lot of PRINTK's..*/
#ifdef	DEBUG_LEVEL2

#ifdef CONFIG_X86
#define	PRINTK2(x...)		printk(KERN_DEBUG x)
#else
#define	PRINTK2(x...)		printk(x)
#endif 

#define	ENTER()			PRINTK2("Enter: %s, %s:%i\n", __FUNCTION__, \
							__FILE__, __LINE__)
#define	LEAVE()			PRINTK2("Exit: %s, %s:%i\n", __FUNCTION__, \
							__FILE__, __LINE__)
#define	ENTER1()		PRINTK2("Enter: %s, %s:%i\n", __FUNCTION__, \
							__FILE__, __LINE__)
#define	LEAVE1()		PRINTK2("Exit: %s, %s:%i\n", __FUNCTION__, \
							__FILE__, __LINE__)
#define	DEBUGINFO(x)		printk(KERN_INFO x);
#else 
#define	PRINTK2(...)
#define	ENTER()
#define	LEAVE()
#define	ENTER1()
#define	LEAVE1()
#define	DEBUGINFO(x)
#endif  /* DEBUG_LEVEL2 */

#ifndef	TRUE
#define TRUE			1
#endif
#ifndef	FALSE
#define	FALSE			0
#endif

#ifdef	DEBUG_LEVEL0
static inline void HexDump(char *prompt, u8 * buf, int len)
{
	int             i = 0;

	/* 
	 * Here dont change these 'printk's to 'PRINTK'. Using 'PRINTK' 
	 * macro will make the hexdump to add '<7>' before each byte 
	 */
	printk(KERN_DEBUG "%s: ", prompt);
	for (i = 1; i <= len; i++) {
		printk("%02x ", (u8) * buf);
		buf++;
	}

	printk("\n");
}
#endif

#define EXTERN			extern

#define ASSERT(cond)

#ifndef MIN
#define MIN(a,b)		((a) < (b) ? (a) : (b))
#endif

//
//          Buffer Constants
//
//	The size of SQ memory PPA, DPA are 8 DWORDs, that keep the physical
//	addresses of TxPD buffers. Station has only 8 TxPD available, Whereas
//	driver has more local TxPDs. Each TxPD on the host memory is associated 
//	with a Tx control node. The driver maintains 8 RxPD descriptors for 
//	station firmware to store Rx packet information.
//
//	Current version of MAC has a 32x6 multicast address buffer.
//
//	802.11b can have up to  14 channels, the driver keeps the
//	BSSID(MAC address) of each APs or Ad hoc stations it has sensed.
//

#define MRVDRV_SIZE_OF_PPA		0x00000008
#define MRVDRV_SIZE_OF_DPA		0x00000008
#define MRVDRV_NUM_OF_TxPD		0x00000020
#define MRVDRV_MAX_MULTICAST_LIST_SIZE	32
#define MRVDRV_NUM_OF_CMD_BUFFER        10
#define MRVDRV_SIZE_OF_CMD_BUFFER       (2 * 1024) 
#define MRVDRV_MAX_CHANNEL_SIZE		14
#define MRVDRV_MAX_BSSID_LIST		64
#define MRVDRV_TIMER_10S		10000
#define MRVDRV_TIMER_5S			5000
#define MRVDRV_TIMER_1S			1000
#define MRVDRV_ASSOCIATION_TIME_OUT	255
#define MRVDRV_SNAP_HEADER_LEN		8
#define MRVDRV_ETH_ADDR_LEN             6
#define MRVDRV_ETH_HEADER_SIZE          14

#define	WLAN_UPLD_SIZE			2312
#define DEV_NAME_LEN			32

#ifndef	ETH_ALEN
#define ETH_ALEN			6
#endif

//
//          Misc constants
//
//          This section defines 802.11 specific contants
//

#define MRVDRV_MAX_SSID_LENGTH			32
#define MRVDRV_MAX_BSS_DESCRIPTS		16
#define MRVDRV_MAX_REGION_CODE			6

#ifdef PS_REQUIRED
#define MRVDRV_IGNORE_MULTIPLE_DTIM		0xfffe
#define MRVDRV_MIN_MULTIPLE_DTIM		1
#define MRVDRV_MAX_MULTIPLE_DTIM		5
#define MRVDRV_DEFAULT_MULTIPLE_DTIM		1
#endif /* PS_REQUIRED */

#define MRVDRV_DEFAULT_LISTEN_INTERVAL		10
#define MRVDRV_DEFAULT_LOCAL_LISTEN_INTERVAL		0
#define MRVDRV_MAX_TX_POWER		      	15

#ifdef PROGRESSIVE_SCAN
#define	MRVDRV_CHANNELS_PER_SCAN		4
#define	MRVDRV_MAX_CHANNELS_PER_SCAN		14
#endif /* PROGRESSIVE_SCAN */

#define	MRVDRV_CHANNELS_PER_ACTIVE_SCAN		14

//
// TxPD Status
//
//	Station firmware use TxPD status field to report final Tx transmit
//	result, Bit masks are used to present combined situations.
//

#define MRVDRV_TxPD_POWER_MGMT_NULL_PACKET 0x01
#define MRVDRV_TxPD_POWER_MGMT_LAST_PACKET 0x08

//
// Tx control node status
//
#define MRVDRV_TX_CTRL_NODE_STATUS_IDLE      0x0000

//
// RxPD Status
//
#define MRVDRV_RXPD_STATUS_OK                0x0001
#define MRVDRV_RXPD_STATUS_MULTICAST_RX      0x0002

//
// RxPD Status - Received packet types
//
#define	MRVDRV_RXPD_STATUS_MAXTYPES_RX		6

//
// Link spped
//
#define MRVDRV_LINK_SPEED_1mbps          10000   // in unit of 100bps
#define MRVDRV_LINK_SPEED_11mbps         110000

//
// RSSI-related defines
//
//	RSSI constants are used to implement 802.11 RSSI threshold 
//	indication. if the Rx packet signal got too weak for 5 consecutive
//	times, miniport driver (driver) will report this event to wrapper
//

#define MRVDRV_RSSI_TRIGGER_DEFAULT      	(-200)
#define MRVDRV_RSSI_DEFAULT_NOISE_VALUE		0
#define MRVDRV_NF_DEFAULT_SCAN_VALUE		(-96)

/* RTS/FRAG related defines */
#define MRVDRV_RTS_MIN_VALUE		0
#define MRVDRV_RTS_MAX_VALUE		2347
#define MRVDRV_FRAG_MIN_VALUE		256
#define MRVDRV_FRAG_MAX_VALUE		2346

/* Fixed IE size is 8 bytes time stamp + 2 bytes beacon interval +
 * 2 bytes cap */
#define MRVL_FIXED_IE_SIZE      12

#define EXTRA_LEN	36 /* This is for firmware specific length */
#define MRVDRV_MAXIMUM_ETH_PACKET_SIZE	1514  

#define MRVDRV_ETH_TX_PACKET_BUFFER_SIZE \
	(MRVDRV_MAXIMUM_ETH_PACKET_SIZE + sizeof(TxPD) + EXTRA_LEN)

#define MRVDRV_ETH_RX_PACKET_BUFFER_SIZE \
	(MRVDRV_MAXIMUM_ETH_PACKET_SIZE + sizeof(RxPD) \
	 + MRVDRV_SNAP_HEADER_LEN + EXTRA_LEN)

#define	CMD_F_STDCMD		(1 << 0)

/* WEP list macros & data structures */
#define MRVL_KEY_BUFFER_SIZE_IN_BYTE  16

#define MRVDRV_SCAN_LIST_VAR_IE_SPACE  	256 // to resolve CISCO AP extension
#define FW_IS_WPA_ENABLED(_adapter) \
		(_adapter->fwCapInfo & FW_CAPINFO_WPA)
	#define FW_CAPINFO_WPA  	(1 << 0)
#define WLAN_802_11_AI_REQFI_CAPABILITIES 	1
#define WLAN_802_11_AI_REQFI_LISTENINTERVAL 	2
#define WLAN_802_11_AI_REQFI_CURRENTAPADDRESS 	4

#define WLAN_802_11_AI_RESFI_CAPABILITIES 	1
#define WLAN_802_11_AI_RESFI_STATUSCODE 	2
#define WLAN_802_11_AI_RESFI_ASSOCIATIONID 	4

#define MRVDRV_ASSOCIATE_INFO_BUFFER_SIZE 500
/* Support 4 keys per key set */
#define MRVL_NUM_WPA_KEY_PER_SET        4
#define MRVL_MAX_WPA_KEY_LENGTH 	32
#define MRVL_MAX_KEY_WPA_KEY_LENGTH     32

#define WPA_AES_KEY_LEN 		16
#define WPA_TKIP_KEY_LEN 		32

#define RF_ANTENNA_1		0x1
#define RF_ANTENNA_2		0x2
#define RF_ANTENNA_AUTO		0xFFFF

/* A few details needed for WEP (Wireless Equivalent Privacy) */
#define MAX_KEY_SIZE		13	// 104 bits
#define MIN_KEY_SIZE		5	// 40 bits RC4 - WEP
#define MAX_SIZE_ARRA		64

#ifdef MULTI_BANDS
#define BS_802_11B	0
#define BS_802_11G	1
#define BS_802_11A	2
/*
** Setup the number of rates pased in the driver/firmware API.
*/
#define A_SUPPORTED_RATES		14

#define FW_MULTI_BANDS_SUPPORT	(DW_BIT_8 | DW_BIT_9 | DW_BIT_10)
#define	BAND_B			(0x01)
#define	BAND_G			(0x02) 
#define BAND_A			(0x04)
#define ALL_802_11_BANDS	(BAND_B | BAND_G | BAND_A)

#define	IS_SUPPORT_MULTI_BANDS(_adapter) \
				(_adapter->fwCapInfo & FW_MULTI_BANDS_SUPPORT)
#define GET_FW_DEFAULT_BANDS(_adapter)	\
				((_adapter->fwCapInfo >> 8) & ALL_802_11_BANDS)

/*
** Setup the number of rates pased in the driver/firmware API.
*/
#define HOSTCMD_SUPPORTED_RATES A_SUPPORTED_RATES
#else
#ifdef G_RATE
#define HOSTCMD_SUPPORTED_RATES G_SUPPORTED_RATES
#else
#define HOSTCMD_SUPPORTED_RATES B_SUPPORTED_RATES
#endif

⌨️ 快捷键说明

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