Main Page | Data Structures | Directories | File List | Data Fields | Globals

if_athvar.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2004 Massachusetts Institute of Technology
00003  * John Bicket
00004  */
00005 /*
00006  * Originally derived from the following.
00007  */
00008 /*-
00009  * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting
00010  * All rights reserved.
00011  *
00012  * Redistribution and use in source and binary forms, with or without
00013  * modification, are permitted provided that the following conditions
00014  * are met:
00015  * 1. Redistributions of source code must retain the above copyright
00016  *    notice, this list of conditions and the following disclaimer,
00017  *    without modification.
00018  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
00019  *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
00020  *    redistribution must be conditioned upon including a substantially
00021  *    similar Disclaimer requirement for further binary redistribution.
00022  * 3. Neither the names of the above-listed copyright holders nor the names
00023  *    of any contributors may be used to endorse or promote products derived
00024  *    from this software without specific prior written permission.
00025  *
00026  * Alternatively, this software may be distributed under the terms of the
00027  * GNU General Public License ("GPL") version 2 as published by the Free
00028  * Software Foundation.
00029  *
00030  * NO WARRANTY
00031  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00032  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00033  * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
00034  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
00035  * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
00036  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00037  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00038  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
00039  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00040  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
00041  * THE POSSIBILITY OF SUCH DAMAGES.
00042  *
00043  * $Id: if_athvar.h,v 1.18 2005/02/22 19:08:44 jbicket Exp $
00044  */
00045 
00046 /*
00047  * Defintions for the Atheros Wireless LAN controller driver.
00048  */
00049 #ifndef _DEV_ATH_ATHVAR_H
00050 #define _DEV_ATH_ATHVAR_H
00051 
00052 #include "if_ieee80211.h"
00053 #include "ah.h"
00054 #include "if_ath_ioctl.h"
00055 
00056 
00057 /*
00058  * Deduce if tasklets are available.  If not then
00059  * fall back to using the immediate work queue.
00060  */
00061 #include <linux/interrupt.h>
00062 #ifdef DECLARE_TASKLET                  /* native tasklets */
00063 #define tq_struct tasklet_struct
00064 #define ATH_INIT_TQUEUE(a,b,c)          tasklet_init((a),(b),(unsigned long)(c))
00065 #define ATH_SCHEDULE_TQUEUE(a,b)        tasklet_schedule((a))
00066 typedef unsigned long TQUEUE_ARG;
00067 #define mark_bh(a)
00068 #else                                   /* immediate work queue */
00069 #define ATH_INIT_TQUEUE(a,b,c)          INIT_TQUEUE(a,b,c)
00070 #define ATH_SCHEDULE_TQUEUE(a,b) do {           \
00071         *(b) |= queue_task((a), &tq_immediate); \
00072 } while(0)
00073 typedef void *TQUEUE_ARG;
00074 #define tasklet_disable(t)      do { (void) t; local_bh_disable(); } while (0)
00075 #define tasklet_enable(t)       do { (void) t; local_bh_enable(); } while (0)
00076 #endif /* !DECLARE_TASKLET */
00077 
00078 /*
00079  * Guess how the interrupt handler should work.
00080  */
00081 #if !defined(IRQ_NONE)
00082 typedef void irqreturn_t;
00083 #define IRQ_NONE
00084 #define IRQ_HANDLED
00085 #endif /* !defined(IRQ_NONE) */
00086 
00087 #ifndef SET_MODULE_OWNER
00088 #define SET_MODULE_OWNER(dev) do {              \
00089         dev->owner = THIS_MODULE;               \
00090 } while (0)
00091 #endif
00092 
00093 #ifndef SET_NETDEV_DEV
00094 #define SET_NETDEV_DEV(ndev, pdev)
00095 #endif
00096 
00097 /*
00098  * Deal with the sysctl handler api changing.
00099  */
00100 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
00101 #define ATH_SYSCTL_DECL(f, ctl, write, filp, buffer, lenp, ppos) \
00102         f(ctl_table *ctl, int write, struct file *filp, void *buffer, \
00103                 size_t *lenp)
00104 #define ATH_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, lenp, ppos) \
00105         proc_dointvec(ctl, write, filp, buffer, lenp)
00106 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) */
00107 #define ATH_SYSCTL_DECL(f, ctl, write, filp, buffer, lenp, ppos) \
00108         f(ctl_table *ctl, int write, struct file *filp, void *buffer,\
00109                 size_t *lenp, loff_t *ppos)
00110 #define ATH_SYSCTL_PROC_DOINTVEC(ctl, write, filp, buffer, lenp, ppos) \
00111         proc_dointvec(ctl, write, filp, buffer, lenp, ppos)
00112 #endif
00113 
00114 #define ATH_TIMEOUT             1000
00115 
00116 /*
00117  * Maximum acceptable MTU
00118  * MAXFRAMEBODY - WEP - QOS - RSN/WPA:
00119  * 2312 - 8 - 2 - 12 = 2290
00120  */
00121 //#define ATH_MAX_MTU     2290
00122 #define ATH_MAX_MTU     5000
00123 #define ATH_MIN_MTU     32  
00124 
00125 #define ATH_TPC_MAX     63              /* 6 bits */
00126 
00127 #define ATH_RXBUF       40              /* number of RX buffers */
00128 #define ATH_TXBUF       1               /* number of TX buffers */
00129 #define ATH_TXDESC      1               /* number of descriptors per buffer */
00130 #define ATH_TXMAXTRY    16              /* max number of transmit attempts */
00131 
00132 
00133 struct ath_buf {
00134   STAILQ_ENTRY(ath_buf) bf_list;
00135         struct ath_desc         *bf_desc;       /* virtual addr of desc */
00136         dma_addr_t              bf_daddr;       /* physical addr of desc */
00137         struct sk_buff          *bf_skb;        /* skbuff for buf */
00138         dma_addr_t              bf_skbaddr;     /* physical addr of skb data */
00139         struct ieee80211_node   *bf_node;       /* pointer to the node */
00140 };
00141 
00142 struct ath_hal;
00143 struct ath_desc;
00144 struct proc_dir_entry;
00145 
00146 
00147 /*
00148  * Data transmit queue state.  One of these exists for each
00149  * hardware transmit queue.  Packets sent to us from above
00150  * are assigned to queues based on their priority.  Not all
00151  * devices support a complete set of hardware transmit queues.
00152  * For those devices the array sc_ac2q will map multiple
00153  * priorities to fewer hardware queues (typically all to one
00154  * hardware queue).
00155  */
00156 struct ath_txq {
00157         u_int                   axq_qnum;       /* hardware q number */
00158         u_int                   axq_depth;      /* queue depth (stat only) */
00159         u_int                   axq_intrcnt;    /* interrupt count */
00160         u_int32_t               *axq_link;      /* link ptr in last TX desc */
00161         STAILQ_HEAD(, ath_buf)  axq_q;          /* transmit queue */
00162         spinlock_t              axq_lock;       /* lock on q and link */
00163 };
00164 
00165 #define ATH_TXQ_LOCK_INIT(_tq)          spin_lock_init(&(_tq)->axq_lock)
00166 #define ATH_TXQ_LOCK_DESTROY(_tq)       
00167 #define ATH_TXQ_LOCK(_tq)               spin_lock(&(_tq)->axq_lock)
00168 #define ATH_TXQ_UNLOCK(_tq)             spin_unlock(&(_tq)->axq_lock)
00169 #define ATH_TXQ_LOCK_BH(_tq)            spin_lock_bh(&(_tq)->axq_lock)
00170 #define ATH_TXQ_UNLOCK_BH(_tq)          spin_unlock_bh(&(_tq)->axq_lock)
00171 #define ATH_TXQ_LOCK_ASSERT(_tq) \
00172         KASSERT(spin_is_locked(&(_tq)->axq_lock), ("txq not locked!"))
00173 
00174 #define ATH_TXQ_INSERT_TAIL(_tq, _elm, _field) do { \
00175         STAILQ_INSERT_TAIL(&(_tq)->axq_q, (_elm), _field); \
00176         (_tq)->axq_depth++; \
00177 } while (0)
00178 #define ATH_TXQ_REMOVE_HEAD(_tq, _field) do { \
00179         STAILQ_REMOVE_HEAD(&(_tq)->axq_q, _field); \
00180         (_tq)->axq_depth--; \
00181 } while (0)
00182 
00183 struct ath_softc {
00184   //struct ieee80211com sc_ic;          /* IEEE 802.11 common */
00185   struct net_device     dev;            /* NB: this must be first */
00186   struct semaphore sc_lock;         /* dev-level lock */
00187   struct ath_hal                *sc_ah;         /* Atheros HAL */
00188 
00189   unsigned int  sc_invalid : 1, /* being detached */
00190     sc_mrretry : 1,     /* multi-rate retry support */
00191     sc_softled : 1,     /* enable LED gpio status */
00192     sc_hasdiversity : 1,/* rx diversity available */
00193     sc_diversity : 1;/* enable rx diversity */
00194   u_int16_t             sc_ledstate;
00195   u_int16_t             sc_ledpin;      /* GPIO pin for LED */
00196                                                 /* rate tables */
00197         const HAL_RATE_TABLE    *sc_rates[IEEE80211_MODE_MAX];
00198         const HAL_RATE_TABLE    *sc_currates;   /* current rate table */
00199         enum ieee80211_phymode  ic_curmode;     /* current phy mode */
00200         u_int8_t                sc_rixmap[256]; /* IEEE to h/w rate table ix */
00201         u_int8_t                sc_hwmap[32];   /* h/w rate ix to IEEE table */
00202         HAL_INT                 sc_imask;       /* interrupt mask copy */
00203 
00204         void                    *sc_bdev;       /* bus device (will be cast by 
00205                                                  * bus specific code) 
00206                                                  */
00207         struct ath_desc         *sc_desc;       /* TX/RX descriptors */
00208         size_t                  sc_desc_len;    /* size of TX/RX descriptors */
00209         u_int16_t               sc_cachelsz;    /* cache line size */
00210         dma_addr_t              sc_desc_daddr;  /* DMA (physical) address */
00211 
00212         struct tq_struct        sc_fataltq;     /* fatal error intr tasklet */
00213 
00214         int                     sc_rxbufsize;   /* rx size based on mtu */
00215         STAILQ_HEAD(, ath_buf)  sc_rxbuf;       /* receive buffer */
00216         u_int32_t               *sc_rxlink;     /* link ptr in last RX desc */
00217         struct tq_struct        sc_rxtq;        /* rx intr tasklet */
00218         struct tq_struct        sc_rxorntq;     /* rxorn intr tasklet */
00219 
00220         int sc_AC2qNum[4];                      /* HAL q nums for each AC value */
00221         u_int32_t               *sc_txlink[HAL_NUM_TX_QUEUES];  /* link ptr in last TX desc */
00222   STAILQ_HEAD(, ath_buf)        sc_txbuf;       /* tx buffer queue */
00223         spinlock_t              sc_txbuflock;   /* txbuf lock */
00224         u_int                   sc_txqsetup;    /* h/w queues setup */
00225 
00226         struct ath_txq          sc_txq[HAL_NUM_TX_QUEUES];    /* transmit queue */
00227         struct ath_txq     *sc_ac2q[5];
00228         struct tq_struct        sc_txtq;        /* tx intr tasklet */
00229 
00230   //u_int                       sc_bhalq;       /* HAL q for outgoing beacons */
00231         struct ath_buf          *sc_bcbuf;      /* beacon buffer */
00232         struct ath_buf          *sc_bufptr;     /* allocated buffer ptr */
00233         struct tq_struct        sc_bmisstq;     /* bmiss intr tasklet */
00234 
00235         struct timer_list       sc_rate_ctl;    /* tx rate control timer */
00236         struct timer_list       sc_cal_ch;      /* calibration timer */
00237         struct timer_list       sc_scan_ch;     /* AP scan timer */
00238         struct ath_stats        sc_stats;       /* interface statistics */
00239         u_int8_t                sc_defant;      /* current default antenna */
00240         u_int8_t                sc_rxotherant;  /* rx's on non-default antenna*/
00241 
00242   u_int                 sc_keymax;      /* size of key cache */
00243 
00244   /* ic stuff */
00245   int                   ic_fixed_rate;  /* a dot11Rate */
00246 
00247   int ic_rts_threshold;
00248         enum ieee80211_phytype  ic_phytype;     /* XXX wrong for multi-mode */
00249         enum ieee80211_opmode   ic_opmode;      /* operation mode */
00250 
00251         int                     ic_esslen;
00252         u_int8_t                ic_essid[IEEE80211_NWID_LEN];
00253         int                     ic_nicknamelen;
00254         u_int8_t                ic_nickname[IEEE80211_NWID_LEN];
00255 
00256   u_int16_t             ic_lintval;     /* listen interval */
00257   u_int16_t             ni_fhdwell;     /* FH only */
00258   u_int8_t              ni_fhindex;     /* FH only */
00259   
00260   u_int32_t             ic_flags;       /* state flags */
00261   u_int32_t             ic_caps;        /* capabilities */
00262   u_int16_t             ic_modecaps;    /* set of mode capabilities */
00263   struct ieee80211channel ic_channels[IEEE80211_CHAN_MAX+1];
00264   struct ieee80211channel *current_channel;
00265   u_char                        ic_chan_avail[roundup(IEEE80211_CHAN_MAX/NBBY,NBBY)];
00266 
00267   int subsequent_kicks;
00268 
00269   int dev_type;
00270 
00271   u_int8_t              bssid[IEEE80211_ADDR_LEN];
00272   struct net_device_stats       ic_stats;       /* interface statistics */
00273   struct ieee80211_wepkey       ic_nw_keys[IEEE80211_WEP_NKID];
00274 #ifdef CONFIG_NET_WIRELESS
00275   struct iw_statistics  ic_iwstats;     /* wireless statistics block */
00276 #endif
00277   u_int16_t txseq;
00278 
00279   u_int8_t              sc_txantenna;   /* tx antenna (fixed or auto) */
00280   int                   sc_debug;
00281 
00282 #ifdef CONFIG_SYSCTL
00283         struct ctl_table_header *sc_sysctl_header;
00284         struct ctl_table        *sc_sysctls;
00285 #endif
00286 
00287 };
00288 
00289 
00290 #define ATH_TXQ_SETUP(sc, i)    ((sc)->sc_txqsetup & (1<<i))
00291 
00292 #define ATH_TXBUF_LOCK_INIT(_sc)        spin_lock_init(&(_sc)->sc_txbuflock)
00293 #define ATH_TXBUF_LOCK_DESTROY(_sc)
00294 #define ATH_TXBUF_LOCK(_sc)             spin_lock(&(_sc)->sc_txbuflock)
00295 #define ATH_TXBUF_UNLOCK(_sc)           spin_unlock(&(_sc)->sc_txbuflock)
00296 #define ATH_TXBUF_LOCK_BH(_sc)          spin_lock_bh(&(_sc)->sc_txbuflock)
00297 #define ATH_TXBUF_UNLOCK_BH(_sc)        spin_unlock_bh(&(_sc)->sc_txbuflock)
00298 #define ATH_TXBUF_LOCK_ASSERT(_sc) \
00299         KASSERT(spin_is_locked(&(_sc)->sc_txbuflock), ("txbuf not locked!"))
00300 
00301 #define ATH_LOCK_INIT(_sc)              init_MUTEX(&(_sc)->sc_lock)
00302 #define ATH_LOCK_DESTROY(_sc)
00303 #define ATH_LOCK(_sc)                   down(&(_sc)->sc_lock)
00304 #define ATH_UNLOCK(_sc)                 up(&(_sc)->sc_lock)
00305 
00306 extern  int ath_debug;
00307 
00308 
00309 int     ath_attach(u_int16_t, struct net_device *);
00310 int     ath_detach(struct net_device *);
00311 void    ath_resume(struct net_device *);
00312 void    ath_suspend(struct net_device *);
00313 void    ath_shutdown(struct net_device *);
00314 irqreturn_t ath_intr(int irq, void *dev_id, struct pt_regs *regs);
00315 #ifdef CONFIG_SYSCTL
00316 void    ath_sysctl_register(void);
00317 void    ath_sysctl_unregister(void);
00318 #endif /* CONFIG_SYSCTL */
00319 
00320 /*
00321  * HAL definitions to comply with local coding convention.
00322  */
00323 #define ath_hal_reset(_ah, _opmode, _chan, _outdoor, _pstatus) \
00324         ((*(_ah)->ah_reset)((_ah), (_opmode), (_chan), (_outdoor), (_pstatus)))
00325 #define ath_hal_getratetable(_ah, _mode) \
00326         ((*(_ah)->ah_getRateTable)((_ah), (_mode)))
00327 #define ath_hal_getmac(_ah, _mac) \
00328         ((*(_ah)->ah_getMacAddress)((_ah), (_mac)))
00329 #define ath_hal_setmac(_ah, _mac) \
00330         ((*(_ah)->ah_setMacAddress)((_ah), (_mac)))
00331 #define ath_hal_intrset(_ah, _mask) \
00332         ((*(_ah)->ah_setInterrupts)((_ah), (_mask)))
00333 #define ath_hal_intrget(_ah) \
00334         ((*(_ah)->ah_getInterrupts)((_ah)))
00335 #define ath_hal_intrpend(_ah) \
00336         ((*(_ah)->ah_isInterruptPending)((_ah)))
00337 #define ath_hal_getisr(_ah, _pmask) \
00338         ((*(_ah)->ah_getPendingInterrupts)((_ah), (_pmask)))
00339 #define ath_hal_updatetxtriglevel(_ah, _inc) \
00340         ((*(_ah)->ah_updateTxTrigLevel)((_ah), (_inc)))
00341 #define ath_hal_setpower(_ah, _mode, _sleepduration) \
00342         ((*(_ah)->ah_setPowerMode)((_ah), (_mode), AH_TRUE, (_sleepduration)))
00343 #define ath_hal_keycachesize(_ah) \
00344         ((*(_ah)->ah_getKeyCacheSize)((_ah)))
00345 #define ath_hal_keyreset(_ah, _ix) \
00346         ((*(_ah)->ah_resetKeyCacheEntry)((_ah), (_ix)))
00347 #define ath_hal_keyset(_ah, _ix, _pk, _mac) \
00348         ((*(_ah)->ah_setKeyCacheEntry)((_ah), (_ix), (_pk), (_mac), AH_FALSE))
00349 #define ath_hal_keyisvalid(_ah, _ix) \
00350         (((*(_ah)->ah_isKeyCacheEntryValid)((_ah), (_ix))))
00351 #define ath_hal_keysetmac(_ah, _ix, _mac) \
00352         ((*(_ah)->ah_setKeyCacheEntryMac)((_ah), (_ix), (_mac)))
00353 #define ath_hal_getrxfilter(_ah) \
00354         ((*(_ah)->ah_getRxFilter)((_ah)))
00355 #define ath_hal_setrxfilter(_ah, _filter) \
00356         ((*(_ah)->ah_setRxFilter)((_ah), (_filter)))
00357 #define ath_hal_setmcastfilter(_ah, _mfilt0, _mfilt1) \
00358         ((*(_ah)->ah_setMulticastFilter)((_ah), (_mfilt0), (_mfilt1)))
00359 #define ath_hal_waitforbeacon(_ah, _bf) \
00360         ((*(_ah)->ah_waitForBeaconDone)((_ah), (_bf)->bf_daddr))
00361 #define ath_hal_putrxbuf(_ah, _bufaddr) \
00362         ((*(_ah)->ah_setRxDP)((_ah), (_bufaddr)))
00363 #define ath_hal_gettsf32(_ah) \
00364         ((*(_ah)->ah_getTsf32)((_ah)))
00365 #define ath_hal_gettsf64(_ah) \
00366         ((*(_ah)->ah_getTsf64)((_ah)))
00367 #define ath_hal_resettsf(_ah) \
00368         ((*(_ah)->ah_resetTsf)((_ah)))
00369 #define ath_hal_rxena(_ah) \
00370         ((*(_ah)->ah_enableReceive)((_ah)))
00371 #define ath_hal_puttxbuf(_ah, _q, _bufaddr) \
00372         ((*(_ah)->ah_setTxDP)((_ah), (_q), (_bufaddr)))
00373 #define ath_hal_gettxbuf(_ah, _q) \
00374         ((*(_ah)->ah_getTxDP)((_ah), (_q)))
00375 #define ath_hal_getrxbuf(_ah) \
00376         ((*(_ah)->ah_getRxDP)((_ah)))
00377 #define ath_hal_txstart(_ah, _q) \
00378         ((*(_ah)->ah_startTxDma)((_ah), (_q)))
00379 #define ath_hal_setchannel(_ah, _chan) \
00380         ((*(_ah)->ah_setChannel)((_ah), (_chan)))
00381 #define ath_hal_calibrate(_ah, _chan) \
00382         ((*(_ah)->ah_perCalibration)((_ah), (_chan)))
00383 #define ath_hal_setledstate(_ah, _state) \
00384         ((*(_ah)->ah_setLedState)((_ah), (_state)))
00385 #define ath_hal_beaconinit(_ah, _nextb, _bperiod) \
00386         ((*(_ah)->ah_beaconInit)((_ah), (_nextb), (_bperiod)))
00387 #define ath_hal_beaconreset(_ah) \
00388         ((*(_ah)->ah_resetStationBeaconTimers)((_ah)))
00389 #define ath_hal_beacontimers(_ah, _bs) \
00390         ((*(_ah)->ah_setStationBeaconTimers)((_ah), (_bs)))
00391 #define ath_hal_setassocid(_ah, _bss, _associd) \
00392         ((*(_ah)->ah_writeAssocid)((_ah), (_bss), (_associd)))
00393 #define ath_hal_phydisable(_ah) \
00394         ((*(_ah)->ah_phyDisable)((_ah)))
00395 #define ath_hal_setopmode(_ah) \
00396         ((*(_ah)->ah_setPCUConfig)((_ah)))
00397 #define ath_hal_stoptxdma(_ah, _qnum) \
00398         ((*(_ah)->ah_stopTxDma)((_ah), (_qnum)))
00399 #define ath_hal_stoppcurecv(_ah) \
00400         ((*(_ah)->ah_stopPcuReceive)((_ah)))
00401 #define ath_hal_startpcurecv(_ah) \
00402         ((*(_ah)->ah_startPcuReceive)((_ah)))
00403 #define ath_hal_stopdmarecv(_ah) \
00404         ((*(_ah)->ah_stopDmaReceive)((_ah)))
00405 #define ath_hal_getdiagstate(_ah, _id, _indata, _insize, _outdata, _outsize) \
00406         ((*(_ah)->ah_getDiagState)((_ah), (_id), \
00407                 (_indata), (_insize), (_outdata), (_outsize)))
00408 #define ath_hal_setuptxqueue(_ah, _type, _irq) \
00409         ((*(_ah)->ah_setupTxQueue)((_ah), (_type), (_irq)))
00410 #define ath_hal_resettxqueue(_ah, _q) \
00411         ((*(_ah)->ah_resetTxQueue)((_ah), (_q)))
00412 #define ath_hal_releasetxqueue(_ah, _q) \
00413         ((*(_ah)->ah_releaseTxQueue)((_ah), (_q)))
00414 #define ath_hal_hasveol(_ah) \
00415         ((*(_ah)->ah_hasVEOL)((_ah)))
00416 #define ath_hal_getrfgain(_ah) \
00417         ((*(_ah)->ah_getRfGain)((_ah)))
00418 #define ath_hal_getdefantenna(_ah) \
00419         ((*(_ah)->ah_getDefAntenna)((_ah)))
00420 #define ath_hal_setdefantenna(_ah, _ant) \
00421         ((*(_ah)->ah_setDefAntenna)((_ah), (_ant)))
00422 #define ath_hal_rxmonitor(_ah, _arg) \
00423         ((*(_ah)->ah_rxMonitor)((_ah), (_arg)))
00424 #define ath_hal_mibevent(_ah, _stats) \
00425         ((*(_ah)->ah_procMibEvent)((_ah), (_stats)))
00426 #define ath_hal_setslottime(_ah, _us) \
00427         ((*(_ah)->ah_setSlotTime)((_ah), (_us)))
00428 #define ath_hal_getslottime(_ah) \
00429         ((*(_ah)->ah_getSlotTime)((_ah)))
00430 #define ath_hal_setacktimeout(_ah, _us) \
00431         ((*(_ah)->ah_setAckTimeout)((_ah), (_us)))
00432 #define ath_hal_getacktimeout(_ah) \
00433         ((*(_ah)->ah_getAckTimeout)((_ah)))
00434 #define ath_hal_setctstimeout(_ah, _us) \
00435         ((*(_ah)->ah_setCTSTimeout)((_ah), (_us)))
00436 #define ath_hal_getctstimeout(_ah) \
00437         ((*(_ah)->ah_getCTSTimeout)((_ah)))
00438 #define ath_hal_getcapability(_ah, _cap, _param, _result) \
00439         ((*(_ah)->ah_getCapability)((_ah), (_cap), (_param), (_result)))
00440 #define ath_hal_setcapability(_ah, _cap, _param, _v, _status) \
00441         ((*(_ah)->ah_setCapability)((_ah), (_cap), (_param), (_v), (_status)))
00442 #define ath_hal_ciphersupported(_ah, _cipher) \
00443         (ath_hal_getcapability(_ah, HAL_CAP_CIPHER, _cipher, NULL) == HAL_OK)
00444 #define ath_hal_getregdomain(_ah, _prd) \
00445         ath_hal_getcapability(_ah, HAL_CAP_REG_DMN, 0, (_prd))
00446 #define ath_hal_getcountrycode(_ah, _pcc) \
00447         (*(_pcc) = (_ah)->ah_countryCode)
00448 #define ath_hal_tkipsplit(_ah) \
00449         (ath_hal_getcapability(_ah, HAL_CAP_TKIP_SPLIT, 0, NULL) == HAL_OK)
00450 #define ath_hal_hwphycounters(_ah) \
00451         (ath_hal_getcapability(_ah, HAL_CAP_PHYCOUNTERS, 0, NULL) == HAL_OK)
00452 #define ath_hal_hasdiversity(_ah) \
00453         (ath_hal_getcapability(_ah, HAL_CAP_DIVERSITY, 0, NULL) == HAL_OK)
00454 #define ath_hal_getdiversity(_ah) \
00455         (ath_hal_getcapability(_ah, HAL_CAP_DIVERSITY, 1, NULL) == HAL_OK)
00456 #define ath_hal_setdiversity(_ah, _v) \
00457         ath_hal_setcapability(_ah, HAL_CAP_DIVERSITY, 1, _v, NULL)
00458 
00459 #define ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \
00460         ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq)))
00461 #define ath_hal_rxprocdesc(_ah, _ds, _dspa, _dsnext) \
00462         ((*(_ah)->ah_procRxDesc)((_ah), (_ds), (_dspa), (_dsnext)))
00463 #define ath_hal_setuptxdesc(_ah, _ds, _plen, _hlen, _atype, _txpow, \
00464                 _txr0, _txtr0, _keyix, _ant, _flags, \
00465                 _rtsrate, _rtsdura) \
00466         ((*(_ah)->ah_setupTxDesc)((_ah), (_ds), (_plen), (_hlen), (_atype), \
00467                 (_txpow), (_txr0), (_txtr0), (_keyix), (_ant), \
00468                 (_flags), (_rtsrate), (_rtsdura)))
00469 #define ath_hal_setupxtxdesc(_ah, _ds, \
00470                 _txr1, _txtr1, _txr2, _txtr2, _txr3, _txtr3) \
00471         ((*(_ah)->ah_setupXTxDesc)((_ah), (_ds), \
00472                 (_txr1), (_txtr1), (_txr2), (_txtr2), (_txr3), (_txtr3)))
00473 #define ath_hal_filltxdesc(_ah, _ds, _l, _first, _last, _ds0) \
00474         ((*(_ah)->ah_fillTxDesc)((_ah), (_ds), (_l), (_first), (_last), (_ds0)))
00475 #define ath_hal_txprocdesc(_ah, _ds) \
00476         ((*(_ah)->ah_procTxDesc)((_ah), (_ds)))
00477 
00478 #define ath_hal_gpioCfgOutput(_ah, _gpio) \
00479         ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio)))
00480 #define ath_hal_gpioset(_ah, _gpio, _b) \
00481         ((*(_ah)->ah_gpioSet)((_ah), (_gpio), (_b)))
00482 
00483 #define ath_hal_settxpowerlimit(_ah, _int) \
00484         ((*(_ah)->ah_setTxPowerLimit)((_ah), (_int)))
00485 
00486 #endif /* _DEV_ATH_ATHVAR_H */

Generated on Mon Nov 21 15:58:10 2005 for openwifi by  doxygen 1.4.1