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

📄 hfa384x.h

📁 uClinux2.6上兼容PRISM2.0芯片组的USB设备驱动程序.
💻 H
📖 第 1 页 / 共 5 页
字号:
/* src/prism2/include/prism2/hfa384x.h** Defines the constants and data structures for the hfa384x** Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.* --------------------------------------------------------------------** linux-wlan**   The contents of this file are subject to the Mozilla Public*   License Version 1.1 (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.**   Alternatively, the contents of this file may be used under the*   terms of the GNU Public License version 2 (the "GPL"), in which*   case the provisions of the GPL are applicable instead of the*   above.  If you wish to allow the use of your version of this file*   only under the terms of the GPL and not to allow others to use*   your version of this file under the MPL, indicate your decision*   by deleting the provisions above and replace them with the notice*   and other provisions required by the GPL.  If you do not delete*   the provisions above, a recipient may use your version of this*   file under either the MPL or the GPL.** --------------------------------------------------------------------** Inquiries regarding the linux-wlan Open Source project can be* made directly to:** AbsoluteValue Systems Inc.* info@linux-wlan.com* http://www.linux-wlan.com** --------------------------------------------------------------------** Portions of the development of this software were funded by * Intersil Corporation as part of PRISM(R) chipset product development.** --------------------------------------------------------------------**   [Implementation and usage notes]**   [References]*	CW10 Programmer's Manual v1.5*	IEEE 802.11 D10.0** --------------------------------------------------------------------*/#ifndef _HFA384x_H#define _HFA384x_H/*=============================================================*/#define HFA384x_FIRMWARE_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))#define HFA384x_LEVEL_TO_dBm(v)   (0x100 + (v) * 100 / 255 - 100)/*------ Constants --------------------------------------------*//*--- Mins & Maxs -----------------------------------*/#define		HFA384x_CMD_ALLOC_LEN_MIN	((UINT16)4)#define		HFA384x_CMD_ALLOC_LEN_MAX	((UINT16)2400)#define		HFA384x_BAP_DATALEN_MAX		((UINT16)4096)#define		HFA384x_BAP_OFFSET_MAX		((UINT16)4096)#define		HFA384x_PORTID_MAX		((UINT16)7)#define		HFA384x_NUMPORTS_MAX		((UINT16)(HFA384x_PORTID_MAX+1))#define		HFA384x_PDR_LEN_MAX		((UINT16)512)	/* in bytes, from EK */#define		HFA384x_PDA_RECS_MAX		((UINT16)200)	/* a guess */#define		HFA384x_PDA_LEN_MAX		((UINT16)1024)	/* in bytes, from EK */#define		HFA384x_SCANRESULT_MAX		((UINT16)31)#define		HFA384x_HSCANRESULT_MAX		((UINT16)31)#define		HFA384x_CHINFORESULT_MAX	((UINT16)16)#define		HFA384x_DRVR_FIDSTACKLEN_MAX	(10)#define		HFA384x_DRVR_TXBUF_MAX		(sizeof(hfa384x_tx_frame_t) + \						WLAN_DATA_MAXLEN - \						WLAN_WEP_IV_LEN - \						WLAN_WEP_ICV_LEN + 2)#define		HFA384x_DRVR_MAGIC		(0x4a2d)#define		HFA384x_INFODATA_MAXLEN		(sizeof(hfa384x_infodata_t))#define		HFA384x_INFOFRM_MAXLEN		(sizeof(hfa384x_InfFrame_t))#define		HFA384x_RID_GUESSING_MAXLEN	2048  /* I'm not really sure */#define		HFA384x_RIDDATA_MAXLEN		HFA384x_RID_GUESSING_MAXLEN	#define		HFA384x_USB_RWMEM_MAXLEN	2048/*--- Support Constants -----------------------------*/#define		HFA384x_BAP_PROC			((UINT16)0)#define		HFA384x_BAP_INT				((UINT16)1)#define		HFA384x_PORTTYPE_IBSS			((UINT16)0)#define		HFA384x_PORTTYPE_BSS			((UINT16)1)#define		HFA384x_PORTTYPE_WDS			((UINT16)2)#define		HFA384x_PORTTYPE_PSUEDOIBSS		((UINT16)3)#define		HFA384x_PORTTYPE_HOSTAP    		((UINT16)6)#define		HFA384x_WEPFLAGS_PRIVINVOKED		((UINT16)BIT0)#define		HFA384x_WEPFLAGS_EXCLUDE		((UINT16)BIT1)#define		HFA384x_WEPFLAGS_DISABLE_TXCRYPT	((UINT16)BIT4)#define		HFA384x_WEPFLAGS_DISABLE_RXCRYPT	((UINT16)BIT7)#define		HFA384x_WEPFLAGS_DISALLOW_MIXED 	((UINT16)BIT11)#define		HFA384x_WEPFLAGS_IV_INTERVAL1		((UINT16)0)#define		HFA384x_WEPFLAGS_IV_INTERVAL10		((UINT16)BIT5)#define		HFA384x_WEPFLAGS_IV_INTERVAL50		((UINT16)BIT6)#define		HFA384x_WEPFLAGS_IV_INTERVAL100		((UINT16)(BIT5 | BIT6))#define		HFA384x_WEPFLAGS_FIRMWARE_WPA  		((UINT16)BIT8)#define		HFA384x_WEPFLAGS_HOST_MIC      		((UINT16)BIT9)#define 	HFA384x_ROAMMODE_FWSCAN_FWROAM		((UINT16)1)#define 	HFA384x_ROAMMODE_FWSCAN_HOSTROAM	((UINT16)2)#define 	HFA384x_ROAMMODE_HOSTSCAN_HOSTROAM	((UINT16)3)#define 	HFA384x_PORTSTATUS_DISABLED		((UINT16)1)#define 	HFA384x_PORTSTATUS_INITSRCH		((UINT16)2)#define 	HFA384x_PORTSTATUS_CONN_IBSS		((UINT16)3)#define 	HFA384x_PORTSTATUS_CONN_ESS		((UINT16)4)#define 	HFA384x_PORTSTATUS_OOR_ESS		((UINT16)5)#define 	HFA384x_PORTSTATUS_CONN_WDS		((UINT16)6)#define 	HFA384x_PORTSTATUS_HOSTAP		((UINT16)8)#define		HFA384x_RATEBIT_1			((UINT16)1)#define		HFA384x_RATEBIT_2			((UINT16)2)#define		HFA384x_RATEBIT_5dot5			((UINT16)4)#define		HFA384x_RATEBIT_11			((UINT16)8)/*--- Just some symbolic names for legibility -------*/#define		HFA384x_TXCMD_NORECL		((UINT16)0)#define		HFA384x_TXCMD_RECL		((UINT16)1)/*--- MAC Internal memory constants and macros ------*//* masks and macros used to manipulate MAC internal memory addresses. *//* MAC internal memory addresses are 23 bit quantities.  The MAC uses  * a paged address space where the upper 16 bits are the page number  * and the lower 7 bits are the offset.  There are various Host API  * elements that require two 16-bit quantities to specify a MAC  * internal memory address.  Unfortunately, some of the API's use a  * page/offset format where the offset value is JUST the lower seven  * bits and the page is  the remaining 16 bits.  Some of the API's  * assume that the 23 bit address has been split at the 16th bit.  We  * refer to these two formats as AUX format and CMD format.  The  * macros below help handle some of this. */ /* Handy constant */#define		HFA384x_ADDR_AUX_OFF_MAX	((UINT16)0x007f)/* Mask bits for discarding unwanted pieces in a flat address */#define		HFA384x_ADDR_FLAT_AUX_PAGE_MASK	(0x007fff80)#define		HFA384x_ADDR_FLAT_AUX_OFF_MASK	(0x0000007f)#define		HFA384x_ADDR_FLAT_CMD_PAGE_MASK	(0xffff0000)#define		HFA384x_ADDR_FLAT_CMD_OFF_MASK	(0x0000ffff)/* Mask bits for discarding unwanted pieces in AUX format 16-bit address parts */#define		HFA384x_ADDR_AUX_PAGE_MASK	(0xffff)#define		HFA384x_ADDR_AUX_OFF_MASK	(0x007f)/* Mask bits for discarding unwanted pieces in CMD format 16-bit address parts */#define		HFA384x_ADDR_CMD_PAGE_MASK	(0x007f)#define		HFA384x_ADDR_CMD_OFF_MASK	(0xffff)/* Make a 32-bit flat address from AUX format 16-bit page and offset */#define		HFA384x_ADDR_AUX_MKFLAT(p,o)	\		(((UINT32)(((UINT16)(p))&HFA384x_ADDR_AUX_PAGE_MASK)) <<7) | \		((UINT32)(((UINT16)(o))&HFA384x_ADDR_AUX_OFF_MASK))/* Make a 32-bit flat address from CMD format 16-bit page and offset */#define		HFA384x_ADDR_CMD_MKFLAT(p,o)	\		(((UINT32)(((UINT16)(p))&HFA384x_ADDR_CMD_PAGE_MASK)) <<16) | \		((UINT32)(((UINT16)(o))&HFA384x_ADDR_CMD_OFF_MASK))/* Make AUX format offset and page from a 32-bit flat address */#define		HFA384x_ADDR_AUX_MKPAGE(f) \		((UINT16)((((UINT32)(f))&HFA384x_ADDR_FLAT_AUX_PAGE_MASK)>>7))#define		HFA384x_ADDR_AUX_MKOFF(f) \		((UINT16)(((UINT32)(f))&HFA384x_ADDR_FLAT_AUX_OFF_MASK))/* Make CMD format offset and page from a 32-bit flat address */#define		HFA384x_ADDR_CMD_MKPAGE(f) \		((UINT16)((((UINT32)(f))&HFA384x_ADDR_FLAT_CMD_PAGE_MASK)>>16))#define		HFA384x_ADDR_CMD_MKOFF(f) \		((UINT16)(((UINT32)(f))&HFA384x_ADDR_FLAT_CMD_OFF_MASK))/*--- Aux register masks/tests ----------------------*//* Some of the upper bits of the AUX offset register are used to *//*  select address space. */#define		HFA384x_AUX_CTL_EXTDS	(0x00)#define		HFA384x_AUX_CTL_NV	(0x01)#define		HFA384x_AUX_CTL_PHY	(0x02)#define		HFA384x_AUX_CTL_ICSRAM	(0x03)/* Make AUX register offset and page values from a flat address */#define		HFA384x_AUX_MKOFF(f, c) \	(HFA384x_ADDR_AUX_MKOFF(f) | (((UINT16)(c))<<12))#define		HFA384x_AUX_MKPAGE(f)	HFA384x_ADDR_AUX_MKPAGE(f)/*--- Controller Memory addresses -------------------*/#define		HFA3842_PDA_BASE	(0x007f0000UL)#define		HFA3841_PDA_BASE	(0x003f0000UL)#define		HFA3841_PDA_BOGUS_BASE	(0x00390000UL)/*--- Driver Download states  -----------------------*/#define		HFA384x_DLSTATE_DISABLED		0#define		HFA384x_DLSTATE_RAMENABLED		1#define		HFA384x_DLSTATE_FLASHENABLED		2#define		HFA384x_DLSTATE_FLASHWRITTEN		3#define		HFA384x_DLSTATE_FLASHWRITEPENDING	4#define		HFA384x_DLSTATE_GENESIS 		5/*--- Register I/O offsets --------------------------*/#if ((WLAN_HOSTIF == WLAN_PCMCIA) || (WLAN_HOSTIF == WLAN_PLX))#define		HFA384x_CMD_OFF			(0x00)#define		HFA384x_PARAM0_OFF		(0x02)#define		HFA384x_PARAM1_OFF		(0x04)#define		HFA384x_PARAM2_OFF		(0x06)#define		HFA384x_STATUS_OFF		(0x08)#define		HFA384x_RESP0_OFF		(0x0A)#define		HFA384x_RESP1_OFF		(0x0C)#define		HFA384x_RESP2_OFF		(0x0E)#define		HFA384x_INFOFID_OFF		(0x10)#define		HFA384x_RXFID_OFF		(0x20)#define		HFA384x_ALLOCFID_OFF		(0x22)#define		HFA384x_TXCOMPLFID_OFF		(0x24)#define		HFA384x_SELECT0_OFF		(0x18)#define		HFA384x_OFFSET0_OFF		(0x1C)#define		HFA384x_DATA0_OFF		(0x36)#define		HFA384x_SELECT1_OFF		(0x1A)#define		HFA384x_OFFSET1_OFF		(0x1E)#define		HFA384x_DATA1_OFF		(0x38)#define		HFA384x_EVSTAT_OFF		(0x30)#define		HFA384x_INTEN_OFF		(0x32)#define		HFA384x_EVACK_OFF		(0x34)#define		HFA384x_CONTROL_OFF		(0x14)#define		HFA384x_SWSUPPORT0_OFF		(0x28)#define		HFA384x_SWSUPPORT1_OFF		(0x2A)#define		HFA384x_SWSUPPORT2_OFF		(0x2C)#define		HFA384x_AUXPAGE_OFF		(0x3A)#define		HFA384x_AUXOFFSET_OFF		(0x3C)#define		HFA384x_AUXDATA_OFF		(0x3E)#elif (WLAN_HOSTIF == WLAN_PCI || WLAN_HOSTIF == WLAN_USB)#define		HFA384x_CMD_OFF			(0x00)#define		HFA384x_PARAM0_OFF		(0x04)#define		HFA384x_PARAM1_OFF		(0x08)#define		HFA384x_PARAM2_OFF		(0x0c)#define		HFA384x_STATUS_OFF		(0x10)#define		HFA384x_RESP0_OFF		(0x14)#define		HFA384x_RESP1_OFF		(0x18)#define		HFA384x_RESP2_OFF		(0x1c)#define		HFA384x_INFOFID_OFF		(0x20)#define		HFA384x_RXFID_OFF		(0x40)#define		HFA384x_ALLOCFID_OFF		(0x44)#define		HFA384x_TXCOMPLFID_OFF		(0x48)#define		HFA384x_SELECT0_OFF		(0x30)#define		HFA384x_OFFSET0_OFF		(0x38)#define		HFA384x_DATA0_OFF		(0x6c)#define		HFA384x_SELECT1_OFF		(0x34)#define		HFA384x_OFFSET1_OFF		(0x3c)#define		HFA384x_DATA1_OFF		(0x70)#define		HFA384x_EVSTAT_OFF		(0x60)#define		HFA384x_INTEN_OFF		(0x64)#define		HFA384x_EVACK_OFF		(0x68)#define		HFA384x_CONTROL_OFF		(0x28)#define		HFA384x_SWSUPPORT0_OFF		(0x50)#define		HFA384x_SWSUPPORT1_OFF		(0x54)#define		HFA384x_SWSUPPORT2_OFF		(0x58)#define		HFA384x_AUXPAGE_OFF		(0x74)#define		HFA384x_AUXOFFSET_OFF		(0x78)#define		HFA384x_AUXDATA_OFF		(0x7c)#define		HFA384x_PCICOR_OFF		(0x4c)#define		HFA384x_PCIHCR_OFF		(0x5c)#define		HFA384x_PCI_M0_ADDRH_OFF	(0x80)#define		HFA384x_PCI_M0_ADDRL_OFF	(0x84)#define		HFA384x_PCI_M0_LEN_OFF		(0x88)#define		HFA384x_PCI_M0_CTL_OFF		(0x8c)#define		HFA384x_PCI_STATUS_OFF		(0x98)#define		HFA384x_PCI_M1_ADDRH_OFF	(0xa0)#define		HFA384x_PCI_M1_ADDRL_OFF	(0xa4)#define		HFA384x_PCI_M1_LEN_OFF		(0xa8)#define		HFA384x_PCI_M1_CTL_OFF		(0xac)#endif/*--- Register Field Masks --------------------------*/#define		HFA384x_CMD_BUSY		((UINT16)BIT15)#define		HFA384x_CMD_AINFO		((UINT16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8))#define		HFA384x_CMD_MACPORT		((UINT16)(BIT10 | BIT9 | BIT8))#define		HFA384x_CMD_RECL		((UINT16)BIT8)#define		HFA384x_CMD_WRITE		((UINT16)BIT8)#define		HFA384x_CMD_PROGMODE		((UINT16)(BIT9 | BIT8))#define		HFA384x_CMD_CMDCODE		((UINT16)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0))#define		HFA384x_STATUS_RESULT		((UINT16)(BIT14 | BIT13 | BIT12 | BIT11 | BIT10 | BIT9 | BIT8))#define		HFA384x_STATUS_CMDCODE		((UINT16)(BIT5 | BIT4 | BIT3 | BIT2 | BIT1 | BIT0))#define		HFA384x_OFFSET_BUSY		((UINT16)BIT15)#define		HFA384x_OFFSET_ERR		((UINT16)BIT14)#define		HFA384x_OFFSET_DATAOFF		((UINT16)(BIT11 | BIT10 | BIT9 | BIT8 | BIT7 | BIT6 | BIT5 | BIT4 | BIT3 | BIT2 | BIT1))#define		HFA384x_EVSTAT_TICK		((UINT16)BIT15)#define		HFA384x_EVSTAT_WTERR		((UINT16)BIT14)#define		HFA384x_EVSTAT_INFDROP		((UINT16)BIT13)#define		HFA384x_EVSTAT_INFO		((UINT16)BIT7)#define		HFA384x_EVSTAT_DTIM		((UINT16)BIT5)#define		HFA384x_EVSTAT_CMD		((UINT16)BIT4)#define		HFA384x_EVSTAT_ALLOC		((UINT16)BIT3)

⌨️ 快捷键说明

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