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

📄 am930hw.h

📁 Linux Wireless LAN Project 的目标是开发一个完整的
💻 H
📖 第 1 页 / 共 2 页
字号:
/* am930hw.c: Handles the AM79C930 specifics*	--------------------------------------------------------------------**   Linux WLAN **   The contents of this file are subject to the Mozilla Public*   License Version 1.0 (the "License"); you may not use this file*   except in compliance with the License. You may obtain a copy of*   the License at http://www.mozilla.org/MPL/**   Software distributed under the License is distributed on an "AS*   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or*   implied. See the License for the specific language governing*   rights and limitations under the License.**   The initial developer of the original code is Mark S. Mathews*   <mark@absoval.com>.  Portions created by Mark S. Mathews*   are Copyright (C) 1998 AbsoluteValue Software, Inc.  All Rights Reserved.**	--------------------------------------------------------------------*/#ifndef _LINUX_AM930HW_H#define _LINUX_AM930HW_H#include <wlan/p80211hdr.h>/*===== Control/Status and Command block Related Constants =*//*--- Fixed memory offsets --------------------------*/#define SU_OFF_LAST_TXDESC		0x3ec#define SU_OFF_RSVD1			0x400#define SU_OFF_BANNER			0x480#define SU_OFF_CMD_BLK			0x4a0#define SU_OFF_CNTL_STATUS_BLK	0x4f0#define SU_OFF_VBM				0x500#define SU_OFF_BUFFER			0x600/*--- Global Sizes ----------------------------------*/#define SU_LEN_BANNER			32/*===== Descriptor Related Constants & Macros =========*//*--- next testing macro (applies to Rx and Tx) -------*/#define SUTXD_ISLAST(x)			((x) & BIT31)#define SURXD_ISLAST(x)			((x) & BIT31)/*=============================================================*//*------ Types and their related constants --------------------*//*=============================================================*//*--- Last Completed Tx Descriptor Block ---------------*/__WLAN_PRAGMA_PACK1__typedef struct am930txcmplt_blk{	volatile UINT32	last_bcast		__WLAN_ATTRIB_PACK__;	volatile UINT32	last_mgmt		__WLAN_ATTRIB_PACK__;	volatile UINT32	last_data		__WLAN_ATTRIB_PACK__;	volatile UINT32	last_pspoll		__WLAN_ATTRIB_PACK__;	volatile UINT32	last_cfpoll		__WLAN_ATTRIB_PACK__;} am930txcmplt_blk_t;__WLAN_PRAGMA_PACKDFLT__#define TXCMPLT_OFF_BCAST	0#define	TXCMPLT_OFF_MGMT	4#define TXCMPLT_OFF_DATA	8#define TXCMPLT_OFF_PSPOLL	12#define TXCMPLT_OFF_CFPOLL	16/*=============================================================*//*--- Command Block for sending commands to f/w ---------------*/__WLAN_PRAGMA_PACK1__typedef struct am930cmd_blk{	volatile UINT8	code			__WLAN_ATTRIB_PACK__;	volatile UINT8	status			__WLAN_ATTRIB_PACK__;	volatile UINT8	error_offset	__WLAN_ATTRIB_PACK__;	volatile UINT8	reserved		__WLAN_ATTRIB_PACK__;	volatile UINT8	cmd_parms[76]	__WLAN_ATTRIB_PACK__;} am930cmd_blk_t;__WLAN_PRAGMA_PACKDFLT__#define CMD_OFF_CODE	0#define CMD_OFF_STATUS	1#define CMD_OFF_ERR_OFF	2#define CMD_OFF_PARMS	4/*--- Command Block - Command values -----------------*/#define	SUCMD_CMD_TEST_NOP		0x01#define	SUCMD_CMD_SET_MIB_VAR	0x02#define SUCMD_CMD_INIT_TX		0x03#define SUCMD_CMD_FLUSH_TX		0x04#define SUCMD_CMD_EN_RCVR		0x05#define SUCMD_CMD_DIS_RCVR		0x06#define SUCMD_CMD_SLEEP			0x07#define SUCMD_CMD_WAKE			0x08#define	SUCMD_CMD_GET_MIB_VAR	0x09#define	SUCMD_CMD_SCAN			0x0a#define	SUCMD_CMD_SYNC			0x0b#define SUCMD_CMD_RESUME		0x0c/*--- Command Block - Status values ------------------*/#define SUCMD_STAT_IDLE			0x00#define SUCMD_STAT_CMPLT			0x01#define	SUCMD_STAT_REJECT_UNK	0x02#define SUCMD_STAT_REJECT_ARG	0x03#define SUCMD_STAT_REJECT_NOS	0x04#define SUCMD_STAT_REJECT_ARG2	0x05#define SUCMD_STAT_REJECT_MODE	0x06/* other error codes undocumented *//*=============================================================*//*--- Control/Status Block ------------------------------------*/__WLAN_PRAGMA_PACK1__typedef struct am930cs_blk{	volatile UINT8		self_test_status	__WLAN_ATTRIB_PACK__;	volatile UINT8		sta_state			__WLAN_ATTRIB_PACK__;	volatile UINT8		user_rtn			__WLAN_ATTRIB_PACK__;	volatile UINT8		int_status			__WLAN_ATTRIB_PACK__;	volatile UINT8		int_mask			__WLAN_ATTRIB_PACK__;	volatile UINT8		lockout_fw			__WLAN_ATTRIB_PACK__;	volatile UINT8		lockout_host		__WLAN_ATTRIB_PACK__;	volatile UINT8		int_status2			__WLAN_ATTRIB_PACK__;	volatile UINT32		rsvd				__WLAN_ATTRIB_PACK__;	volatile UINT8		sw_dis_pwrdn		__WLAN_ATTRIB_PACK__;	volatile UINT8		int_mask2			__WLAN_ATTRIB_PACK__;	volatile UINT8		driver_state		__WLAN_ATTRIB_PACK__;	volatile UINT8		rsvd2				__WLAN_ATTRIB_PACK__;} am930cs_blk_t;__WLAN_PRAGMA_PACKDFLT__#define CS_OFF_SELF_TEST			0#define CS_OFF_STA_STATE			1#define CS_OFF_USER_RTN				2#define CS_OFF_INT_STATUS			3#define CS_OFF_INT_MASK				4#define CS_OFF_LOCKOUT_FW			5#define CS_OFF_LOCKOUT_HOST			6#define CS_OFF_INT_STATUS2			7#define CS_OFF_RSVD					8#define CS_OFF_DIS_PWR_DN			12#define CS_OFF_INT_MASK2			13#define CS_OFF_DRIVER_STATE			14#define CS_OFF_RSVD2				15/*--- Control/Status Block - self_test_status values -*/#define SUCS_POST_INIT				0x00#define SUCS_POST_FIRMWARE			0x01#define SUCS_POST_HW				0x02#define SUCS_POST_INIT_MIB			0x03#define SUCS_POST_MIB_CHKSUM_FAIL	0xfa#define SUCS_POST_RADIO_FAIL		0xfb#define SUCS_POST_SUTRO_FAIL		0xfc#define SUCS_POST_PROM_CKSUM_FAIL	0xfd#define SUCS_POST_RAM_FAIL			0xfe#define SUCS_POST_SUCCESS			0xff/*--- Control/Status Block - state testing macros ----*/#define SUCS_ST_IS_RSVD1(x)			((x) & BIT7)#define SUCS_ST_IS_RSVD2(x)			((x) & BIT6)#define SUCS_ST_IS_AP_ACTIVE(x)		((x) & BIT5)#define SUCS_ST_IS_PSP_DISABLED(x)	((x) & BIT4)#define SUCS_ST_IS_DOZE(x)			((x) & BIT3)#define SUCS_ST_IS_PSPMODE(x)		((x) & BIT2)#define SUCS_ST_IS_RX_ENABLED(x)	((x) & BIT1)#define SUCS_ST_IS_TX_ENABLED(x)	((x) & BIT0)/*--- Control/Status Block - int_status testing macros --*/#define SUCS_INT_IS_WAKEUP(x)		((x) & BIT7)#define SUCS_INT_IS_CFPEND(x)		((x) & BIT6)#define SUCS_INT_IS_DTIMTX(x)		((x) & BIT5)#define SUCS_INT_IS_CFPSTART(x)		((x) & BIT4)#define SUCS_INT_IS_SCANCMPLT(x)	((x) & BIT3)#define SUCS_INT_IS_TX(x)			((x) & BIT2)#define SUCS_INT_IS_RX(x)			((x) & BIT1)#define SUCS_INT_IS_CMD(x)			((x) & BIT0)/*--- Control/Status Block - int_mask (and status) values --*/#define SUCS_INT_WAKEUP				(BIT7)#define SUCS_INT_CFPEND				(BIT6)#define SUCS_INT_DTIMTX				(BIT5)#define SUCS_INT_CFPSTART			(BIT4)#define SUCS_INT_SCANCMPLT			(BIT3)#define SUCS_INT_TX					(BIT2)#define SUCS_INT_RX					(BIT1)#define SUCS_INT_MASK_CMD			(BIT0)/*--- Control/Status Block - int_status2 testing macros --*/#define SUCS_INT2_IS_RX_MGMT_PSPOLL(x)	((x) & (BIT7))#define SUCS_INT2_IS_RX_DATA(x)		((x) & (BIT6))#define SUCS_INT2_IS_RSVD(x)		((x) & (BIT5))#define SUCS_INT2_IS_TX_MGMT(x)		((x) & (BIT4))#define SUCS_INT2_IS_TX_CFPOLL(x)	((x) & (BIT3))#define SUCS_INT2_IS_TX_PSPOLL(x)	((x) & (BIT2))#define SUCS_INT2_IS_TX_BCAST(x)	((x) & (BIT1))#define SUCS_INT2_IS_TX_DATA(x)		((x) & (BIT0)/*--- Control/Status Block - int_mask2 (and status) values --*/#define SUCS_INT2_RX_MGMT_PSPOLL	(BIT7)#define SUCS_INT2_RX_DATA			(BIT6)#define SUCS_INT2_RSVD				(BIT5)#define SUCS_INT2_TX_MGMT			(BIT4)#define SUCS_INT2_TX_CFPOLL			(BIT3)#define SUCS_INT2_TX_PSPOLL			(BIT2)#define SUCS_INT2_TX_BCAST			(BIT1)#define SUCS_INT2_TX_DATA			(BIT0)/*--- Control/Status Block - driver state values --*//*-- bits 0-3  --------*/#define SUCS_DS_RESET			(0x00)#define SUCS_DS_ESS_SYNC		(0x01)#define SUCS_DS_IBSS_SCAN		(0x02)#define SUCS_DS_IBSS_SYNC		(0x03)#define SUCS_DS_ESS_SCAN		(0x04)#define SUCS_DS_ESS_AUTH		(0x05)#define SUCS_DS_ESS_ASSOC		(0x06)#define SUCS_DS_ESS_HANDOFF		(0x07)#define SUCS_DS_AP_NO_ASSOC		(0x08)#define SUCS_DS_AP_ASSOC_NONE	(0x0c)#define SUCS_DS_AP_ASSOC_LIGHT	(0x0d)#define SUCS_DS_AP_ASSOC_MOD	(0x0e)#define SUCS_DS_AP_ASSOC_HVY	(0x0f)/*-- enable f/w control of the LEDS ---*/#define SUCS_DS_AUTO_RXLED_EN	(BIT4)#define SUCS_DS_AUTO_TXLED_EN	(BIT5)/*-- if f/w control of LEDs is off, then driver controls them with these bits*/#define SUCS_DS_RXLED_ON		(BIT6)#define SUCS_DS_TXLED_ON		(BIT7)/*=============================================================*//*--- Virtual Bitmap Block ------------------------------------*/__WLAN_PRAGMA_PACK1__typedef struct am930vbm_blk{	volatile UINT8		offset		__WLAN_ATTRIB_PACK__;	volatile UINT8		length		__WLAN_ATTRIB_PACK__;	volatile UINT8		bm[251]		__WLAN_ATTRIB_PACK__;} am930vbm_blk_t;__WLAN_PRAGMA_PACK1__#define VBM_OFF_OFFSET	0#define VBM_OFF_LENGTH	1#define VBM_OFF_BM		2/*=============================================================*//*--- Rx Descriptor Block  ------------------------------------*/__WLAN_PRAGMA_PACK1__typedef struct am930rx_desc{	volatile UINT32	rsvd1				__WLAN_ATTRIB_PACK__;	volatile UINT32	next				__WLAN_ATTRIB_PACK__;	volatile UINT8	rsvd2				__WLAN_ATTRIB_PACK__;	volatile UINT8	state				__WLAN_ATTRIB_PACK__;	volatile UINT8	rssi				__WLAN_ATTRIB_PACK__;	volatile UINT8	index_or_ch			__WLAN_ATTRIB_PACK__;	volatile UINT32	local_time			__WLAN_ATTRIB_PACK__;	volatile UINT32	rx_start_frame		__WLAN_ATTRIB_PACK__;	volatile UINT16	rx_len				__WLAN_ATTRIB_PACK__;	volatile UINT8	rate				__WLAN_ATTRIB_PACK__;	volatile UINT8	rsvd3				__WLAN_ATTRIB_PACK__;} am930rx_desc_t;__WLAN_PRAGMA_PACKDFLT__#define RXD_OFF_RSVD1				0#define RXD_OFF_NEXT				4#define RXD_OFF_RSVD2				8#define RXD_OFF_STATE				9#define RXD_OFF_RSSI				10#define RXD_OFF_INDEX_OR_CH			11#define RXD_OFF_LOCAL_TIME			12#define RXD_OFF_START_FRAME			16#define RXD_OFF_LEN					20#define RXD_OFF_RATE				22#define RXD_OFF_RSVD3				23/*--- RX Descriptor - state values and testing macros -*/#define SURXD_ST_FWOWN				(BIT7)#define SURXD_ST_CONSUMED			(BIT6)#define SURXD_ST_LAST_FRAG			(BIT5)#define SURXD_ST_RSVD1				(BIT4)#define SURXD_ST_CRCERR				(BIT3)#define SURXD_ST_RSVD2				(BIT2)#define SURXD_ST_BUF_OFLOW			(BIT1)#define SURXD_ST_RXERR				(BIT0)#define SURXD_ST_IS_FWOWN(x)		((x) & SURXD_ST_FWOWN)#define SURXD_ST_IS_HOSTOWN(x)		(~(x) & SURXD_ST_FWOWN)#define SURXD_ST_IS_CONSUMED(x)		((x) & SURXD_ST_CONSUMED)#define SURXD_ST_IS_LAST_FRAG(x)	((x) & SURXD_ST_LAST_FRAG)#define SURXD_ST_IS_CRC_ERR(x)		((x) & SURXD_ST_CRCERR)#define SURXD_ST_IS_BUF_OFLOW(x)	((x) & SURXD_ST_BUF_OFLOW)#define SURXD_ST_IS_RXERR(x)		((x) & SURXD_ST_RXERR)/*=============================================================*//*--- Tx Descriptor Block  ------------------------------------*/__WLAN_PRAGMA_PACK1__typedef struct am930tx_desc{	volatile UINT32	tx_start_frame		__WLAN_ATTRIB_PACK__;	volatile UINT32	next				__WLAN_ATTRIB_PACK__;	volatile UINT16	tx_len				__WLAN_ATTRIB_PACK__;	volatile UINT8	state				__WLAN_ATTRIB_PACK__;	volatile UINT8	rate				__WLAN_ATTRIB_PACK__;	volatile UINT8	difs_attempts		__WLAN_ATTRIB_PACK__;	volatile UINT8	difs_failures		__WLAN_ATTRIB_PACK__;	volatile UINT8	sifs_attempts		__WLAN_ATTRIB_PACK__;	volatile UINT8	sifs_failures		__WLAN_ATTRIB_PACK__;	volatile UINT32	rsvd1				__WLAN_ATTRIB_PACK__;	volatile UINT8	rts_attempts		__WLAN_ATTRIB_PACK__;	volatile UINT8	data_attempts		__WLAN_ATTRIB_PACK__;	volatile UINT8	tx_cntl				__WLAN_ATTRIB_PACK__;	volatile UINT8	rsvd2				__WLAN_ATTRIB_PACK__;	volatile UINT32	prev				__WLAN_ATTRIB_PACK__;	volatile UINT32	host				__WLAN_ATTRIB_PACK__;} am930tx_desc_t;__WLAN_PRAGMA_PACKDFLT__#define TXD_OFF_START_FRAME		0#define TXD_OFF_NEXT			4#define TXD_OFF_LEN				8#define TXD_OFF_STATE			10#define TXD_OFF_RATE			11#define TXD_OFF_DIFS_ATTEMPTS	12#define TXD_OFF_DIFS_FAILURES	13#define TXD_OFF_SIFS_ATTEMPTS	14#define TXD_OFF_SIFS_FAILURES	15#define TXD_OFF_RSVD1			16#define TXD_OFF_RTS_ATTEMPTS	20#define TXD_OFF_DATA_ATTEMPTS	21#define TXD_OFF_TX_CNTL			22#define TXD_OFF_RSVD2			23#define TXD_OFF_PREV			24#define TXD_OFF_HOST			28

⌨️ 快捷键说明

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