Ticket #1337: madwifi-0.9.3-ath-halops.3.diff

File madwifi-0.9.3-ath-halops.3.diff, 60.4 kB (added by mtaylor, 5 years ago)

Update

  • madwifi/ath_hal/ath_hal_api.c

    old new  
     1/* 
     2 * Wrapper macros/functions for the binary HAL to comply with local coding convention. 
     3 *  
     4 * Provides function-style calling convention using either macros or wrapper functions for function pointers in the HAL. 
     5 *  
     6 * The typical convention is foo(hal,p1,p2,p3,...) turns into hal->foo(p1,p2,p3,...) where foo  
     7 * is a function pointer and a member of the struct ath_hal. 
     8 * 
     9 * The macros are faster, but the functions have the advantage that they show up unobfuscated in backtraces thus giving you a clue as to where in  
     10 * your code you went wrong in your use of the HAL. 
     11 * 
     12 */ 
     13#include "opt_ah.h" 
     14 
     15#ifdef AH_HALOPS_FUNC 
     16 
     17#ifndef AUTOCONF_INCLUDED 
     18#include <linux/config.h> 
     19#endif 
     20#include <linux/version.h> 
     21#include <linux/module.h> 
     22#include <linux/init.h> 
     23#include <linux/skbuff.h> 
     24#include <linux/netdevice.h> 
     25#include <linux/etherdevice.h> 
     26#include <linux/random.h> 
     27#include <linux/delay.h> 
     28#include <linux/cache.h> 
     29#include <linux/sysctl.h> 
     30#include <linux/proc_fs.h> 
     31#include <linux/if_arp.h> 
     32#include <linux/rtnetlink.h> 
     33#include <asm/uaccess.h> 
     34 
     35#include "ath_hal_api.h" 
     36 
     37/* 
     38 * HAL definitions to comply with local coding convention. 
     39 */ 
     40HAL_BOOL ath_hal_reset(struct ath_hal* ah, HAL_OPMODE opmode, HAL_CHANNEL* chan,  HAL_BOOL outdoor, HAL_STATUS* pstatus) 
     41{  
     42    return ((*ah->ah_reset)(ah, (opmode), (chan), (outdoor), (pstatus)));  
     43} 
     44const HAL_RATE_TABLE* ath_hal_getratetable(struct ath_hal* ah, u_int mode) { 
     45    return ((*ah->ah_getRateTable)(ah, (mode))); 
     46} 
     47void ath_hal_getmac(struct ath_hal* ah, u_int8_t* mac) { 
     48    (*ah->ah_getMacAddress)(ah, (mac)); 
     49} 
     50HAL_BOOL ath_hal_setmac(struct ath_hal* ah, const u_int8_t* mac) { 
     51    return ((*ah->ah_setMacAddress)(ah, (mac))); 
     52} 
     53void ath_hal_getbssidmask(struct ath_hal * ah, u_int8_t * mask) { 
     54    (*ah->ah_getBssIdMask)(ah, (mask)); 
     55} 
     56HAL_BOOL ath_hal_setbssidmask(struct ath_hal * ah, const u_int8_t* mask) { 
     57    return ((*ah->ah_setBssIdMask)(ah, (mask))); 
     58} 
     59HAL_INT ath_hal_intrset(struct ath_hal* ah, HAL_INT mask) { 
     60    return ((*ah->ah_setInterrupts)(ah, (mask))); 
     61} 
     62HAL_INT ath_hal_intrget(struct ath_hal* ah) { 
     63    return ((*ah->ah_getInterrupts)(ah)); 
     64} 
     65HAL_BOOL ath_hal_intrpend(struct ath_hal* ah) { 
     66    return ((*ah->ah_isInterruptPending)(ah)); 
     67} 
     68HAL_BOOL ath_hal_getisr(struct ath_hal* ah, HAL_INT* pmask) { 
     69    return ((*ah->ah_getPendingInterrupts)(ah, (pmask))); 
     70} 
     71HAL_BOOL ath_hal_updatetxtriglevel(struct ath_hal* ah, HAL_BOOL inc) { 
     72    return ((*ah->ah_updateTxTrigLevel)(ah, (inc))); 
     73} 
     74HAL_BOOL ath_hal_setpower(struct ath_hal* ah, HAL_POWER_MODE mode) { 
     75        return ((*ah->ah_setPowerMode)(ah, (mode), AH_TRUE)); 
     76} 
     77u_int32_t ath_hal_keycachesize(struct ath_hal* ah) { 
     78    return ((*ah->ah_getKeyCacheSize)(ah)); 
     79} 
     80HAL_BOOL ath_hal_keyreset(struct ath_hal* ah, u_int16_t ix) { 
     81    return ((*ah->ah_resetKeyCacheEntry)(ah, (ix))); 
     82} 
     83HAL_BOOL ath_hal_keyset(struct ath_hal* ah, u_int16_t ix, const HAL_KEYVAL * pk, const u_int8_t * mac) { 
     84    return ((*ah->ah_setKeyCacheEntry)(ah, (ix), (pk), (mac), AH_FALSE)); 
     85} 
     86HAL_BOOL ath_hal_keyisvalid(struct ath_hal *ah, u_int16_t ix) { 
     87    return (((*ah->ah_isKeyCacheEntryValid)(ah, (ix)))); 
     88} 
     89HAL_BOOL ath_hal_keysetmac(struct ath_hal* ah, u_int16_t ix, const u_int8_t *mac) { 
     90    return ((*ah->ah_setKeyCacheEntryMac)(ah, (ix), (mac))); 
     91} 
     92u_int32_t ath_hal_getrxfilter(struct ath_hal* ah) { 
     93    return ((*ah->ah_getRxFilter)(ah)); 
     94} 
     95void ath_hal_setrxfilter(struct ath_hal* ah, u_int32_t filter) { 
     96    (*ah->ah_setRxFilter)(ah, (filter)); 
     97} 
     98void ath_hal_setmcastfilter(struct ath_hal* ah, u_int32_t mfilt0, u_int32_t mfilt1) { 
     99    ((*ah->ah_setMulticastFilter)(ah, (mfilt0), (mfilt1))); 
     100} 
     101void ath_hal_putrxbuf(struct ath_hal* ah, u_int32_t bufaddr) { 
     102    ((*ah->ah_setRxDP)(ah, (bufaddr))); 
     103} 
     104u_int32_t ath_hal_gettsf32(struct ath_hal* ah) { 
     105        return ((*ah->ah_getTsf32)(ah)); 
     106} 
     107u_int64_t ath_hal_gettsf64(struct ath_hal* ah) { 
     108    return ((*ah->ah_getTsf64)(ah)); 
     109} 
     110void ath_hal_resettsf(struct ath_hal* ah) { 
     111    ((*ah->ah_resetTsf)(ah)); 
     112} 
     113void ath_hal_rxena(struct ath_hal* ah) { 
     114    ((*ah->ah_enableReceive)(ah)); 
     115} 
     116 
     117u_int32_t ath_hal_numtxpending(struct ath_hal *ah, u_int q) { 
     118    return ((*ah->ah_numTxPending)(ah, (q))); 
     119} 
     120 
     121HAL_BOOL ath_hal_puttxbuf(struct ath_hal* ah, u_int q, u_int32_t bufaddr) { 
     122    return ((*ah->ah_setTxDP)(ah, (q), (bufaddr))); 
     123} 
     124 
     125u_int32_t ath_hal_gettxbuf(struct ath_hal* ah, u_int q) { 
     126    return ((*ah->ah_getTxDP)(ah, (q))); 
     127} 
     128 
     129u_int32_t ath_hal_getrxbuf(struct ath_hal* ah) { 
     130    return ((*ah->ah_getRxDP)(ah)); 
     131} 
     132 
     133HAL_BOOL ath_hal_txstart(struct ath_hal* ah, u_int q) { 
     134    return ((*ah->ah_startTxDma)(ah, (q))); 
     135} 
     136 
     137HAL_BOOL ath_hal_calibrate(struct ath_hal* ah, HAL_CHANNEL * chan, HAL_BOOL * isIQdone) { 
     138    return ((*ah->ah_perCalibration)(ah, (chan), (isIQdone))); 
     139} 
     140 
     141void ath_hal_setledstate(struct ath_hal* ah, HAL_LED_STATE state) { 
     142    return ((*ah->ah_setLedState)(ah, (state))); 
     143} 
     144void ath_hal_beaconinit(struct ath_hal * ah, u_int32_t nextb, u_int32_t bperiod) { 
     145    ((*ah->ah_beaconInit)(ah, (nextb), (bperiod))); 
     146} 
     147void ath_hal_beaconreset(struct ath_hal* ah) { 
     148    ((*ah->ah_resetStationBeaconTimers)(ah)); 
     149} 
     150void ath_hal_beacontimers(struct ath_hal* ah, const HAL_BEACON_STATE *bs) { 
     151    ((*ah->ah_setStationBeaconTimers)(ah, (bs))); 
     152} 
     153 
     154void ath_hal_setassocid(struct ath_hal* ah, const u_int8_t *bss, u_int16_t associd) { 
     155    ((*ah->ah_writeAssocid)(ah, (bss), (associd))); 
     156} 
     157 
     158HAL_BOOL ath_hal_phydisable(struct ath_hal * ah) { 
     159    return ((*ah->ah_phyDisable)(ah)); 
     160} 
     161 
     162void ath_hal_setopmode(struct ath_hal * ah) { 
     163    ((*ah->ah_setPCUConfig)(ah)); 
     164} 
     165 
     166HAL_BOOL ath_hal_stoptxdma(struct ath_hal* ah, u_int q) { 
     167    return ((*ah->ah_stopTxDma)(ah, q)); 
     168} 
     169 
     170void ath_hal_stoppcurecv(struct ath_hal* ah) { 
     171    ((*ah->ah_stopPcuReceive)(ah)); 
     172} 
     173 
     174void ath_hal_startpcurecv(struct ath_hal* ah) { 
     175    ((*ah->ah_startPcuReceive)(ah)); 
     176} 
     177 
     178HAL_BOOL ath_hal_stopdmarecv(struct ath_hal* ah) { 
     179    return ((*ah->ah_stopDmaReceive)(ah)); 
     180} 
     181 
     182HAL_BOOL ath_hal_getdiagstate(struct ath_hal *ah, int id, const void *indata, u_int32_t insize, void** outdata, u_int32_t* outsize) { 
     183    return ((*ah->ah_getDiagState)(ah, (id), (indata), (insize), (outdata), (outsize))); 
     184} 
     185 
     186HAL_BOOL ath_hal_gettxqueueprops(struct ath_hal * ah, int q, HAL_TXQ_INFO *qi) { 
     187    return ((*ah->ah_getTxQueueProps)(ah, (q), (qi))); 
     188} 
     189 
     190HAL_BOOL ath_hal_settxqueueprops(struct ath_hal *ah, int q, const HAL_TXQ_INFO *qi) { 
     191    return ((*ah->ah_setTxQueueProps)(ah, (q), (qi))); 
     192} 
     193int     ath_hal_setuptxqueue(struct ath_hal * ah, HAL_TX_QUEUE type, const HAL_TXQ_INFO * qi) { 
     194    return (*ah->ah_setupTxQueue)(ah, type, qi); 
     195} 
     196 
     197HAL_BOOL ath_hal_resettxqueue(struct ath_hal *ah, u_int q) { 
     198    return ((*ah->ah_resetTxQueue)(ah, (q))); 
     199} 
     200HAL_BOOL ath_hal_releasetxqueue(struct ath_hal *ah, u_int q) { 
     201    return ((*ah->ah_releaseTxQueue)(ah, (q))); 
     202} 
     203HAL_RFGAIN ath_hal_getrfgain(struct ath_hal* ah) { 
     204    return ((*ah->ah_getRfGain)(ah)); 
     205} 
     206u_int ath_hal_getdefantenna(struct ath_hal* ah) { 
     207    return ((*ah->ah_getDefAntenna)(ah)); 
     208} 
     209void ath_hal_setdefantenna(struct ath_hal* ah, u_int ant) { 
     210    (*ah->ah_setDefAntenna)(ah, (ant)); 
     211} 
     212 
     213void ath_hal_rxmonitor(struct ath_hal* ah, const HAL_NODE_STATS *stats, HAL_CHANNEL *chan) { 
     214    (*ah->ah_rxMonitor)(ah, stats, chan); 
     215} 
     216void ath_hal_mibevent(struct ath_hal * ah, const HAL_NODE_STATS *stats) { 
     217    ((*ah->ah_procMibEvent)(ah, (stats))); 
     218} 
     219HAL_BOOL ath_hal_setslottime(struct ath_hal* ah, u_int us) { 
     220    return ((*ah->ah_setSlotTime)(ah, (us))); 
     221} 
     222u_int ath_hal_getslottime(struct ath_hal* ah) { 
     223    return ((*ah->ah_getSlotTime)(ah)); 
     224} 
     225 
     226HAL_BOOL ath_hal_setacktimeout(struct ath_hal* ah, u_int us) { 
     227    return ((*ah->ah_setAckTimeout)(ah, (us))); 
     228} 
     229 
     230u_int ath_hal_getacktimeout(struct ath_hal* ah) { 
     231    return ((*ah->ah_getAckTimeout)(ah)); 
     232} 
     233 
     234HAL_BOOL ath_hal_setctstimeout(struct ath_hal* ah, u_int us) { 
     235    return ((*ah->ah_setCTSTimeout)(ah, (us))); 
     236} 
     237 
     238u_int ath_hal_getctstimeout(struct ath_hal* ah) { 
     239    return ((*ah->ah_getCTSTimeout)(ah)); 
     240} 
     241 
     242HAL_BOOL ath_hal_setdecompmask(struct ath_hal* ah, u_int16_t keyid, int b) { 
     243    return ((*ah->ah_setDecompMask)(ah, (keyid), (b))); 
     244} 
     245 
     246HAL_STATUS ath_hal_getcapability(struct ath_hal * ah, HAL_CAPABILITY_TYPE type, u_int32_t capability, u_int32_t *result) { 
     247    return ((*ah->ah_getCapability)(ah, (type), (capability), (result))); 
     248} 
     249 
     250HAL_BOOL ath_hal_setcapability(struct ath_hal * ah, HAL_CAPABILITY_TYPE type, u_int32_t capability, u_int32_t setting, HAL_STATUS *status) { 
     251    return ((*ah->ah_setCapability)(ah, (type), (capability), (setting), (status))); 
     252} 
     253 
     254HAL_BOOL ath_hal_ciphersupported(struct ath_hal * ah, u_int32_t cipher) { 
     255    return (ath_hal_getcapability(ah, HAL_CAP_CIPHER, cipher, NULL) == HAL_OK); 
     256} 
     257 
     258HAL_BOOL ath_hal_fastframesupported(struct ath_hal * ah) { 
     259    return (ath_hal_getcapability(ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK); 
     260} 
     261 
     262HAL_BOOL ath_hal_burstsupported(struct ath_hal * ah) { 
     263    return (ath_hal_getcapability(ah, HAL_CAP_BURST, 0, NULL) == HAL_OK); 
     264} 
     265 
     266HAL_BOOL ath_hal_xrsupported(struct ath_hal * ah) { 
     267    return (ath_hal_getcapability(ah, HAL_CAP_XR, 0, NULL) == HAL_OK); 
     268} 
     269 
     270HAL_BOOL ath_hal_compressionsupported(struct ath_hal * ah) { 
     271    return (ath_hal_getcapability(ah, HAL_CAP_COMPRESSION, 0, NULL) == HAL_OK); 
     272} 
     273 
     274HAL_BOOL ath_hal_turboagsupported(struct ath_hal * ah, int countrycode) { 
     275    return (ath_hal_getwirelessmodes(ah, countrycode) & (HAL_MODE_108G|HAL_MODE_TURBO)); 
     276} 
     277 
     278HAL_BOOL ath_hal_halfrate_chansupported(struct ath_hal * ah) { 
     279    return (ath_hal_getcapability(ah, HAL_CAP_CHAN_HALFRATE, 0, NULL) == HAL_OK); 
     280} 
     281 
     282HAL_BOOL ath_hal_quarterrate_chansupported(struct ath_hal * ah) { 
     283    return (ath_hal_getcapability(ah, HAL_CAP_CHAN_QUARTERRATE, 0, NULL) == HAL_OK); 
     284} 
     285 
     286HAL_BOOL ath_hal_getregdomain(struct ath_hal * ah, u_int32_t* destination) { 
     287    return ath_hal_getcapability(ah, HAL_CAP_REG_DMN, 0, destination); 
     288} 
     289         
     290HAL_BOOL ath_hal_getcountrycode(struct ath_hal * ah, u_int32_t* destination) { 
     291    (*(destination) = ah->ah_countryCode); 
     292    return AH_TRUE; 
     293} 
     294 
     295HAL_BOOL ath_hal_hastkipsplit(struct ath_hal * ah) { 
     296    return (ath_hal_getcapability(ah, HAL_CAP_TKIP_SPLIT, 0, NULL) == HAL_OK); 
     297} 
     298 
     299HAL_BOOL ath_hal_gettkipsplit(struct ath_hal * ah) { 
     300    return (ath_hal_getcapability(ah, HAL_CAP_TKIP_SPLIT, 1, NULL) == HAL_OK); 
     301} 
     302 
     303HAL_BOOL ath_hal_settkipsplit(struct ath_hal * ah, int v) { 
     304    return ath_hal_setcapability(ah, HAL_CAP_TKIP_SPLIT, 1, v, NULL); 
     305} 
     306 
     307HAL_BOOL ath_hal_wmetkipmic(struct ath_hal * ah) { 
     308    return (ath_hal_getcapability(ah, HAL_CAP_WME_TKIPMIC, 0, NULL) == HAL_OK); 
     309} 
     310 
     311HAL_BOOL ath_hal_hwphycounters(struct ath_hal * ah) { 
     312    return (ath_hal_getcapability(ah, HAL_CAP_PHYCOUNTERS, 0, NULL) == HAL_OK); 
     313} 
     314 
     315HAL_BOOL ath_hal_hasdiversity(struct ath_hal * ah) { 
     316    return (ath_hal_getcapability(ah, HAL_CAP_DIVERSITY, 0, NULL) == HAL_OK); 
     317} 
     318 
     319HAL_BOOL ath_hal_getdiversity(struct ath_hal * ah) { 
     320    return (ath_hal_getcapability(ah, HAL_CAP_DIVERSITY, 1, NULL) == HAL_OK); 
     321} 
     322 
     323HAL_BOOL ath_hal_setdiversity(struct ath_hal * ah, int v) { 
     324    return ath_hal_setcapability(ah, HAL_CAP_DIVERSITY, 1, v, NULL); 
     325} 
     326 
     327HAL_BOOL ath_hal_getnumtxqueues(struct ath_hal * ah, u_int32_t* destination) { 
     328    return (ath_hal_getcapability(ah, HAL_CAP_NUM_TXQUEUES, 0, destination) == HAL_OK); 
     329} 
     330         
     331HAL_BOOL ath_hal_hasveol(struct ath_hal * ah) { 
     332    return (ath_hal_getcapability(ah, HAL_CAP_VEOL, 0, NULL) == HAL_OK); 
     333} 
     334         
     335HAL_BOOL ath_hal_hastxpowlimit(struct ath_hal * ah) { 
     336    return (ath_hal_getcapability(ah, HAL_CAP_TXPOW, 0, NULL) == HAL_OK); 
     337} 
     338         
     339HAL_BOOL ath_hal_settxpowlimit(struct ath_hal * ah, u_int32_t power) { 
     340    return ((*ah->ah_setTxPowerLimit)(ah, power)); 
     341} 
     342 
     343HAL_BOOL ath_hal_gettxpowlimit(struct ath_hal * ah, u_int32_t* destination) { 
     344    return (ath_hal_getcapability(ah, HAL_CAP_TXPOW, 1, destination) == HAL_OK); 
     345} 
     346 
     347HAL_BOOL ath_hal_getmaxtxpow(struct ath_hal * ah, u_int32_t* destination) { 
     348    return (ath_hal_getcapability(ah, HAL_CAP_TXPOW, 2, destination) == HAL_OK); 
     349} 
     350 
     351HAL_BOOL ath_hal_gettpscale(struct ath_hal * ah, u_int32_t* destination) { 
     352    return (ath_hal_getcapability(ah, HAL_CAP_TXPOW, 3, destination) == HAL_OK); 
     353} 
     354 
     355HAL_BOOL ath_hal_settpscale(struct ath_hal * ah, u_int32_t v) { 
     356    return ath_hal_setcapability(ah, HAL_CAP_TXPOW, 3, v, NULL); 
     357} 
     358 
     359HAL_BOOL ath_hal_hastpc(struct ath_hal * ah) { 
     360    return (ath_hal_getcapability(ah, HAL_CAP_TPC, 0, NULL) == HAL_OK); 
     361} 
     362 
     363HAL_BOOL ath_hal_gettpc(struct ath_hal * ah) { 
     364    return (ath_hal_getcapability(ah, HAL_CAP_TPC, 1, NULL) == HAL_OK); 
     365} 
     366 
     367HAL_BOOL ath_hal_settpc(struct ath_hal * ah, u_int32_t v) { 
     368    return ath_hal_setcapability(ah, HAL_CAP_TPC, 1, v, NULL); 
     369} 
     370 
     371HAL_BOOL ath_hal_hasbursting(struct ath_hal * ah) { 
     372    return (ath_hal_getcapability(ah, HAL_CAP_BURST, 0, NULL) == HAL_OK); 
     373} 
     374 
     375HAL_BOOL ath_hal_hascompression(struct ath_hal * ah) { 
     376    return (ath_hal_getcapability(ah, HAL_CAP_COMPRESSION, 0, NULL) == HAL_OK); 
     377} 
     378 
     379HAL_BOOL ath_hal_hasfastframes(struct ath_hal * ah) { 
     380    return (ath_hal_getcapability(ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK); 
     381} 
     382 
     383HAL_BOOL ath_hal_hasbssidmask(struct ath_hal * ah) { 
     384    return (ath_hal_getcapability(ah, HAL_CAP_BSSIDMASK, 0, NULL) == HAL_OK); 
     385} 
     386 
     387HAL_BOOL ath_hal_hasmcastkeysearch(struct ath_hal * ah) { 
     388    return (ath_hal_getcapability(ah, HAL_CAP_MCAST_KEYSRCH, 0, NULL) == HAL_OK); 
     389} 
     390 
     391HAL_BOOL ath_hal_getmcastkeysearch(struct ath_hal * ah) { 
     392    return (ath_hal_getcapability(ah, HAL_CAP_MCAST_KEYSRCH, 1, NULL) == HAL_OK); 
     393} 
     394 
     395HAL_BOOL ath_hal_hastkipmic(struct ath_hal * ah) { 
     396    return (ath_hal_getcapability(ah, HAL_CAP_TKIP_MIC, 0, NULL) == HAL_OK); 
     397} 
     398 
     399HAL_BOOL ath_hal_gettkipmic(struct ath_hal * ah) { 
     400    return (ath_hal_getcapability(ah, HAL_CAP_TKIP_MIC, 1, NULL) == HAL_OK); 
     401} 
     402 
     403HAL_BOOL ath_hal_settkipmic(struct ath_hal * ah, u_int32_t v) { 
     404    return ath_hal_setcapability(ah, HAL_CAP_TKIP_MIC, 1, v, NULL); 
     405} 
     406 
     407HAL_BOOL ath_hal_hastsfadjust(struct ath_hal * ah) { 
     408    return (ath_hal_getcapability(ah, HAL_CAP_TSF_ADJUST, 0, NULL) == HAL_OK); 
     409} 
     410 
     411HAL_BOOL ath_hal_gettsfadjust(struct ath_hal * ah) { 
     412    return (ath_hal_getcapability(ah, HAL_CAP_TSF_ADJUST, 1, NULL) == HAL_OK); 
     413} 
     414 
     415HAL_BOOL ath_hal_settsfadjust(struct ath_hal * ah, u_int32_t v) { 
     416    return ath_hal_setcapability(ah, HAL_CAP_TSF_ADJUST, 1, v, NULL); 
     417} 
     418 
     419HAL_BOOL ath_hal_setrfsilent(struct ath_hal * ah, u_int32_t v) { 
     420        return ath_hal_setcapability(ah, HAL_CAP_RFSILENT, 1, v, NULL); 
     421} 
     422 
     423HAL_BOOL ath_hal_hasrfsilent(struct ath_hal * ah) { 
     424    return (ath_hal_getcapability(ah, HAL_CAP_RFSILENT, 0, NULL) == HAL_OK); 
     425} 
     426 
     427HAL_BOOL ath_hal_setuprxdesc(struct ath_hal *ah, struct ath_desc *ds, u_int32_t size, u_int flags) { 
     428    return ((*ah->ah_setupRxDesc)(ah, (ds), (size), flags)); 
     429} 
     430 
     431HAL_BOOL ath_hal_rxprocdesc(struct ath_hal *ah, struct ath_desc *ds, u_int32_t dspa, struct ath_desc *dsnext, u_int64_t tsf, struct ath_rx_status *rs) { 
     432    return ((*ah->ah_procRxDesc)(ah, (ds), (dspa), (dsnext), (tsf), (rs))); 
     433} 
     434 
     435HAL_BOOL ath_hal_setuptxdesc(struct ath_hal *ah, struct ath_desc *ds, u_int plen, u_int hlen, HAL_PKT_TYPE atype, u_int txpow, u_int txr0, u_int txtr0, u_int keyix, u_int ant, u_int flags, u_int rtsrate, u_int rtsdura, u_int compicvlen, u_int compivlen, u_int comp) { 
     436    return ((*ah->ah_setupTxDesc)(ah, (ds), (plen), (hlen), (atype), (txpow), (txr0), (txtr0), (keyix), (ant), (flags), (rtsrate), (rtsdura), (compicvlen), (compivlen), (comp))); 
     437} 
     438HAL_BOOL ath_hal_setupxtxdesc(struct ath_hal * ah, struct ath_desc* ds, u_int txr1, u_int txtr1, u_int txr2, u_int txtr2, u_int txr3, u_int txtr3) { 
     439    return ((*ah->ah_setupXTxDesc)(ah, (ds), (txr1), (txtr1), (txr2), (txtr2), (txr3), (txtr3))); 
     440} 
     441HAL_BOOL ath_hal_filltxdesc(struct ath_hal * ah, struct ath_desc * ds, u_int l, HAL_BOOL first, HAL_BOOL last, const struct ath_desc * ds0) { 
     442    return ((*ah->ah_fillTxDesc)(ah, (ds), (l), (first), (last), (ds0))); 
     443} 
     444HAL_BOOL ath_hal_txprocdesc(struct ath_hal * ah, struct ath_desc *ds, struct ath_tx_status *ts) { 
     445    return ((*ah->ah_procTxDesc)(ah, (ds), (ts))); 
     446} 
     447void ath_hal_gettxintrtxqs(struct ath_hal *ah, u_int32_t *txqs) { 
     448    ((*ah->ah_getTxIntrQueue)(ah, (txqs))); 
     449} 
     450void ath_hal_txreqintrdesc(struct ath_hal * ah, struct ath_desc *ds) { 
     451    ((*ah->ah_reqTxIntrDesc)(ah, (ds))); 
     452} 
     453HAL_BOOL ath_hal_gpioCfgOutput(struct ath_hal * ah, u_int32_t gpio) { 
     454    return ((*ah->ah_gpioCfgOutput)(ah, (gpio))); 
     455} 
     456HAL_BOOL ath_hal_gpioset(struct ath_hal * ah, u_int32_t gpio, u_int32_t val) { 
     457    return ((*ah->ah_gpioSet)(ah, (gpio), val)); 
     458} 
     459void ath_hal_setcoverageclass(struct ath_hal * ah, u_int8_t coverageclass, int now) { 
     460    ((*ah->ah_setCoverageClass)(ah, (coverageclass), (now))); 
     461} 
     462HAL_BOOL ath_hal_radar_wait(struct ath_hal * ah, HAL_CHANNEL *chan) { 
     463    return ((*ah->ah_radarWait)(ah, (chan))); 
     464} 
     465int16_t ath_hal_get_channel_noise(struct ath_hal * ah, HAL_CHANNEL *chan) { 
     466    return ((*ah->ah_getChanNoise)(ah, (chan))); 
     467} 
     468 
     469HAL_BOOL ath_hal_set_regulatory_domain(struct ath_hal* ah, u_int16_t domain, HAL_STATUS* pstatus) { 
     470    return ((*ah->ah_setRegulatoryDomain)(ah, domain, pstatus)); 
     471    
     472} 
     473 
     474HAL_POWER_MODE ath_hal_getpower(struct ath_hal* ah) { 
     475    return ((*ah->ah_getPowerMode)(ah)); 
     476} 
     477 
     478HAL_BOOL ath_hal_set_multicast_filter_index(struct ath_hal* ah, u_int32_t index) { 
     479    return ((*ah->ah_setMulticastFilterIndex)(ah,index)); 
     480} 
     481 
     482HAL_BOOL ath_hal_clear_multicast_filter_index(struct ath_hal* ah, u_int32_t index) { 
     483    return ((*ah->ah_clrMulticastFilterIndex)(ah,index)); 
     484} 
     485 
     486HAL_BOOL ath_hal_gpioGet(struct ath_hal *ah, u_int32_t gpio) { 
     487    return ((*ah->ah_gpioGet)(ah,gpio)); 
     488} 
     489HAL_BOOL ath_hal_gpioCfgInput(struct ath_hal *ah, u_int32_t gpio) { 
     490    return ((*ah->ah_gpioCfgInput)(ah,gpio)); 
     491} 
     492void ath_hal_gpioSetIntr(struct ath_hal *ah, u_int p1, u_int32_t p2) { 
     493    ((*ah->ah_gpioSetIntr)(ah,p1,p2)); 
     494} 
     495 
     496HAL_BOOL ath_hal_detect_card_present(struct ath_hal* ah) { 
     497    return ((*ah->ah_detectCardPresent)(ah)); 
     498} 
     499 
     500void ath_hal_update_mib_counters(struct ath_hal* ah, HAL_MIB_STATS* stats) { 
     501    ((*ah->ah_updateMibCounters)(ah, stats)); 
     502} 
     503HAL_ANT_SETTING ath_hal_get_antenna_switch(struct ath_hal* ah) { 
     504     return ((*ah->ah_getAntennaSwitch)(ah)); 
     505} 
     506 
     507HAL_BOOL ath_hal_set_antenna_switch(struct ath_hal* ah, HAL_ANT_SETTING ant) { 
     508     return ((*ah->ah_setAntennaSwitch)(ah, ant)); 
     509} 
     510 
     511void ath_hal_set_beacon_timers(struct ath_hal* ah, const HAL_BEACON_TIMERS *timers) { 
     512     ((*ah->ah_setBeaconTimers)(ah, timers)); 
     513} 
     514EXPORT_SYMBOL(ath_hal_reset); 
     515EXPORT_SYMBOL(ath_hal_getratetable); 
     516EXPORT_SYMBOL(ath_hal_getmac); 
     517EXPORT_SYMBOL(ath_hal_setmac); 
     518EXPORT_SYMBOL(ath_hal_getbssidmask); 
     519EXPORT_SYMBOL(ath_hal_setbssidmask); 
     520EXPORT_SYMBOL(ath_hal_intrset); 
     521EXPORT_SYMBOL(ath_hal_intrget); 
     522EXPORT_SYMBOL(ath_hal_intrpend); 
     523EXPORT_SYMBOL(ath_hal_getisr); 
     524EXPORT_SYMBOL(ath_hal_updatetxtriglevel); 
     525EXPORT_SYMBOL(ath_hal_setpower); 
     526EXPORT_SYMBOL(ath_hal_keycachesize); 
     527EXPORT_SYMBOL(ath_hal_keyreset); 
     528EXPORT_SYMBOL(ath_hal_keyset); 
     529EXPORT_SYMBOL(ath_hal_keyisvalid); 
     530EXPORT_SYMBOL(ath_hal_keysetmac); 
     531EXPORT_SYMBOL(ath_hal_getrxfilter); 
     532EXPORT_SYMBOL(ath_hal_setrxfilter); 
     533EXPORT_SYMBOL(ath_hal_setmcastfilter); 
     534EXPORT_SYMBOL(ath_hal_putrxbuf); 
     535EXPORT_SYMBOL(ath_hal_gettsf32); 
     536EXPORT_SYMBOL(ath_hal_gettsf64); 
     537EXPORT_SYMBOL(ath_hal_resettsf); 
     538EXPORT_SYMBOL(ath_hal_rxena); 
     539EXPORT_SYMBOL(ath_hal_numtxpending); 
     540EXPORT_SYMBOL(ath_hal_puttxbuf); 
     541EXPORT_SYMBOL(ath_hal_gettxbuf); 
     542EXPORT_SYMBOL(ath_hal_getrxbuf); 
     543EXPORT_SYMBOL(ath_hal_txstart); 
     544EXPORT_SYMBOL(ath_hal_calibrate); 
     545EXPORT_SYMBOL(ath_hal_setledstate); 
     546EXPORT_SYMBOL(ath_hal_beaconinit); 
     547EXPORT_SYMBOL(ath_hal_beaconreset); 
     548EXPORT_SYMBOL(ath_hal_beacontimers); 
     549EXPORT_SYMBOL(ath_hal_setassocid); 
     550EXPORT_SYMBOL(ath_hal_phydisable); 
     551EXPORT_SYMBOL(ath_hal_setopmode); 
     552EXPORT_SYMBOL(ath_hal_stoptxdma); 
     553EXPORT_SYMBOL(ath_hal_stoppcurecv); 
     554EXPORT_SYMBOL(ath_hal_startpcurecv); 
     555EXPORT_SYMBOL(ath_hal_stopdmarecv); 
     556EXPORT_SYMBOL(ath_hal_getdiagstate); 
     557EXPORT_SYMBOL(ath_hal_gettxqueueprops); 
     558EXPORT_SYMBOL(ath_hal_settxqueueprops); 
     559EXPORT_SYMBOL(ath_hal_setuptxqueue); 
     560EXPORT_SYMBOL(ath_hal_resettxqueue); 
     561EXPORT_SYMBOL(ath_hal_releasetxqueue); 
     562EXPORT_SYMBOL(ath_hal_getrfgain); 
     563EXPORT_SYMBOL(ath_hal_getdefantenna); 
     564EXPORT_SYMBOL(ath_hal_setdefantenna); 
     565EXPORT_SYMBOL(ath_hal_rxmonitor); 
     566EXPORT_SYMBOL(ath_hal_mibevent); 
     567EXPORT_SYMBOL(ath_hal_setslottime); 
     568EXPORT_SYMBOL(ath_hal_getslottime); 
     569EXPORT_SYMBOL(ath_hal_setacktimeout); 
     570EXPORT_SYMBOL(ath_hal_getacktimeout); 
     571EXPORT_SYMBOL(ath_hal_setctstimeout); 
     572EXPORT_SYMBOL(ath_hal_getctstimeout); 
     573EXPORT_SYMBOL(ath_hal_setdecompmask); 
     574EXPORT_SYMBOL(ath_hal_getcapability); 
     575EXPORT_SYMBOL(ath_hal_setcapability); 
     576EXPORT_SYMBOL(ath_hal_ciphersupported); 
     577EXPORT_SYMBOL(ath_hal_fastframesupported); 
     578EXPORT_SYMBOL(ath_hal_burstsupported); 
     579EXPORT_SYMBOL(ath_hal_xrsupported); 
     580EXPORT_SYMBOL(ath_hal_compressionsupported); 
     581EXPORT_SYMBOL(ath_hal_turboagsupported); 
     582EXPORT_SYMBOL(ath_hal_halfrate_chansupported); 
     583EXPORT_SYMBOL(ath_hal_quarterrate_chansupported); 
     584EXPORT_SYMBOL(ath_hal_getregdomain); 
     585EXPORT_SYMBOL(ath_hal_getcountrycode); 
     586EXPORT_SYMBOL(ath_hal_hastkipsplit); 
     587EXPORT_SYMBOL(ath_hal_gettkipsplit); 
     588EXPORT_SYMBOL(ath_hal_settkipsplit); 
     589EXPORT_SYMBOL(ath_hal_wmetkipmic); 
     590EXPORT_SYMBOL(ath_hal_hwphycounters); 
     591EXPORT_SYMBOL(ath_hal_hasdiversity); 
     592EXPORT_SYMBOL(ath_hal_getdiversity); 
     593EXPORT_SYMBOL(ath_hal_setdiversity); 
     594EXPORT_SYMBOL(ath_hal_getnumtxqueues); 
     595EXPORT_SYMBOL(ath_hal_hasveol); 
     596EXPORT_SYMBOL(ath_hal_hastxpowlimit); 
     597EXPORT_SYMBOL(ath_hal_settxpowlimit); 
     598EXPORT_SYMBOL(ath_hal_gettxpowlimit); 
     599EXPORT_SYMBOL(ath_hal_getmaxtxpow); 
     600EXPORT_SYMBOL(ath_hal_gettpscale); 
     601EXPORT_SYMBOL(ath_hal_settpscale); 
     602EXPORT_SYMBOL(ath_hal_hastpc); 
     603EXPORT_SYMBOL(ath_hal_gettpc); 
     604EXPORT_SYMBOL(ath_hal_settpc); 
     605EXPORT_SYMBOL(ath_hal_hasbursting); 
     606EXPORT_SYMBOL(ath_hal_hascompression); 
     607EXPORT_SYMBOL(ath_hal_hasfastframes); 
     608EXPORT_SYMBOL(ath_hal_hasbssidmask); 
     609EXPORT_SYMBOL(ath_hal_hasmcastkeysearch); 
     610EXPORT_SYMBOL(ath_hal_getmcastkeysearch); 
     611EXPORT_SYMBOL(ath_hal_hastkipmic); 
     612EXPORT_SYMBOL(ath_hal_gettkipmic); 
     613EXPORT_SYMBOL(ath_hal_settkipmic); 
     614EXPORT_SYMBOL(ath_hal_hastsfadjust); 
     615EXPORT_SYMBOL(ath_hal_gettsfadjust); 
     616EXPORT_SYMBOL(ath_hal_settsfadjust); 
     617EXPORT_SYMBOL(ath_hal_setrfsilent); 
     618EXPORT_SYMBOL(ath_hal_hasrfsilent); 
     619EXPORT_SYMBOL(ath_hal_setuprxdesc); 
     620EXPORT_SYMBOL(ath_hal_rxprocdesc); 
     621EXPORT_SYMBOL(ath_hal_setuptxdesc); 
     622EXPORT_SYMBOL(ath_hal_setupxtxdesc); 
     623EXPORT_SYMBOL(ath_hal_filltxdesc); 
     624EXPORT_SYMBOL(ath_hal_txprocdesc); 
     625EXPORT_SYMBOL(ath_hal_gettxintrtxqs); 
     626EXPORT_SYMBOL(ath_hal_txreqintrdesc); 
     627EXPORT_SYMBOL(ath_hal_gpioCfgOutput); 
     628EXPORT_SYMBOL(ath_hal_gpioset); 
     629EXPORT_SYMBOL(ath_hal_setcoverageclass); 
     630EXPORT_SYMBOL(ath_hal_radar_wait); 
     631EXPORT_SYMBOL(ath_hal_get_channel_noise); 
     632EXPORT_SYMBOL(ath_hal_set_regulatory_domain); 
     633EXPORT_SYMBOL(ath_hal_getpower); 
     634EXPORT_SYMBOL(ath_hal_set_multicast_filter_index); 
     635EXPORT_SYMBOL(ath_hal_clear_multicast_filter_index); 
     636EXPORT_SYMBOL(ath_hal_gpioGet); 
     637EXPORT_SYMBOL(ath_hal_gpioCfgInput); 
     638EXPORT_SYMBOL(ath_hal_gpioSetIntr); 
     639EXPORT_SYMBOL(ath_hal_detect_card_present); 
     640EXPORT_SYMBOL(ath_hal_update_mib_counters); 
     641EXPORT_SYMBOL(ath_hal_get_antenna_switch); 
     642EXPORT_SYMBOL(ath_hal_set_antenna_switch); 
     643EXPORT_SYMBOL(ath_hal_set_beacon_timers); 
     644 
     645#endif /* #ifndef AH_HALOPS_FUNC */ 
  • madwifi/ath_hal/ath_hal_api.h

    old new  
     1/* 
     2 * Wrapper macros/functions for the binary HAL to comply with local coding convention. 
     3 *  
     4 * Provides function-style calling convention using either macros or wrapper functions for function pointers in the HAL. 
     5 *  
     6 * The typical convention is foo(hal,p1,p2,p3,...) turns into hal->foo(p1,p2,p3,...) where foo  
     7 * is a function pointer and a member of the struct ath_hal. 
     8 * 
     9 * The macros are faster, but the functions have the advantage that they show up unobfuscated in backtraces thus giving you a clue as to where in  
     10 * your code you went wrong in your use of the HAL. 
     11 *s 
     12 */ 
     13#ifndef _IF_ATH_HAL_H 
     14#define _IF_ATH_HAL_H 
     15 
     16#include "ah.h" 
     17 
     18#ifndef AH_HALOPS_FUNC 
     19/* 
     20 * HAL definitions to comply with local coding convention. 
     21 */ 
     22#define ath_hal_reset(_ah, _opmode, _chan, _outdoor, _pstatus) \ 
     23        ((*(_ah)->ah_reset)((_ah), (_opmode), (_chan), (_outdoor), (_pstatus))) 
     24#define ath_hal_getratetable(_ah, _mode) \ 
     25        ((*(_ah)->ah_getRateTable)((_ah), (_mode))) 
     26#define ath_hal_getmac(_ah, _mac) \ 
     27        ((*(_ah)->ah_getMacAddress)((_ah), (_mac))) 
     28#define ath_hal_setmac(_ah, _mac) \ 
     29        ((*(_ah)->ah_setMacAddress)((_ah), (_mac))) 
     30#define ath_hal_getbssidmask(_ah, _mask) \ 
     31        ((*(_ah)->ah_getBssIdMask)((_ah), (_mask))) 
     32#define ath_hal_setbssidmask(_ah, _mask) \ 
     33        ((*(_ah)->ah_setBssIdMask)((_ah), (_mask))) 
     34#define ath_hal_intrset(_ah, _mask) \ 
     35        ((*(_ah)->ah_setInterrupts)((_ah), (_mask))) 
     36#define ath_hal_intrget(_ah) \ 
     37        ((*(_ah)->ah_getInterrupts)((_ah))) 
     38#define ath_hal_intrpend(_ah) \ 
     39        ((*(_ah)->ah_isInterruptPending)((_ah))) 
     40#define ath_hal_getisr(_ah, _pmask) \ 
     41        ((*(_ah)->ah_getPendingInterrupts)((_ah), (_pmask))) 
     42#define ath_hal_updatetxtriglevel(_ah, _inc) \ 
     43        ((*(_ah)->ah_updateTxTrigLevel)((_ah), (_inc))) 
     44#define ath_hal_setpower(_ah, _mode) \ 
     45        ((*(_ah)->ah_setPowerMode)((_ah), (_mode), AH_TRUE)) 
     46#define ath_hal_keycachesize(_ah) \ 
     47        ((*(_ah)->ah_getKeyCacheSize)((_ah))) 
     48#define ath_hal_keyreset(_ah, _ix) \ 
     49        ((*(_ah)->ah_resetKeyCacheEntry)((_ah), (_ix))) 
     50#define ath_hal_keyset(_ah, _ix, _pk, _mac) \ 
     51        ((*(_ah)->ah_setKeyCacheEntry)((_ah), (_ix), (_pk), (_mac), AH_FALSE)) 
     52#define ath_hal_keyisvalid(_ah, _ix) \ 
     53        (((*(_ah)->ah_isKeyCacheEntryValid)((_ah), (_ix)))) 
     54#define ath_hal_keysetmac(_ah, _ix, _mac) \ 
     55        ((*(_ah)->ah_setKeyCacheEntryMac)((_ah), (_ix), (_mac))) 
     56#define ath_hal_getrxfilter(_ah) \ 
     57        ((*(_ah)->ah_getRxFilter)((_ah))) 
     58#define ath_hal_setrxfilter(_ah, _filter) \ 
     59        ((*(_ah)->ah_setRxFilter)((_ah), (_filter))) 
     60#define ath_hal_setmcastfilter(_ah, _mfilt0, _mfilt1) \ 
     61        ((*(_ah)->ah_setMulticastFilter)((_ah), (_mfilt0), (_mfilt1))) 
     62#define ath_hal_waitforbeacon(_ah, _bf) \ 
     63        ((*(_ah)->ah_waitForBeaconDone)((_ah), (_bf)->bf_daddr)) 
     64#define ath_hal_putrxbuf(_ah, _bufaddr) \ 
     65        ((*(_ah)->ah_setRxDP)((_ah), (_bufaddr))) 
     66#define ath_hal_gettsf32(_ah) \ 
     67        ((*(_ah)->ah_getTsf32)((_ah))) 
     68#define ath_hal_gettsf64(_ah) \ 
     69        ((*(_ah)->ah_getTsf64)((_ah))) 
     70#define ath_hal_resettsf(_ah) \ 
     71        ((*(_ah)->ah_resetTsf)((_ah))) 
     72#define ath_hal_rxena(_ah) \ 
     73        ((*(_ah)->ah_enableReceive)((_ah))) 
     74#define ath_hal_numtxpending(_ah, _q) \ 
     75        ((*(_ah)->ah_numTxPending)((_ah), (_q))) 
     76#define ath_hal_puttxbuf(_ah, _q, _bufaddr) \ 
     77        ((*(_ah)->ah_setTxDP)((_ah), (_q), (_bufaddr))) 
     78#define ath_hal_gettxbuf(_ah, _q) \ 
     79        ((*(_ah)->ah_getTxDP)((_ah), (_q))) 
     80#define ath_hal_getrxbuf(_ah) \ 
     81        ((*(_ah)->ah_getRxDP)((_ah))) 
     82#define ath_hal_txstart(_ah, _q) \ 
     83        ((*(_ah)->ah_startTxDma)((_ah), (_q))) 
     84#define ath_hal_setchannel(_ah, _chan) \ 
     85        ((*(_ah)->ah_setChannel)((_ah), (_chan))) 
     86#define ath_hal_calibrate(_ah, _chan, _isIQdone) \ 
     87        ((*(_ah)->ah_perCalibration)((_ah), (_chan), (_isIQdone))) 
     88#define ath_hal_setledstate(_ah, _state) \ 
     89        ((*(_ah)->ah_setLedState)((_ah), (_state))) 
     90#define ath_hal_beaconinit(_ah, _nextb, _bperiod) \ 
     91        ((*(_ah)->ah_beaconInit)((_ah), (_nextb), (_bperiod))) 
     92#define ath_hal_beaconreset(_ah) \ 
     93        ((*(_ah)->ah_resetStationBeaconTimers)((_ah))) 
     94#define ath_hal_beacontimers(_ah, _bs) \ 
     95        ((*(_ah)->ah_setStationBeaconTimers)((_ah), (_bs))) 
     96#define ath_hal_setassocid(_ah, _bss, _associd) \ 
     97        ((*(_ah)->ah_writeAssocid)((_ah), (_bss), (_associd))) 
     98#define ath_hal_phydisable(_ah) \ 
     99        ((*(_ah)->ah_phyDisable)((_ah))) 
     100#define ath_hal_setopmode(_ah) \ 
     101        ((*(_ah)->ah_setPCUConfig)((_ah))) 
     102#define ath_hal_stoptxdma(_ah, _qnum) \ 
     103        ((*(_ah)->ah_stopTxDma)((_ah), (_qnum))) 
     104#define ath_hal_stoppcurecv(_ah) \ 
     105        ((*(_ah)->ah_stopPcuReceive)((_ah))) 
     106#define ath_hal_startpcurecv(_ah) \ 
     107        ((*(_ah)->ah_startPcuReceive)((_ah))) 
     108#define ath_hal_stopdmarecv(_ah) \ 
     109        ((*(_ah)->ah_stopDmaReceive)((_ah))) 
     110#define ath_hal_getdiagstate(_ah, _id, _indata, _insize, _outdata, _outsize) \ 
     111        ((*(_ah)->ah_getDiagState)((_ah), (_id), \ 
     112                (_indata), (_insize), (_outdata), (_outsize))) 
     113#define ath_hal_gettxqueueprops(_ah, _q, _qi) \ 
     114        ((*(_ah)->ah_getTxQueueProps)((_ah), (_q), (_qi))) 
     115#define ath_hal_settxqueueprops(_ah, _q, _qi) \ 
     116        ((*(_ah)->ah_setTxQueueProps)((_ah), (_q), (_qi))) 
     117#define ath_hal_setuptxqueue(_ah, _type, _irq) \ 
     118        ((*(_ah)->ah_setupTxQueue)((_ah), (_type), (_irq))) 
     119#define ath_hal_resettxqueue(_ah, _q) \ 
     120        ((*(_ah)->ah_resetTxQueue)((_ah), (_q))) 
     121#define ath_hal_releasetxqueue(_ah, _q) \ 
     122        ((*(_ah)->ah_releaseTxQueue)((_ah), (_q))) 
     123#define ath_hal_getrfgain(_ah) \ 
     124        ((*(_ah)->ah_getRfGain)((_ah))) 
     125#define ath_hal_getdefantenna(_ah) \ 
     126        ((*(_ah)->ah_getDefAntenna)((_ah))) 
     127#define ath_hal_setdefantenna(_ah, _ant) \ 
     128        ((*(_ah)->ah_setDefAntenna)((_ah), (_ant))) 
     129#define ath_hal_rxmonitor(_ah, _arg, _chan) \ 
     130        ((*(_ah)->ah_rxMonitor)((_ah), (_arg), (_chan))) 
     131#define ath_hal_mibevent(_ah, _stats) \ 
     132        ((*(_ah)->ah_procMibEvent)((_ah), (_stats))) 
     133#define ath_hal_setslottime(_ah, _us) \ 
     134        ((*(_ah)->ah_setSlotTime)((_ah), (_us))) 
     135#define ath_hal_getslottime(_ah) \ 
     136        ((*(_ah)->ah_getSlotTime)((_ah))) 
     137#define ath_hal_setacktimeout(_ah, _us) \ 
     138        ((*(_ah)->ah_setAckTimeout)((_ah), (_us))) 
     139#define ath_hal_getacktimeout(_ah) \ 
     140        ((*(_ah)->ah_getAckTimeout)((_ah))) 
     141#define ath_hal_setctstimeout(_ah, _us) \ 
     142        ((*(_ah)->ah_setCTSTimeout)((_ah), (_us))) 
     143#define ath_hal_getctstimeout(_ah) \ 
     144        ((*(_ah)->ah_getCTSTimeout)((_ah))) 
     145#define ath_hal_setdecompmask(_ah, _keyid, _b) \ 
     146        ((*(_ah)->ah_setDecompMask)((_ah), (_keyid), (_b))) 
     147#define ath_hal_enablePhyDiag(_ah) \ 
     148        ((*(_ah)->ah_enablePhyErrDiag)((_ah))) 
     149#define ath_hal_disablePhyDiag(_ah) \ 
     150        ((*(_ah)->ah_disablePhyErrDiag)((_ah))) 
     151#define ath_hal_getcapability(_ah, _cap, _param, _result) \ 
     152        ((*(_ah)->ah_getCapability)((_ah), (_cap), (_param), (_result))) 
     153#define ath_hal_setcapability(_ah, _cap, _param, _v, _status) \ 
     154        ((*(_ah)->ah_setCapability)((_ah), (_cap), (_param), (_v), (_status))) 
     155#define ath_hal_ciphersupported(_ah, _cipher) \ 
     156        (ath_hal_getcapability(_ah, HAL_CAP_CIPHER, _cipher, NULL) == HAL_OK) 
     157#define ath_hal_fastframesupported(_ah) \ 
     158        (ath_hal_getcapability(_ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK) 
     159#define ath_hal_burstsupported(_ah) \ 
     160        (ath_hal_getcapability(_ah, HAL_CAP_BURST, 0, NULL) == HAL_OK) 
     161#define ath_hal_xrsupported(_ah) \ 
     162        (ath_hal_getcapability(_ah, HAL_CAP_XR, 0, NULL) == HAL_OK) 
     163#define ath_hal_compressionsupported(_ah) \ 
     164        (ath_hal_getcapability(_ah, HAL_CAP_COMPRESSION, 0, NULL) == HAL_OK) 
     165#define ath_hal_turboagsupported(_ah, _countrycode) \ 
     166        (ath_hal_getwirelessmodes(_ah, _countrycode) & (HAL_MODE_108G|HAL_MODE_TURBO)) 
     167#define ath_hal_halfrate_chansupported(_ah) \ 
     168        (ath_hal_getcapability(_ah, HAL_CAP_CHAN_HALFRATE, 0, NULL) == HAL_OK) 
     169#define ath_hal_quarterrate_chansupported(_ah) \ 
     170        (ath_hal_getcapability(_ah, HAL_CAP_CHAN_QUARTERRATE, 0, NULL) == HAL_OK) 
     171#define ath_hal_getregdomain(_ah, _prd) \ 
     172        ath_hal_getcapability(_ah, HAL_CAP_REG_DMN, 0, (_prd)) 
     173#define ath_hal_getcountrycode(_ah, _pcc) \ 
     174        (*(_pcc) = (_ah)->ah_countryCode) 
     175#define ath_hal_hastkipsplit(_ah) \ 
     176        (ath_hal_getcapability(_ah, HAL_CAP_TKIP_SPLIT, 0, NULL) == HAL_OK) 
     177#define ath_hal_gettkipsplit(_ah) \ 
     178        (ath_hal_getcapability(_ah, HAL_CAP_TKIP_SPLIT, 1, NULL) == HAL_OK) 
     179#define ath_hal_settkipsplit(_ah, _v) \ 
     180        ath_hal_setcapability(_ah, HAL_CAP_TKIP_SPLIT, 1, _v, NULL) 
     181#define ath_hal_wmetkipmic(_ah) \ 
     182        (ath_hal_getcapability(_ah, HAL_CAP_WME_TKIPMIC, 0, NULL) == HAL_OK) 
     183#define ath_hal_hwphycounters(_ah) \ 
     184        (ath_hal_getcapability(_ah, HAL_CAP_PHYCOUNTERS, 0, NULL) == HAL_OK) 
     185#define ath_hal_hasdiversity(_ah) \ 
     186        (ath_hal_getcapability(_ah, HAL_CAP_DIVERSITY, 0, NULL) == HAL_OK) 
     187#define ath_hal_getdiversity(_ah) \ 
     188        (ath_hal_getcapability(_ah, HAL_CAP_DIVERSITY, 1, NULL) == HAL_OK) 
     189#define ath_hal_setdiversity(_ah, _v) \ 
     190        ath_hal_setcapability(_ah, HAL_CAP_DIVERSITY, 1, _v, NULL) 
     191#define ath_hal_getnumtxqueues(_ah, _pv) \ 
     192        (ath_hal_getcapability(_ah, HAL_CAP_NUM_TXQUEUES, 0, _pv) == HAL_OK) 
     193#define ath_hal_hasveol(_ah) \ 
     194        (ath_hal_getcapability(_ah, HAL_CAP_VEOL, 0, NULL) == HAL_OK) 
     195#define ath_hal_hastxpowlimit(_ah) \ 
     196        (ath_hal_getcapability(_ah, HAL_CAP_TXPOW, 0, NULL) == HAL_OK) 
     197#define ath_hal_settxpowlimit(_ah, _pow) \ 
     198        ((*(_ah)->ah_setTxPowerLimit)((_ah), (_pow))) 
     199#define ath_hal_gettxpowlimit(_ah, _ppow) \ 
     200        (ath_hal_getcapability(_ah, HAL_CAP_TXPOW, 1, _ppow) == HAL_OK) 
     201#define ath_hal_getmaxtxpow(_ah, _ppow) \ 
     202        (ath_hal_getcapability(_ah, HAL_CAP_TXPOW, 2, _ppow) == HAL_OK) 
     203#define ath_hal_gettpscale(_ah, _scale) \ 
     204        (ath_hal_getcapability(_ah, HAL_CAP_TXPOW, 3, _scale) == HAL_OK) 
     205#define ath_hal_settpscale(_ah, _v) \ 
     206        ath_hal_setcapability(_ah, HAL_CAP_TXPOW, 3, _v, NULL) 
     207#define ath_hal_hastpc(_ah) \ 
     208        (ath_hal_getcapability(_ah, HAL_CAP_TPC, 0, NULL) == HAL_OK) 
     209#define ath_hal_gettpc(_ah) \ 
     210        (ath_hal_getcapability(_ah, HAL_CAP_TPC, 1, NULL) == HAL_OK) 
     211#define ath_hal_settpc(_ah, _v) \ 
     212        ath_hal_setcapability(_ah, HAL_CAP_TPC, 1, _v, NULL) 
     213#define ath_hal_hasbursting(_ah) \ 
     214        (ath_hal_getcapability(_ah, HAL_CAP_BURST, 0, NULL) == HAL_OK) 
     215#define ath_hal_hascompression(_ah) \ 
     216        (ath_hal_getcapability(_ah, HAL_CAP_COMPRESSION, 0, NULL) == HAL_OK) 
     217#define ath_hal_hasfastframes(_ah) \ 
     218        (ath_hal_getcapability(_ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK) 
     219#define ath_hal_hasbssidmask(_ah) \ 
     220        (ath_hal_getcapability(_ah, HAL_CAP_BSSIDMASK, 0, NULL) == HAL_OK) 
     221#define ath_hal_hasmcastkeysearch(_ah) \ 
     222        (ath_hal_getcapability(_ah, HAL_CAP_MCAST_KEYSRCH, 0, NULL) == HAL_OK) 
     223#define ath_hal_getmcastkeysearch(_ah) \ 
     224        (ath_hal_getcapability(_ah, HAL_CAP_MCAST_KEYSRCH, 1, NULL) == HAL_OK) 
     225#define ath_hal_hastkipmic(_ah) \ 
     226        (ath_hal_getcapability(_ah, HAL_CAP_TKIP_MIC, 0, NULL) == HAL_OK) 
     227#define ath_hal_gettkipmic(_ah) \ 
     228        (ath_hal_getcapability(_ah, HAL_CAP_TKIP_MIC, 1, NULL) == HAL_OK) 
     229#define ath_hal_settkipmic(_ah, _v) \ 
     230        ath_hal_setcapability(_ah, HAL_CAP_TKIP_MIC, 1, _v, NULL) 
     231#define ath_hal_hastsfadjust(_ah) \ 
     232        (ath_hal_getcapability(_ah, HAL_CAP_TSF_ADJUST, 0, NULL) == HAL_OK) 
     233#define ath_hal_gettsfadjust(_ah) \ 
     234        (ath_hal_getcapability(_ah, HAL_CAP_TSF_ADJUST, 1, NULL) == HAL_OK) 
     235#define ath_hal_settsfadjust(_ah, _v) \ 
     236        ath_hal_setcapability(_ah, HAL_CAP_TSF_ADJUST, 1, _v, NULL) 
     237#define ath_hal_setrfsilent(_ah, _v) \ 
     238        ath_hal_setcapability(_ah, HAL_CAP_RFSILENT, 1, _v, NULL) 
     239#define ath_hal_hasrfsilent(_ah) \ 
     240        (ath_hal_getcapability(_ah, HAL_CAP_RFSILENT, 0, NULL) == HAL_OK) 
     241 
     242#define ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \ 
     243        ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) 
     244#define ath_hal_rxprocdesc(_ah, _ds, _dspa, _dsnext, _tsf, _rs) \ 
     245        ((*(_ah)->ah_procRxDesc)((_ah), (_ds), (_dspa), (_dsnext), (_tsf), (_rs))) 
     246#define ath_hal_updateCTSForBursting(_ah, _ds, _prevds, _prevdsWithCTS, _gatingds,    \ 
     247                                     _txOpLimit, _ctsDuration)                        \ 
     248        ((*(_ah)->ah_updateCTSForBursting)((_ah), (_ds), (_prevds), (_prevdsWithCTS), \ 
     249                                           (_gatingds), (_txOpLimit), (_ctsDuration))) 
     250#define ath_hal_setuptxdesc(_ah, _ds, _plen, _hlen, _atype, _txpow, \ 
     251                _txr0, _txtr0, _keyix, _ant, _flags, \ 
     252                _rtsrate, _rtsdura, \ 
     253                _compicvlen, _compivlen, _comp) \ 
     254        ((*(_ah)->ah_setupTxDesc)((_ah), (_ds), (_plen), (_hlen), (_atype), \ 
     255                (_txpow), (_txr0), (_txtr0), (_keyix), (_ant), \ 
     256                (_flags), (_rtsrate), (_rtsdura), \ 
     257                (_compicvlen), (_compivlen), (_comp))) 
     258#define ath_hal_setupxtxdesc(_ah, _ds, \ 
     259                _txr1, _txtr1, _txr2, _txtr2, _txr3, _txtr3) \ 
     260        ((*(_ah)->ah_setupXTxDesc)((_ah), (_ds), \ 
     261                (_txr1), (_txtr1), (_txr2), (_txtr2), (_txr3), (_txtr3))) 
     262#define ath_hal_filltxdesc(_ah, _ds, _l, _first, _last, _ds0) \ 
     263        ((*(_ah)->ah_fillTxDesc)((_ah), (_ds), (_l), (_first), (_last), (_ds0))) 
     264#define ath_hal_txprocdesc(_ah, _ds, _ts) \ 
     265        ((*(_ah)->ah_procTxDesc)((_ah), (_ds), (_ts))) 
     266#define ath_hal_gettxintrtxqs(_ah, _txqs) \ 
     267        ((*(_ah)->ah_getTxIntrQueue)((_ah), (_txqs))) 
     268#define ath_hal_txreqintrdesc(_ah, _ds) \ 
     269        ((*(_ah)->ah_reqTxIntrDesc)((_ah), (_ds))) 
     270 
     271#define ath_hal_gpioCfgOutput(_ah, _gpio) \ 
     272        ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio))) 
     273#define ath_hal_gpioset(_ah, _gpio, _b) \ 
     274        ((*(_ah)->ah_gpioSet)((_ah), (_gpio), (_b))) 
     275#define ath_hal_setcoverageclass(_ah, _coverageclass, _now) \ 
     276        ((*(_ah)->ah_setCoverageClass)((_ah), (_coverageclass), (_now))) 
     277#define ath_hal_radar_wait(_ah, _chan) \ 
     278        ((*(_ah)->ah_radarWait)((_ah), (_chan))) 
     279#define ath_hal_get_channel_noise(_ah, _chan) \ 
     280        ((*(_ah)->ah_getChanNoise)((_ah), (_chan))) 
     281 
     282#else // if AH_HALOPS_FUNC 
     283 
     284HAL_BOOL ath_hal_reset(struct ath_hal* ah, HAL_OPMODE opmode, HAL_CHANNEL* chan,  HAL_BOOL outdoor, HAL_STATUS* pstatus); 
     285const HAL_RATE_TABLE* ath_hal_getratetable(struct ath_hal* ah, u_int mode); 
     286void ath_hal_getmac(struct ath_hal* ah, u_int8_t* mac); 
     287HAL_BOOL ath_hal_setmac(struct ath_hal* ah, const u_int8_t* mac); 
     288void ath_hal_getbssidmask(struct ath_hal * ah, u_int8_t * mask); 
     289HAL_BOOL ath_hal_setbssidmask(struct ath_hal * ah, const u_int8_t* mask); 
     290HAL_INT ath_hal_intrset(struct ath_hal* ah, HAL_INT mask); 
     291HAL_INT ath_hal_intrget(struct ath_hal* ah); 
     292HAL_BOOL ath_hal_intrpend(struct ath_hal* ah); 
     293HAL_BOOL ath_hal_getisr(struct ath_hal* ah, HAL_INT* pmask); 
     294HAL_BOOL ath_hal_updatetxtriglevel(struct ath_hal* ah, HAL_BOOL inc); 
     295HAL_BOOL ath_hal_setpower(struct ath_hal* ah, HAL_POWER_MODE mode); 
     296u_int32_t ath_hal_keycachesize(struct ath_hal* ah); 
     297HAL_BOOL ath_hal_keyreset(struct ath_hal* ah, u_int16_t ix); 
     298HAL_BOOL ath_hal_keyset(struct ath_hal* ah, u_int16_t ix, const HAL_KEYVAL * pk, const u_int8_t * mac); 
     299HAL_BOOL ath_hal_keyisvalid(struct ath_hal *ah, u_int16_t ix); 
     300HAL_BOOL ath_hal_keysetmac(struct ath_hal* ah, u_int16_t ix, const u_int8_t *mac); 
     301u_int32_t ath_hal_getrxfilter(struct ath_hal* ah); 
     302void ath_hal_setrxfilter(struct ath_hal* ah, u_int32_t filter); 
     303void ath_hal_setmcastfilter(struct ath_hal* ah, u_int32_t mfilt0, u_int32_t mfilt1); 
     304void ath_hal_putrxbuf(struct ath_hal* ah, u_int32_t bufaddr); 
     305u_int32_t ath_hal_gettsf32(struct ath_hal* ah); 
     306u_int64_t ath_hal_gettsf64(struct ath_hal* ah); 
     307void ath_hal_resettsf(struct ath_hal* ah); 
     308void ath_hal_rxena(struct ath_hal* ah); 
     309u_int32_t ath_hal_numtxpending(struct ath_hal *hal, u_int q); 
     310HAL_BOOL ath_hal_puttxbuf(struct ath_hal* ah, u_int q, u_int32_t bufaddr); 
     311u_int32_t ath_hal_gettxbuf(struct ath_hal* ah, u_int q); 
     312u_int32_t ath_hal_getrxbuf(struct ath_hal* ah); 
     313HAL_BOOL ath_hal_txstart(struct ath_hal* ah, u_int q); 
     314HAL_BOOL ath_hal_calibrate(struct ath_hal* ah, HAL_CHANNEL * chan, HAL_BOOL * isIQdone); 
     315void ath_hal_setledstate(struct ath_hal* ah, HAL_LED_STATE state); 
     316void ath_hal_beaconinit(struct ath_hal * ah, u_int32_t nextb, u_int32_t bperiod); 
     317void ath_hal_beaconreset(struct ath_hal* ah); 
     318void ath_hal_beacontimers(struct ath_hal* ah, const HAL_BEACON_STATE *bs); 
     319void ath_hal_setassocid(struct ath_hal* ah, const u_int8_t *bss, u_int16_t associd); 
     320HAL_BOOL ath_hal_phydisable(struct ath_hal * ah); 
     321void ath_hal_setopmode(struct ath_hal * ah); 
     322HAL_BOOL ath_hal_stoptxdma(struct ath_hal* ah, u_int q); 
     323void ath_hal_stoppcurecv(struct ath_hal* ah); 
     324void ath_hal_startpcurecv(struct ath_hal* ah); 
     325HAL_BOOL ath_hal_stopdmarecv(struct ath_hal* ah); 
     326HAL_BOOL ath_hal_getdiagstate(struct ath_hal *ah, int id, const void *indata, u_int32_t insize, void** outdata, u_int32_t* outsize); 
     327HAL_BOOL ath_hal_gettxqueueprops(struct ath_hal * ah, int q, HAL_TXQ_INFO *qi); 
     328HAL_BOOL ath_hal_settxqueueprops(struct ath_hal *ah, int q, const HAL_TXQ_INFO *qi); 
     329int     ath_hal_setuptxqueue(struct ath_hal * ah, HAL_TX_QUEUE type, const HAL_TXQ_INFO * qi); 
     330HAL_BOOL ath_hal_resettxqueue(struct ath_hal *ah, u_int q); 
     331HAL_BOOL ath_hal_releasetxqueue(struct ath_hal *ah, u_int q); 
     332HAL_RFGAIN ath_hal_getrfgain(struct ath_hal* ah); 
     333u_int ath_hal_getdefantenna(struct ath_hal* ah); 
     334void ath_hal_setdefantenna(struct ath_hal* ah, u_int ant); 
     335void ath_hal_rxmonitor(struct ath_hal* ah, const HAL_NODE_STATS *stats, HAL_CHANNEL *chan); 
     336void ath_hal_mibevent(struct ath_hal * ah, const HAL_NODE_STATS *stats); 
     337HAL_BOOL ath_hal_setslottime(struct ath_hal* ah, u_int us); 
     338u_int ath_hal_getslottime(struct ath_hal* ah); 
     339HAL_BOOL ath_hal_setacktimeout(struct ath_hal* ah, u_int us); 
     340u_int ath_hal_getacktimeout(struct ath_hal* ah); 
     341HAL_BOOL ath_hal_setctstimeout(struct ath_hal* ah, u_int us); 
     342u_int ath_hal_getctstimeout(struct ath_hal* ah); 
     343HAL_BOOL ath_hal_setdecompmask(struct ath_hal* ah, u_int16_t keyid, int b); 
     344HAL_STATUS ath_hal_getcapability(struct ath_hal * ah, HAL_CAPABILITY_TYPE type, u_int32_t capability, u_int32_t *result); 
     345HAL_BOOL ath_hal_setcapability(struct ath_hal * ah, HAL_CAPABILITY_TYPE type, u_int32_t capability, u_int32_t setting, HAL_STATUS *status); 
     346HAL_BOOL ath_hal_ciphersupported(struct ath_hal * ah, u_int32_t cipher); 
     347HAL_BOOL ath_hal_fastframesupported(struct ath_hal * ah); 
     348HAL_BOOL ath_hal_burstsupported(struct ath_hal * ah); 
     349HAL_BOOL ath_hal_xrsupported(struct ath_hal * ah); 
     350HAL_BOOL ath_hal_compressionsupported(struct ath_hal * ah); 
     351HAL_BOOL ath_hal_turboagsupported(struct ath_hal * ah, int countrycode); 
     352HAL_BOOL ath_hal_halfrate_chansupported(struct ath_hal * ah); 
     353HAL_BOOL ath_hal_quarterrate_chansupported(struct ath_hal * ah); 
     354HAL_BOOL ath_hal_getregdomain(struct ath_hal * ah, u_int32_t* destination); 
     355HAL_BOOL ath_hal_getcountrycode(struct ath_hal * ah, u_int32_t* destination); 
     356HAL_BOOL ath_hal_hastkipsplit(struct ath_hal * ah); 
     357HAL_BOOL ath_hal_gettkipsplit(struct ath_hal * ah); 
     358HAL_BOOL ath_hal_settkipsplit(struct ath_hal * ah, int v); 
     359HAL_BOOL ath_hal_wmetkipmic(struct ath_hal * ah); 
     360HAL_BOOL ath_hal_hwphycounters(struct ath_hal * ah); 
     361HAL_BOOL ath_hal_hasdiversity(struct ath_hal * ah); 
     362HAL_BOOL ath_hal_getdiversity(struct ath_hal * ah); 
     363HAL_BOOL ath_hal_setdiversity(struct ath_hal * ah, int v); 
     364HAL_BOOL ath_hal_getnumtxqueues(struct ath_hal * ah, u_int32_t* destination); 
     365HAL_BOOL ath_hal_hasveol(struct ath_hal * ah); 
     366HAL_BOOL ath_hal_hastxpowlimit(struct ath_hal * ah); 
     367HAL_BOOL ath_hal_settxpowlimit(struct ath_hal * ah, u_int32_t power); 
     368HAL_BOOL ath_hal_gettxpowlimit(struct ath_hal * ah, u_int32_t* destination); 
     369HAL_BOOL ath_hal_getmaxtxpow(struct ath_hal * ah, u_int32_t* destination); 
     370HAL_BOOL ath_hal_gettpscale(struct ath_hal * ah, u_int32_t* destination); 
     371HAL_BOOL ath_hal_settpscale(struct ath_hal * ah, u_int32_t v); 
     372HAL_BOOL ath_hal_hastpc(struct ath_hal * ah); 
     373HAL_BOOL ath_hal_gettpc(struct ath_hal * ah); 
     374HAL_BOOL ath_hal_settpc(struct ath_hal * ah, u_int32_t v); 
     375HAL_BOOL ath_hal_hasbursting(struct ath_hal * ah); 
     376HAL_BOOL ath_hal_hascompression(struct ath_hal * ah); 
     377HAL_BOOL ath_hal_hasfastframes(struct ath_hal * ah); 
     378HAL_BOOL ath_hal_hasbssidmask(struct ath_hal * ah); 
     379HAL_BOOL ath_hal_hasmcastkeysearch(struct ath_hal * ah); 
     380HAL_BOOL ath_hal_getmcastkeysearch(struct ath_hal * ah); 
     381HAL_BOOL ath_hal_hastkipmic(struct ath_hal * ah); 
     382HAL_BOOL ath_hal_gettkipmic(struct ath_hal * ah); 
     383HAL_BOOL ath_hal_settkipmic(struct ath_hal * ah, u_int32_t v); 
     384HAL_BOOL ath_hal_hastsfadjust(struct ath_hal * ah); 
     385HAL_BOOL ath_hal_gettsfadjust(struct ath_hal * ah); 
     386HAL_BOOL ath_hal_settsfadjust(struct ath_hal * ah, u_int32_t v); 
     387HAL_BOOL ath_hal_setrfsilent(struct ath_hal * ah, u_int32_t v); 
     388HAL_BOOL ath_hal_hasrfsilent(struct ath_hal * ah); 
     389HAL_BOOL ath_hal_setuprxdesc(struct ath_hal *ah, struct ath_desc *ds, u_int32_t size, u_int flags); 
     390HAL_BOOL ath_hal_rxprocdesc(struct ath_hal *ah, struct ath_desc *ds, u_int32_t dspa, struct ath_desc *dsnext, u_int64_t tsf, struct ath_rx_status *rs); 
     391HAL_BOOL ath_hal_setuptxdesc(struct ath_hal *ah, struct ath_desc *ds, u_int plen, u_int hlen, HAL_PKT_TYPE atype, u_int txpow, u_int txr0, u_int txtr0, u_int keyix, u_int ant, u_int flags, u_int rtsrate, u_int rtsdura, u_int compicvlen, u_int compivlen, u_int comp); 
     392HAL_BOOL ath_hal_setupxtxdesc(struct ath_hal * ah, struct ath_desc* ds, u_int txr1, u_int txtr1, u_int txr2, u_int txtr2, u_int txr3, u_int txtr3); 
     393HAL_BOOL ath_hal_filltxdesc(struct ath_hal * ah, struct ath_desc * ds, u_int l, HAL_BOOL first, HAL_BOOL last, const struct ath_desc * ds0); 
     394HAL_BOOL ath_hal_txprocdesc(struct ath_hal * ah, struct ath_desc *ds, struct ath_tx_status *ts); 
     395void ath_hal_gettxintrtxqs(struct ath_hal *ah, u_int32_t *txqs); 
     396void ath_hal_txreqintrdesc(struct ath_hal * ah, struct ath_desc *ds); 
     397HAL_BOOL ath_hal_gpioCfgOutput(struct ath_hal * ah, u_int32_t gpio); 
     398HAL_BOOL ath_hal_gpioset(struct ath_hal * ah, u_int32_t gpio, u_int32_t val); 
     399void ath_hal_setcoverageclass(struct ath_hal * ah, u_int8_t coverageclass, int now); 
     400HAL_BOOL ath_hal_radar_wait(struct ath_hal * ah, HAL_CHANNEL *chan); 
     401int16_t ath_hal_get_channel_noise(struct ath_hal * ah, HAL_CHANNEL *chan); 
     402HAL_BOOL ath_hal_set_regulatory_domain(struct ath_hal* ah, u_int16_t domain, HAL_STATUS* pstatus); 
     403HAL_POWER_MODE ath_hal_getpower(struct ath_hal* ah); 
     404HAL_BOOL ath_hal_set_multicast_filter_index(struct ath_hal* ah, u_int32_t index); 
     405HAL_BOOL ath_hal_clear_multicast_filter_index(struct ath_hal* ah, u_int32_t index); 
     406HAL_BOOL ath_hal_gpioGet(struct ath_hal *ah, u_int32_t gpio); 
     407HAL_BOOL ath_hal_gpioCfgInput(struct ath_hal *ah, u_int32_t gpio); 
     408void ath_hal_gpioSetIntr(struct ath_hal *ah, u_int p1, u_int32_t p2); 
     409HAL_BOOL ath_hal_detect_card_present(struct ath_hal* ah); 
     410void ath_hal_update_mib_counters(struct ath_hal* ah, HAL_MIB_STATS* stats); 
     411HAL_ANT_SETTING ath_hal_get_antenna_switch(struct ath_hal* ah); 
     412HAL_BOOL ath_hal_set_antenna_switch(struct ath_hal* ah, HAL_ANT_SETTING ant); 
     413void ath_hal_set_beacon_timers(struct ath_hal* ah, const HAL_BEACON_TIMERS *timers); 
     414 
     415#endif /* #ifndef AH_HALOPS_FUNC */ 
     416 
     417#endif /* _IF_ATH_HAL_H */ 
     418 
  • madwifi/ath_hal/Makefile

    old new  
    4949include $(TOP)/Makefile.inc 
    5050 
    5151obj-m           += ath_hal.o 
    52 ath_hal-objs    := ah_os.o $(TARGET).hal.o 
     52ath_hal-objs    := ah_os.o ath_hal_api.o $(TARGET).hal.o 
    5353 
    5454hostprogs-y     := uudecode 
    5555 
  • madwifi/ath/if_athvar.h

    old new  
    744767void ath_sysctl_register(void); 
    745768void ath_sysctl_unregister(void); 
    746769 
    747 /* 
    748  * HAL definitions to comply with local coding convention. 
    749  */ 
    750 #define ath_hal_reset(_ah, _opmode, _chan, _outdoor, _pstatus) \ 
    751         ((*(_ah)->ah_reset)((_ah), (_opmode), (_chan), (_outdoor), (_pstatus))) 
    752 #define ath_hal_getratetable(_ah, _mode) \ 
    753         ((*(_ah)->ah_getRateTable)((_ah), (_mode))) 
    754 #define ath_hal_getmac(_ah, _mac) \ 
    755         ((*(_ah)->ah_getMacAddress)((_ah), (_mac))) 
    756 #define ath_hal_setmac(_ah, _mac) \ 
    757         ((*(_ah)->ah_setMacAddress)((_ah), (_mac))) 
    758 #define ath_hal_getbssidmask(_ah, _mask) \ 
    759         ((*(_ah)->ah_getBssIdMask)((_ah), (_mask))) 
    760 #define ath_hal_setbssidmask(_ah, _mask) \ 
    761         ((*(_ah)->ah_setBssIdMask)((_ah), (_mask))) 
    762 #define ath_hal_intrset(_ah, _mask) \ 
    763         ((*(_ah)->ah_setInterrupts)((_ah), (_mask))) 
    764 #define ath_hal_intrget(_ah) \ 
    765         ((*(_ah)->ah_getInterrupts)((_ah))) 
    766 #define ath_hal_intrpend(_ah) \ 
    767         ((*(_ah)->ah_isInterruptPending)((_ah))) 
    768 #define ath_hal_getisr(_ah, _pmask) \ 
    769         ((*(_ah)->ah_getPendingInterrupts)((_ah), (_pmask))) 
    770 #define ath_hal_updatetxtriglevel(_ah, _inc) \ 
    771         ((*(_ah)->ah_updateTxTrigLevel)((_ah), (_inc))) 
    772 #define ath_hal_setpower(_ah, _mode) \ 
    773         ((*(_ah)->ah_setPowerMode)((_ah), (_mode), AH_TRUE)) 
    774 #define ath_hal_keycachesize(_ah) \ 
    775         ((*(_ah)->ah_getKeyCacheSize)((_ah))) 
    776 #define ath_hal_keyreset(_ah, _ix) \ 
    777         ((*(_ah)->ah_resetKeyCacheEntry)((_ah), (_ix))) 
    778 #define ath_hal_keyset(_ah, _ix, _pk, _mac) \ 
    779         ((*(_ah)->ah_setKeyCacheEntry)((_ah), (_ix), (_pk), (_mac), AH_FALSE)) 
    780 #define ath_hal_keyisvalid(_ah, _ix) \ 
    781         (((*(_ah)->ah_isKeyCacheEntryValid)((_ah), (_ix)))) 
    782 #define ath_hal_keysetmac(_ah, _ix, _mac) \ 
    783         ((*(_ah)->ah_setKeyCacheEntryMac)((_ah), (_ix), (_mac))) 
    784 #define ath_hal_getrxfilter(_ah) \ 
    785         ((*(_ah)->ah_getRxFilter)((_ah))) 
    786 #define ath_hal_setrxfilter(_ah, _filter) \ 
    787         ((*(_ah)->ah_setRxFilter)((_ah), (_filter))) 
    788 #define ath_hal_setmcastfilter(_ah, _mfilt0, _mfilt1) \ 
    789         ((*(_ah)->ah_setMulticastFilter)((_ah), (_mfilt0), (_mfilt1))) 
    790 #define ath_hal_waitforbeacon(_ah, _bf) \ 
    791         ((*(_ah)->ah_waitForBeaconDone)((_ah), (_bf)->bf_daddr)) 
    792 #define ath_hal_putrxbuf(_ah, _bufaddr) \ 
    793         ((*(_ah)->ah_setRxDP)((_ah), (_bufaddr))) 
    794 #define ath_hal_gettsf32(_ah) \ 
    795         ((*(_ah)->ah_getTsf32)((_ah))) 
    796 #define ath_hal_gettsf64(_ah) \ 
    797         ((*(_ah)->ah_getTsf64)((_ah))) 
    798 #define ath_hal_resettsf(_ah) \ 
    799         ((*(_ah)->ah_resetTsf)((_ah))) 
    800 #define ath_hal_rxena(_ah) \ 
    801         ((*(_ah)->ah_enableReceive)((_ah))) 
    802 #define ath_hal_numtxpending(_ah, _q) \ 
    803         ((*(_ah)->ah_numTxPending)((_ah), (_q))) 
    804 #define ath_hal_puttxbuf(_ah, _q, _bufaddr) \ 
    805         ((*(_ah)->ah_setTxDP)((_ah), (_q), (_bufaddr))) 
    806 #define ath_hal_gettxbuf(_ah, _q) \ 
    807         ((*(_ah)->ah_getTxDP)((_ah), (_q))) 
    808 #define ath_hal_getrxbuf(_ah) \ 
    809         ((*(_ah)->ah_getRxDP)((_ah))) 
    810 #define ath_hal_txstart(_ah, _q) \ 
    811         ((*(_ah)->ah_startTxDma)((_ah), (_q))) 
    812 #define ath_hal_setchannel(_ah, _chan) \ 
    813         ((*(_ah)->ah_setChannel)((_ah), (_chan))) 
    814 #define ath_hal_calibrate(_ah, _chan, _isIQdone) \ 
    815         ((*(_ah)->ah_perCalibration)((_ah), (_chan), (_isIQdone))) 
    816 #define ath_hal_setledstate(_ah, _state) \ 
    817         ((*(_ah)->ah_setLedState)((_ah), (_state))) 
    818 #define ath_hal_beaconinit(_ah, _nextb, _bperiod) \ 
    819         ((*(_ah)->ah_beaconInit)((_ah), (_nextb), (_bperiod))) 
    820 #define ath_hal_beaconreset(_ah) \ 
    821         ((*(_ah)->ah_resetStationBeaconTimers)((_ah))) 
    822 #define ath_hal_beacontimers(_ah, _bs) \ 
    823         ((*(_ah)->ah_setStationBeaconTimers)((_ah), (_bs))) 
    824 #define ath_hal_setassocid(_ah, _bss, _associd) \ 
    825         ((*(_ah)->ah_writeAssocid)((_ah), (_bss), (_associd))) 
    826 #define ath_hal_phydisable(_ah) \ 
    827         ((*(_ah)->ah_phyDisable)((_ah))) 
    828 #define ath_hal_setopmode(_ah) \ 
    829         ((*(_ah)->ah_setPCUConfig)((_ah))) 
    830 #define ath_hal_stoptxdma(_ah, _qnum) \ 
    831         ((*(_ah)->ah_stopTxDma)((_ah), (_qnum))) 
    832 #define ath_hal_stoppcurecv(_ah) \ 
    833         ((*(_ah)->ah_stopPcuReceive)((_ah))) 
    834 #define ath_hal_startpcurecv(_ah) \ 
    835         ((*(_ah)->ah_startPcuReceive)((_ah))) 
    836 #define ath_hal_stopdmarecv(_ah) \ 
    837         ((*(_ah)->ah_stopDmaReceive)((_ah))) 
    838 #define ath_hal_getdiagstate(_ah, _id, _indata, _insize, _outdata, _outsize) \ 
    839         ((*(_ah)->ah_getDiagState)((_ah), (_id), \ 
    840                 (_indata), (_insize), (_outdata), (_outsize))) 
    841 #define ath_hal_gettxqueueprops(_ah, _q, _qi) \ 
    842         ((*(_ah)->ah_getTxQueueProps)((_ah), (_q), (_qi))) 
    843 #define ath_hal_settxqueueprops(_ah, _q, _qi) \ 
    844         ((*(_ah)->ah_setTxQueueProps)((_ah), (_q), (_qi))) 
    845 #define ath_hal_setuptxqueue(_ah, _type, _irq) \ 
    846         ((*(_ah)->ah_setupTxQueue)((_ah), (_type), (_irq))) 
    847 #define ath_hal_resettxqueue(_ah, _q) \ 
    848         ((*(_ah)->ah_resetTxQueue)((_ah), (_q))) 
    849 #define ath_hal_releasetxqueue(_ah, _q) \ 
    850         ((*(_ah)->ah_releaseTxQueue)((_ah), (_q))) 
    851 #define ath_hal_getrfgain(_ah) \ 
    852         ((*(_ah)->ah_getRfGain)((_ah))) 
    853 #define ath_hal_getdefantenna(_ah) \ 
    854         ((*(_ah)->ah_getDefAntenna)((_ah))) 
    855 #define ath_hal_setdefantenna(_ah, _ant) \ 
    856         ((*(_ah)->ah_setDefAntenna)((_ah), (_ant))) 
    857 #define ath_hal_rxmonitor(_ah, _arg, _chan) \ 
    858         ((*(_ah)->ah_rxMonitor)((_ah), (_arg), (_chan))) 
    859 #define ath_hal_mibevent(_ah, _stats) \ 
    860         ((*(_ah)->ah_procMibEvent)((_ah), (_stats))) 
    861 #define ath_hal_setslottime(_ah, _us) \ 
    862         ((*(_ah)->ah_setSlotTime)((_ah), (_us))) 
    863 #define ath_hal_getslottime(_ah) \ 
    864         ((*(_ah)->ah_getSlotTime)((_ah))) 
    865 #define ath_hal_setacktimeout(_ah, _us) \ 
    866         ((*(_ah)->ah_setAckTimeout)((_ah), (_us))) 
    867 #define ath_hal_getacktimeout(_ah) \ 
    868         ((*(_ah)->ah_getAckTimeout)((_ah))) 
    869 #define ath_hal_setctstimeout(_ah, _us) \ 
    870         ((*(_ah)->ah_setCTSTimeout)((_ah), (_us))) 
    871 #define ath_hal_getctstimeout(_ah) \ 
    872         ((*(_ah)->ah_getCTSTimeout)((_ah))) 
    873 #define ath_hal_setdecompmask(_ah, _keyid, _b) \ 
    874         ((*(_ah)->ah_setDecompMask)((_ah), (_keyid), (_b))) 
    875 #define ath_hal_enablePhyDiag(_ah) \ 
    876         ((*(_ah)->ah_enablePhyErrDiag)((_ah))) 
    877 #define ath_hal_disablePhyDiag(_ah) \ 
    878         ((*(_ah)->ah_disablePhyErrDiag)((_ah))) 
    879 #define ath_hal_getcapability(_ah, _cap, _param, _result) \ 
    880         ((*(_ah)->ah_getCapability)((_ah), (_cap), (_param), (_result))) 
    881 #define ath_hal_setcapability(_ah, _cap, _param, _v, _status) \ 
    882         ((*(_ah)->ah_setCapability)((_ah), (_cap), (_param), (_v), (_status))) 
    883 #define ath_hal_ciphersupported(_ah, _cipher) \ 
    884         (ath_hal_getcapability(_ah, HAL_CAP_CIPHER, _cipher, NULL) == HAL_OK) 
    885 #define ath_hal_fastframesupported(_ah) \ 
    886         (ath_hal_getcapability(_ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK) 
    887 #define ath_hal_burstsupported(_ah) \ 
    888         (ath_hal_getcapability(_ah, HAL_CAP_BURST, 0, NULL) == HAL_OK) 
    889 #define ath_hal_xrsupported(_ah) \ 
    890         (ath_hal_getcapability(_ah, HAL_CAP_XR, 0, NULL) == HAL_OK) 
    891 #define ath_hal_compressionsupported(_ah) \ 
    892         (ath_hal_getcapability(_ah, HAL_CAP_COMPRESSION, 0, NULL) == HAL_OK) 
    893 #define ath_hal_turboagsupported(_ah) \ 
    894         (ath_hal_getwirelessmodes(_ah, ath_countrycode) & (HAL_MODE_108G|HAL_MODE_TURBO)) 
    895 #define ath_hal_halfrate_chansupported(_ah) \ 
    896         (ath_hal_getcapability(_ah, HAL_CAP_CHAN_HALFRATE, 0, NULL) == HAL_OK) 
    897 #define ath_hal_quarterrate_chansupported(_ah) \ 
    898         (ath_hal_getcapability(_ah, HAL_CAP_CHAN_QUARTERRATE, 0, NULL) == HAL_OK) 
    899 #define ath_hal_getregdomain(_ah, _prd) \ 
    900         ath_hal_getcapability(_ah, HAL_CAP_REG_DMN, 0, (_prd)) 
    901 #define ath_hal_getcountrycode(_ah, _pcc) \ 
    902         (*(_pcc) = (_ah)->ah_countryCode) 
    903 #define ath_hal_hastkipsplit(_ah) \ 
    904         (ath_hal_getcapability(_ah, HAL_CAP_TKIP_SPLIT, 0, NULL) == HAL_OK) 
    905 #define ath_hal_gettkipsplit(_ah) \ 
    906         (ath_hal_getcapability(_ah, HAL_CAP_TKIP_SPLIT, 1, NULL) == HAL_OK) 
    907 #define ath_hal_settkipsplit(_ah, _v) \ 
    908         ath_hal_setcapability(_ah, HAL_CAP_TKIP_SPLIT, 1, _v, NULL) 
    909 #define ath_hal_wmetkipmic(_ah) \ 
    910         (ath_hal_getcapability(_ah, HAL_CAP_WME_TKIPMIC, 0, NULL) == HAL_OK) 
    911 #define ath_hal_hwphycounters(_ah) \ 
    912         (ath_hal_getcapability(_ah, HAL_CAP_PHYCOUNTERS, 0, NULL) == HAL_OK) 
    913 #define ath_hal_hasdiversity(_ah) \ 
    914         (ath_hal_getcapability(_ah, HAL_CAP_DIVERSITY, 0, NULL) == HAL_OK) 
    915 #define ath_hal_getdiversity(_ah) \ 
    916         (ath_hal_getcapability(_ah, HAL_CAP_DIVERSITY, 1, NULL) == HAL_OK) 
    917 #define ath_hal_setdiversity(_ah, _v) \ 
    918         ath_hal_setcapability(_ah, HAL_CAP_DIVERSITY, 1, _v, NULL) 
    919 #define ath_hal_getnumtxqueues(_ah, _pv) \ 
    920         (ath_hal_getcapability(_ah, HAL_CAP_NUM_TXQUEUES, 0, _pv) == HAL_OK) 
    921 #define ath_hal_hasveol(_ah) \ 
    922         (ath_hal_getcapability(_ah, HAL_CAP_VEOL, 0, NULL) == HAL_OK) 
    923 #define ath_hal_hastxpowlimit(_ah) \ 
    924         (ath_hal_getcapability(_ah, HAL_CAP_TXPOW, 0, NULL) == HAL_OK) 
    925 #define ath_hal_settxpowlimit(_ah, _pow) \ 
    926         ((*(_ah)->ah_setTxPowerLimit)((_ah), (_pow))) 
    927 #define ath_hal_gettxpowlimit(_ah, _ppow) \ 
    928         (ath_hal_getcapability(_ah, HAL_CAP_TXPOW, 1, _ppow) == HAL_OK) 
    929 #define ath_hal_getmaxtxpow(_ah, _ppow) \ 
    930         (ath_hal_getcapability(_ah, HAL_CAP_TXPOW, 2, _ppow) == HAL_OK) 
    931 #define ath_hal_gettpscale(_ah, _scale) \ 
    932         (ath_hal_getcapability(_ah, HAL_CAP_TXPOW, 3, _scale) == HAL_OK) 
    933 #define ath_hal_settpscale(_ah, _v) \ 
    934         ath_hal_setcapability(_ah, HAL_CAP_TXPOW, 3, _v, NULL) 
    935 #define ath_hal_hastpc(_ah) \ 
    936         (ath_hal_getcapability(_ah, HAL_CAP_TPC, 0, NULL) == HAL_OK) 
    937 #define ath_hal_gettpc(_ah) \ 
    938         (ath_hal_getcapability(_ah, HAL_CAP_TPC, 1, NULL) == HAL_OK) 
    939 #define ath_hal_settpc(_ah, _v) \ 
    940         ath_hal_setcapability(_ah, HAL_CAP_TPC, 1, _v, NULL) 
    941 #define ath_hal_hasbursting(_ah) \ 
    942         (ath_hal_getcapability(_ah, HAL_CAP_BURST, 0, NULL) == HAL_OK) 
    943 #define ath_hal_hascompression(_ah) \ 
    944         (ath_hal_getcapability(_ah, HAL_CAP_COMPRESSION, 0, NULL) == HAL_OK) 
    945 #define ath_hal_hasfastframes(_ah) \ 
    946         (ath_hal_getcapability(_ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK) 
    947 #define ath_hal_hasbssidmask(_ah) \ 
    948         (ath_hal_getcapability(_ah, HAL_CAP_BSSIDMASK, 0, NULL) == HAL_OK) 
    949 #define ath_hal_hasmcastkeysearch(_ah) \ 
    950         (ath_hal_getcapability(_ah, HAL_CAP_MCAST_KEYSRCH, 0, NULL) == HAL_OK) 
    951 #define ath_hal_getmcastkeysearch(_ah) \ 
    952         (ath_hal_getcapability(_ah, HAL_CAP_MCAST_KEYSRCH, 1, NULL) == HAL_OK) 
    953 #define ath_hal_hastkipmic(_ah) \ 
    954         (ath_hal_getcapability(_ah, HAL_CAP_TKIP_MIC, 0, NULL) == HAL_OK) 
    955 #define ath_hal_gettkipmic(_ah) \ 
    956         (ath_hal_getcapability(_ah, HAL_CAP_TKIP_MIC, 1, NULL) == HAL_OK) 
    957 #define ath_hal_settkipmic(_ah, _v) \ 
    958         ath_hal_setcapability(_ah, HAL_CAP_TKIP_MIC, 1, _v, NULL) 
    959 #define ath_hal_hastsfadjust(_ah) \ 
    960         (ath_hal_getcapability(_ah, HAL_CAP_TSF_ADJUST, 0, NULL) == HAL_OK) 
    961 #define ath_hal_gettsfadjust(_ah) \ 
    962         (ath_hal_getcapability(_ah, HAL_CAP_TSF_ADJUST, 1, NULL) == HAL_OK) 
    963 #define ath_hal_settsfadjust(_ah, _v) \ 
    964         ath_hal_setcapability(_ah, HAL_CAP_TSF_ADJUST, 1, _v, NULL) 
    965 #define ath_hal_setrfsilent(_ah, _v) \ 
    966         ath_hal_setcapability(_ah, HAL_CAP_RFSILENT, 1, _v, NULL) 
    967 #define ath_hal_hasrfsilent(_ah) \ 
    968         (ath_hal_getcapability(_ah, HAL_CAP_RFSILENT, 0, NULL) == HAL_OK) 
    969  
    970 #define ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \ 
    971         ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) 
    972 #define ath_hal_rxprocdesc(_ah, _ds, _dspa, _dsnext, _tsf, _rs) \ 
    973         ((*(_ah)->ah_procRxDesc)((_ah), (_ds), (_dspa), (_dsnext), (_tsf), (_rs))) 
    974 #define ath_hal_updateCTSForBursting(_ah, _ds, _prevds, _prevdsWithCTS, _gatingds,    \ 
    975                                      _txOpLimit, _ctsDuration)                        \ 
    976         ((*(_ah)->ah_updateCTSForBursting)((_ah), (_ds), (_prevds), (_prevdsWithCTS), \ 
    977                                            (_gatingds), (_txOpLimit), (_ctsDuration))) 
    978 #define ath_hal_setuptxdesc(_ah, _ds, _plen, _hlen, _atype, _txpow, \ 
    979                 _txr0, _txtr0, _keyix, _ant, _flags, \ 
    980                 _rtsrate, _rtsdura, \ 
    981                 _compicvlen, _compivlen, _comp) \ 
    982         ((*(_ah)->ah_setupTxDesc)((_ah), (_ds), (_plen), (_hlen), (_atype), \ 
    983                 (_txpow), (_txr0), (_txtr0), (_keyix), (_ant), \ 
    984                 (_flags), (_rtsrate), (_rtsdura), \ 
    985                 (_compicvlen), (_compivlen), (_comp))) 
    986 #define ath_hal_setupxtxdesc(_ah, _ds, \ 
    987                 _txr1, _txtr1, _txr2, _txtr2, _txr3, _txtr3) \ 
    988         ((*(_ah)->ah_setupXTxDesc)((_ah), (_ds), \ 
    989                 (_txr1), (_txtr1), (_txr2), (_txtr2), (_txr3), (_txtr3))) 
    990 #define ath_hal_filltxdesc(_ah, _ds, _l, _first, _last, _ds0) \ 
    991         ((*(_ah)->ah_fillTxDesc)((_ah), (_ds), (_l), (_first), (_last), (_ds0))) 
    992 #define ath_hal_txprocdesc(_ah, _ds, _ts) \ 
    993         ((*(_ah)->ah_procTxDesc)((_ah), (_ds), (_ts))) 
    994 #define ath_hal_gettxintrtxqs(_ah, _txqs) \ 
    995         ((*(_ah)->ah_getTxIntrQueue)((_ah), (_txqs))) 
    996 #define ath_hal_txreqintrdesc(_ah, _ds) \ 
    997         ((*(_ah)->ah_reqTxIntrDesc)((_ah), (_ds))) 
    998  
    999 #define ath_hal_gpioCfgOutput(_ah, _gpio) \ 
    1000         ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio))) 
    1001 #define ath_hal_gpioset(_ah, _gpio, _b) \ 
    1002         ((*(_ah)->ah_gpioSet)((_ah), (_gpio), (_b))) 
    1003 #define ath_hal_setcoverageclass(_ah, _coverageclass, _now) \ 
    1004         ((*(_ah)->ah_setCoverageClass)((_ah), (_coverageclass), (_now))) 
    1005 #define ath_hal_radar_wait(_ah, _chan) \ 
    1006         ((*(_ah)->ah_radarWait)((_ah), (_chan))) 
    1007 #define ath_hal_get_channel_noise(_ah, _chan) \ 
    1008         ((*(_ah)->ah_getChanNoise)((_ah), (_chan))) 
     770#include "ath_hal_api.h" 
    1009771 
    1010772#endif /* _DEV_ATH_ATHVAR_H */ 
  • madwifi/ath/if_ath.c

    old new  
    726804#endif 
    727805 
    728806#ifdef ATH_SUPERG_DYNTURBO 
    729         ic->ic_ath_cap |= (ath_hal_turboagsupported(ah) ? (IEEE80211_ATHC_TURBOP | 
     807        ic->ic_ath_cap |= (ath_hal_turboagsupported(ah, ath_countrycode) ? (IEEE80211_ATHC_TURBOP | 
    730808                                                        IEEE80211_ATHC_AR) : 0); 
    731809#endif 
    732810#ifdef ATH_SUPERG_XR