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

📄 ah.h

📁 madwifi上的atheros无线网卡驱动源码
💻 H
📖 第 1 页 / 共 3 页
字号:
/*- * Copyright (c) 2002-2006 Sam Leffler, Errno Consulting, Atheros * Communications, Inc.  All rights reserved. * * Redistribution and use in source and binary forms are permitted * provided that the following conditions are met: * 1. The materials contained herein are unmodified and are used *    unmodified. * 2. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following NO *    ''WARRANTY'' disclaimer below (''Disclaimer''), without *    modification. * 3. Redistributions in binary form must reproduce at minimum a *    disclaimer similar to the Disclaimer below and any redistribution *    must be conditioned upon including a substantially similar *    Disclaimer requirement for further binary redistribution. * 4. Neither the names of the above-listed copyright holders nor the *    names of any contributors may be used to endorse or promote *    product derived from this software without specific prior written *    permission. * * NO WARRANTY * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE * FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGES. * * $Id: ah.h 2060 2007-02-01 20:25:46Z proski $ */#ifndef _ATH_AH_H_#define _ATH_AH_H_/* * Atheros Hardware Access Layer * * Clients of the HAL call ath_hal_attach to obtain a reference to an ath_hal * structure for use with the device.  Hardware-related operations that * follow must call back into the HAL through interface, supplying the * reference as the first parameter. *//* * Bus i/o type definitions.  We define a platform-independent * set of types that are mapped to platform-dependent data for * register read/write operations.  We use types that are large * enough to hold a pointer; smaller data should fit and only * require type coercion to work.  Larger data can be stored * elsewhere and a reference passed for the bus tag and/or handle. */typedef void* HAL_SOFTC;		/* pointer to driver/OS state */typedef void* HAL_BUS_TAG;		/* opaque bus i/o id tag */typedef void* HAL_BUS_HANDLE;		/* opaque bus i/o handle */#include "ah_osdep.h"/* * __ahdecl is analogous to _cdecl; it defines the calling * convention used within the HAL.  For most systems this * can just default to be empty and the compiler will (should) * use _cdecl.  For systems where _cdecl is not compatible this * must be defined.  See linux/ah_osdep.h for an example. */#ifndef __ahdecl#define __ahdecl#endif/* * Status codes that may be returned by the HAL.  Note that * interfaces that return a status code set it only when an * error occurs--i.e. you cannot check it for success. */typedef enum {	HAL_OK		= 0,	/* No error */	HAL_ENXIO	= 1,	/* No hardware present */	HAL_ENOMEM	= 2,	/* Memory allocation failed */	HAL_EIO		= 3,	/* Hardware didn't respond as expected */	HAL_EEMAGIC	= 4,	/* EEPROM magic number invalid */	HAL_EEVERSION	= 5,	/* EEPROM version invalid */	HAL_EELOCKED	= 6,	/* EEPROM unreadable */	HAL_EEBADSUM	= 7,	/* EEPROM checksum invalid */	HAL_EEREAD	= 8,	/* EEPROM read problem */	HAL_EEBADMAC	= 9,	/* EEPROM mac address invalid */	HAL_EESIZE	= 10,	/* EEPROM size not supported */	HAL_EEWRITE	= 11,	/* Attempt to change write-locked EEPROM */	HAL_EINVAL	= 12,	/* Invalid parameter to function */	HAL_ENOTSUPP	= 13,	/* Hardware revision not supported */	HAL_ESELFTEST	= 14,	/* Hardware self-test failed */	HAL_EINPROGRESS	= 15,	/* Operation incomplete */} HAL_STATUS;typedef enum {	AH_FALSE = 0,		/* NB: lots of code assumes false is zero */	AH_TRUE  = 1,} HAL_BOOL;typedef enum {	HAL_CAP_REG_DMN		= 0,	/* current regulatory domain */	HAL_CAP_CIPHER		= 1,	/* hardware supports cipher */	HAL_CAP_TKIP_MIC	= 2,	/* handle TKIP MIC in hardware */	HAL_CAP_TKIP_SPLIT	= 3,	/* hardware TKIP uses split keys */	HAL_CAP_PHYCOUNTERS	= 4,	/* hardware PHY error counters */	HAL_CAP_DIVERSITY	= 5,	/* hardware supports fast diversity */	HAL_CAP_KEYCACHE_SIZE	= 6,	/* number of entries in key cache */	HAL_CAP_NUM_TXQUEUES	= 7,	/* number of hardware xmit queues */	HAL_CAP_VEOL		= 9,	/* hardware supports virtual EOL */	HAL_CAP_PSPOLL		= 10,	/* hardware has working PS-Poll support */	HAL_CAP_DIAG		= 11,	/* hardware diagnostic support */	HAL_CAP_COMPRESSION	= 12,	/* hardware supports compression */	HAL_CAP_BURST		= 13,	/* hardware supports packet bursting */	HAL_CAP_FASTFRAME	= 14,	/* hardware supoprts fast frames */	HAL_CAP_TXPOW		= 15,	/* global tx power limit  */	HAL_CAP_TPC		= 16,	/* per-packet tx power control  */	HAL_CAP_PHYDIAG		= 17,	/* hardware phy error diagnostic */	HAL_CAP_BSSIDMASK	= 18,	/* hardware supports bssid mask */	HAL_CAP_MCAST_KEYSRCH	= 19,	/* hardware has multicast key search */	HAL_CAP_TSF_ADJUST	= 20,	/* hardware has beacon tsf adjust */	HAL_CAP_XR		= 21,	/* hardware has XR support  */	HAL_CAP_WME_TKIPMIC 	= 22,   /* hardware can support TKIP MIC when WMM is turned on */	HAL_CAP_CHAN_HALFRATE 	= 23,	/* hardware can support half rate channels */	HAL_CAP_CHAN_QUARTERRATE = 24,	/* hardware can support quarter rate channels */	HAL_CAP_RFSILENT	= 25,	/* hardware has rfsilent support  */	HAL_CAP_TPC_ACK		= 26,	/* ack txpower with per-packet tpc */	HAL_CAP_TPC_CTS		= 27,	/* cts txpower with per-packet tpc */	HAL_CAP_11D		= 28,   /* 11d beacon support for changing cc */	HAL_CAP_INTMIT		= 29,	/* interference mitigation */	HAL_CAP_RXORN_FATAL	= 30,	/* HAL_INT_RXORN treated as fatal */} HAL_CAPABILITY_TYPE;/*  * "States" for setting the LED.  These correspond to * the possible 802.11 operational states and there may * be a many-to-one mapping between these states and the * actual hardware state for the LED's (i.e. the hardware * may have fewer states). */typedef enum {	HAL_LED_INIT	= 0,	HAL_LED_SCAN	= 1,	HAL_LED_AUTH	= 2,	HAL_LED_ASSOC	= 3,	HAL_LED_RUN	= 4} HAL_LED_STATE;/* * Transmit queue types/numbers.  These are used to tag * each transmit queue in the hardware and to identify a set * of transmit queues for operations such as start/stop dma. */typedef enum {	HAL_TX_QUEUE_INACTIVE	= 0,		/* queue is inactive/unused */	HAL_TX_QUEUE_DATA	= 1,		/* data xmit q's */	HAL_TX_QUEUE_BEACON	= 2,		/* beacon xmit q */	HAL_TX_QUEUE_CAB	= 3,		/* "crap after beacon" xmit q */	HAL_TX_QUEUE_UAPSD	= 4,		/* u-apsd power save xmit q */} HAL_TX_QUEUE;#define	HAL_NUM_TX_QUEUES	10		/* max possible # of queues *//* * Transmit queue subtype.  These map directly to * WME Access Categories (except for UPSD).  Refer * to Table 5 of the WME spec. */typedef enum {	HAL_WME_AC_BK	= 0,			/* background access category */	HAL_WME_AC_BE	= 1, 			/* best effort access category*/	HAL_WME_AC_VI	= 2,			/* video access category */	HAL_WME_AC_VO	= 3,			/* voice access category */	HAL_WME_UPSD	= 4,			/* uplink power save */	HAL_XR_DATA	= 5,			/* uplink power save */} HAL_TX_QUEUE_SUBTYPE;/* * Transmit queue flags that control various * operational parameters. */typedef enum {	/*	 * Per queue interrupt enables.  When set the associated	 * interrupt may be delivered for packets sent through	 * the queue.  Without these enabled no interrupts will	 * be delivered for transmits through the queue.	 */	HAL_TXQ_TXOKINT_ENABLE	   = 0x0001,	/* enable TXOK interrupt */	HAL_TXQ_TXERRINT_ENABLE	   = 0x0001,	/* enable TXERR interrupt */	HAL_TXQ_TXDESCINT_ENABLE   = 0x0002,	/* enable TXDESC interrupt */	HAL_TXQ_TXEOLINT_ENABLE	   = 0x0004,	/* enable TXEOL interrupt */	HAL_TXQ_TXURNINT_ENABLE	   = 0x0008,	/* enable TXURN interrupt */	/*	 * Enable hardware compression for packets sent through	 * the queue.  The compression buffer must be setup and	 * packets must have a key entry marked in the tx descriptor.	 */	HAL_TXQ_COMPRESSION_ENABLE  = 0x0010,	/* enable h/w compression */	/*	 * Disable queue when veol is hit or ready time expires.	 * By default the queue is disabled only on reaching the	 * physical end of queue (i.e. a null link ptr in the	 * descriptor chain).	 */	HAL_TXQ_RDYTIME_EXP_POLICY_ENABLE = 0x0020,	/*	 * Schedule frames on delivery of a DBA (DMA Beacon Alert)	 * event.  Frames will be transmitted only when this timer	 * fires, e.g to transmit a beacon in ap or adhoc modes.	 */	HAL_TXQ_DBA_GATED	    = 0x0040,	/* schedule based on DBA */	/*	 * Each transmit queue has a counter that is incremented	 * each time the queue is enabled and decremented when	 * the list of frames to transmit is traversed (or when	 * the ready time for the queue expires).  This counter	 * must be non-zero for frames to be scheduled for	 * transmission.  The following controls disable bumping	 * this counter under certain conditions.  Typically this	 * is used to gate frames based on the contents of another	 * queue (e.g. CAB traffic may only follow a beacon frame).	 * These are meaningful only when frames are scheduled	 * with a non-ASAP policy (e.g. DBA-gated).	 */	HAL_TXQ_CBR_DIS_QEMPTY	    = 0x0080,	/* disable on this q empty */	HAL_TXQ_CBR_DIS_BEMPTY	    = 0x0100,	/* disable on beacon q empty */	/*	 * Fragment burst backoff policy.  Normally the no backoff	 * is done after a successful transmission, the next fragment	 * is sent at SIFS.  If this flag is set backoff is done	 * after each fragment, regardless whether it was ack'd or	 * not, after the backoff count reaches zero a normal channel	 * access procedure is done before the next transmit (i.e.	 * wait AIFS instead of SIFS).	 */	HAL_TXQ_FRAG_BURST_BACKOFF_ENABLE = 0x00800000,	/*	 * Disable post-tx backoff following each frame.	 */	HAL_TXQ_BACKOFF_DISABLE	    = 0x00010000, /* disable post backoff  */	/*	 * DCU arbiter lockout control.  This controls how	 * lower priority tx queues are handled with respect to	 * to a specific queue when multiple queues have frames	 * to send.  No lockout means lower priority queues arbitrate	 * concurrently with this queue.  Intra-frame lockout	 * means lower priority queues are locked out until the	 * current frame transmits (e.g. including backoffs and bursting).	 * Global lockout means nothing lower can arbitrary so	 * long as there is traffic activity on this queue (frames,	 * backoff, etc).	 */	HAL_TXQ_ARB_LOCKOUT_INTRA   = 0x00020000, /* intra-frame lockout */	HAL_TXQ_ARB_LOCKOUT_GLOBAL  = 0x00040000, /* full lockout s */	HAL_TXQ_IGNORE_VIRTCOL	    = 0x00080000, /* ignore virt collisions */	HAL_TXQ_SEQNUM_INC_DIS	    = 0x00100000, /* disable seqnum increment */} HAL_TX_QUEUE_FLAGS;typedef struct {	u_int32_t	tqi_ver;		/* hal TXQ version */	HAL_TX_QUEUE_SUBTYPE tqi_subtype;	/* subtype if applicable */	HAL_TX_QUEUE_FLAGS tqi_qflags;		/* flags (see above) */	u_int32_t	tqi_priority;		/* (not used) */	u_int32_t	tqi_aifs;		/* aifs */	u_int32_t	tqi_cwmin;		/* cwMin */	u_int32_t	tqi_cwmax;		/* cwMax */	u_int16_t	tqi_shretry;		/* rts retry limit */	u_int16_t	tqi_lgretry;		/* long retry limit (not used)*/	u_int32_t	tqi_cbrPeriod;		/* CBR period (us) */	u_int32_t	tqi_cbrOverflowLimit;	/* threshold for CBROVF int */	u_int32_t	tqi_burstTime;		/* max burst duration (us) */	u_int32_t	tqi_readyTime;		/* frame schedule time (us) */	u_int32_t	tqi_compBuf;		/* comp buffer phys addr */} HAL_TXQ_INFO;#define HAL_TQI_NONVAL 0xffff/* token to use for aifs, cwmin, cwmax */#define	HAL_TXQ_USEDEFAULT	((u_int32_t) -1)/* compression definitions */#define HAL_COMP_BUF_MAX_SIZE           9216            /* 9K */#define HAL_COMP_BUF_ALIGN_SIZE         512/* * Transmit packet types.  This belongs in ah_desc.h, but * is here so we can give a proper type to various parameters * (and not require everyone include the file).

⌨️ 快捷键说明

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