Ticket #1371: madwifi-trunk-hallock.diff
| File madwifi-trunk-hallock.diff, 67.3 kB (added by mtaylor, 5 years ago) |
|---|
-
scripts/if_ath_hal_settings.pl
old new 1 #!/usr/bin/perl 2 # 3 # 4 # This file contains settings used to generate the HAL wrapper API for MadWifi from the 5 # binary HAL api header. You can edit these settings to customize the behavior of the 6 # code generator. 7 # 8 9 # 10 # This section contains the output file paths 11 # 12 $path_to_ah_h = 'hal/ah.h'; 13 $path_to_ath_hal_api_h = 'ath/if_ath_hal.h'; 14 $path_to_ath_hal_api_c = 'ath/if_ath_hal.c'; 15 16 # 17 # This section defines the name translation from the binary HAL's function 18 # pointers to our API names. 19 # 20 %hal_function_name_to_madwifi_name = ( 21 "ah_beaconInit" => "ath_hal_beaconinit" 22 , "ah_disablePhyErrDiag" => "ath_hal_disablePhyDiag" 23 , "ah_enablePhyErrDiag" => "ath_hal_enablePhyDiag" 24 , "ah_enableReceive" => "ath_hal_rxena" 25 , "ah_fillTxDesc" => "ath_hal_filltxdesc" 26 , "ah_getAckCTSRate" => "ath_hal_getackctsrate" 27 , "ah_setAckCTSRate" => "ath_hal_setackctsrate" 28 , "ah_updateMibCounters" => "ath_hal_updatemibcounters" 29 , "ah_getAntennaSwitch" => "ath_hal_getantennaswitch" 30 , "ah_setAntennaSwitch" => "ath_hal_setantennaswitch" 31 , "ah_getAckTimeout" => "ath_hal_getacktimeout" 32 , "ah_getBssIdMask" => "ath_hal_getbssidmask" 33 , "ah_getCapability" => "ath_hal_getcapability" 34 , "ah_getChanNoise" => "ath_hal_get_channel_noise" 35 , "ah_getCTSTimeout" => "ath_hal_getctstimeout" 36 , "ah_getDefAntenna" => "ath_hal_getdefantenna" 37 , "ah_getDiagState" => "ath_hal_getdiagstate" 38 , "ah_getInterrupts" => "ath_hal_intrget" 39 , "ah_getKeyCacheSize" => "ath_hal_keycachesize" 40 , "ah_getMacAddress" => "ath_hal_getmac" 41 , "ah_getPendingInterrupts" => "ath_hal_getisr" 42 , "ah_getPowerMode" => "ath_hal_getPowerMode" 43 , "ah_getRateTable" => "ath_hal_getratetable" 44 , "ah_getRfGain" => "ath_hal_getrfgain" 45 , "ah_getRxDP" => "ath_hal_getrxbuf" 46 , "ah_getRxFilter" => "ath_hal_getrxfilter" 47 , "ah_getSlotTime" => "ath_hal_getslottime" 48 , "ah_getTsf32" => "ath_hal_gettsf32" 49 , "ah_getTsf64" => "ath_hal_gettsf64" 50 , "ah_getTxDP" => "ath_hal_gettxbuf" 51 , "ah_getTxIntrQueue" => "ath_hal_gettxintrtxqs" 52 , "ah_getTxQueueProps" => "ath_hal_gettxqueueprops" 53 , "ah_gpioCfgOutput" => "ath_hal_gpioCfgOutput" 54 , "ah_gpioSet" => "ath_hal_gpioset" 55 , "ah_gpioGet" => "ath_hal_gpioget" 56 , "ah_gpioSetIntr" => "ath_hal_gpiosetintr" 57 , "ah_gpioCfgInput" => "ath_hal_gpiCfgInput" 58 , "ah_isInterruptPending" => "ath_hal_intrpend" 59 , "ah_isKeyCacheEntryValid" => "ath_hal_keyisvalid" 60 , "ah_numTxPending" => "ath_hal_numtxpending" 61 , "ah_perCalibration" => "ath_hal_calibrate" 62 , "ah_phyDisable" => "ath_hal_phydisable" 63 , "ah_disable" => "ath_hal_disable" 64 , "ah_procMibEvent" => "ath_hal_mibevent" 65 , "ah_procRxDesc" => "ath_hal_rxprocdesc" 66 , "ah_procTxDesc" => "ath_hal_txprocdesc" 67 , "ah_radarWait" => "ath_hal_radar_wait" 68 , "ah_releaseTxQueue" => "ath_hal_releasetxqueue" 69 , "ah_reqTxIntrDesc" => "ath_hal_txreqintrdesc" 70 , "ah_reset" => "ath_hal_reset" 71 , "ah_resetKeyCacheEntry" => "ath_hal_keyreset" 72 , "ah_resetStationBeaconTimers" => "ath_hal_beaconreset" 73 , "ah_resetTsf" => "ath_hal_resettsf" 74 , "ah_resetTxQueue" => "ath_hal_resettxqueue" 75 , "ah_rxMonitor" => "ath_hal_rxmonitor" 76 , "ah_setAckTimeout" => "ath_hal_setacktimeout" 77 , "ah_setBssIdMask" => "ath_hal_setbssidmask" 78 , "ah_setCapability" => "ath_hal_setcapability" 79 , "ah_setChannel" => "ath_hal_setchannel" 80 , "ah_setCoverageClass" => "ath_hal_setcoverageclass" 81 , "ah_setCTSTimeout" => "ath_hal_setctstimeout" 82 , "ah_setDecompMask" => "ath_hal_setdecompmask" 83 , "ah_setDefAntenna" => "ath_hal_setdefantenna" 84 , "ah_setInterrupts" => "ath_hal_intrset" 85 , "ah_setKeyCacheEntry" => "ath_hal_keyset" 86 , "ah_setKeyCacheEntryMac" => "ath_hal_keysetmac" 87 , "ah_setLedState" => "ath_hal_setledstate" 88 , "ah_setMacAddress" => "ath_hal_setmac" 89 , "ah_setMulticastFilter" => "ath_hal_setmcastfilter" 90 , "ah_setMulticastFilterIndex" => "ath_hal_setmcastfilterindex" 91 , "ah_setPCUConfig" => "ath_hal_setopmode" 92 , "ah_setPowerMode" => "ath_hal_setpower" 93 , "ah_setRxDP" => "ath_hal_putrxbuf" 94 , "ah_setRxFilter" => "ath_hal_setrxfilter" 95 , "ah_setRegulatoryDomain" => "ath_hal_setregulatorydomain" 96 , "ah_setSlotTime" => "ath_hal_setslottime" 97 , "ah_setStationBeaconTimers" => "ath_hal_beacontimers" 98 , "ah_setTxDP" => "ath_hal_puttxbuf" 99 , "ah_setTxQueueProps" => "ath_hal_settxqueueprops" 100 , "ah_setTxPowerLimit" => "ath_hal_settxpowlimit" 101 , "ah_setBeaconTimers" => "ath_hal_setbeacontimers" 102 , "ah_setupRxDesc" => "ath_hal_setuprxdesc" 103 , "ah_setupTxDesc" => "ath_hal_setuptxdesc" 104 , "ah_setupTxQueue" => "ath_hal_setuptxqueue" 105 , "ah_setupXTxDesc" => "ath_hal_setupxtxdesc" 106 , "ah_startPcuReceive" => "ath_hal_startpcurecv" 107 , "ah_startTxDma" => "ath_hal_txstart" 108 , "ah_stopDmaReceive" => "ath_hal_stopdmarecv" 109 , "ah_stopPcuReceive" => "ath_hal_stoppcurecv" 110 , "ah_stopTxDma" => "ath_hal_stoptxdma" 111 , "ah_updateCTSForBursting" => "ath_hal_updateCTSForBursting" 112 , "ah_updateTxTrigLevel" => "ath_hal_updatetxtriglevel" 113 , "ah_waitForBeaconDone" => "ath_hal_waitforbeacon" 114 , "ah_writeAssocid" => "ath_hal_setassocid" 115 , "ah_clrMulticastFilterIndex" => "ath_hal_clearmcastfilter" 116 , "ah_detectCardPresent" => "ath_hal_detectcardpresent" 117 ); 118 # 119 # List any functions that should NOT be generated here (such as those that conflict with 120 # other functions, perhaps. 121 # 122 @hal_functions_not_to_wrap = ( "ah_detach" ); 123 # 124 # Boilerplate text 125 # 126 $header_comment = <<EOF 127 /* 128 * Wrapper macros/functions for the binary HAL to comply with local coding convention. 129 * 130 * Provides function-style calling convention using either macros or wrapper functions for function pointers in the HAL. 131 * 132 * The typical convention is ath_hal_foo(ah,p1,p2,p3,...) turns into ah->ah_foo(p1,p2,p3,...) where ah_foo 133 * is a function pointer and a member of the struct ath_hal (usually named ah). 134 * 135 */ 136 EOF 137 ; 138 # 139 # This section defines additional HAL APIs that we we want to expose. It 140 # is structured the way that it is so that we can parse the declaration portion 141 # and easily turn it into function headers, inlines in headers, 142 # implementations in .c files, etc.. 143 # 144 %custom_wrappers = ( 145 "HAL_BOOL ath_hal_burstsupported(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_BURST, 0, NULL) == HAL_OK)" 146 , "HAL_BOOL ath_hal_ciphersupported(struct ath_hal * ah, u_int32_t cipher)" => "(ath_hal_getcapability(ah, HAL_CAP_CIPHER, cipher, NULL) == HAL_OK)" 147 , "HAL_BOOL ath_hal_compressionsupported(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_COMPRESSION, 0, NULL) == HAL_OK)" 148 , "HAL_BOOL ath_hal_fastframesupported(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK)" 149 , "HAL_BOOL ath_hal_getcountrycode(struct ath_hal * ah, u_int32_t* destination)" => "((*(destination) = ah->ah_countryCode), AH_TRUE)" 150 , "HAL_BOOL ath_hal_getdiversity(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_DIVERSITY, 1, NULL) == HAL_OK)" 151 , "HAL_BOOL ath_hal_getmaxtxpow(struct ath_hal * ah, u_int32_t* destination)" => "(ath_hal_getcapability(ah, HAL_CAP_TXPOW, 2, destination) == HAL_OK)" 152 , "HAL_BOOL ath_hal_getmcastkeysearch(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_MCAST_KEYSRCH, 1, NULL) == HAL_OK)" 153 , "HAL_BOOL ath_hal_getnumtxqueues(struct ath_hal * ah, u_int32_t* destination)" => "(ath_hal_getcapability(ah, HAL_CAP_NUM_TXQUEUES, 0, destination) == HAL_OK)" 154 , "HAL_BOOL ath_hal_getregdomain(struct ath_hal * ah, u_int32_t* destination)" => "(ath_hal_getcapability(ah, HAL_CAP_REG_DMN, 0, destination))" 155 , "HAL_BOOL ath_hal_gettkipmic(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_TKIP_MIC, 1, NULL) == HAL_OK)" 156 , "HAL_BOOL ath_hal_gettkipsplit(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_TKIP_SPLIT, 1, NULL) == HAL_OK)" 157 , "HAL_BOOL ath_hal_gettpc(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_TPC, 1, NULL) == HAL_OK)" 158 , "HAL_BOOL ath_hal_gettpscale(struct ath_hal * ah, u_int32_t* destination)" => "(ath_hal_getcapability(ah, HAL_CAP_TXPOW, 3, destination) == HAL_OK)" 159 , "HAL_BOOL ath_hal_gettsfadjust(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_TSF_ADJUST, 1, NULL) == HAL_OK)" 160 , "HAL_BOOL ath_hal_gettxpowlimit(struct ath_hal * ah, u_int32_t* destination)" => "(ath_hal_getcapability(ah, HAL_CAP_TXPOW, 1, destination) == HAL_OK)" 161 , "HAL_BOOL ath_hal_halfrate_chansupported(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_CHAN_HALFRATE, 0, NULL) == HAL_OK)" 162 , "HAL_BOOL ath_hal_hasbssidmask(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_BSSIDMASK, 0, NULL) == HAL_OK)" 163 , "HAL_BOOL ath_hal_hasbursting(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_BURST, 0, NULL) == HAL_OK)" 164 , "HAL_BOOL ath_hal_hascompression(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_COMPRESSION, 0, NULL) == HAL_OK)" 165 , "HAL_BOOL ath_hal_hasdiversity(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_DIVERSITY, 0, NULL) == HAL_OK)" 166 , "HAL_BOOL ath_hal_hasfastframes(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK)" 167 , "HAL_BOOL ath_hal_hasmcastkeysearch(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_MCAST_KEYSRCH, 0, NULL) == HAL_OK)" 168 , "HAL_BOOL ath_hal_hasrfsilent(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_RFSILENT, 0, NULL) == HAL_OK)" 169 , "HAL_BOOL ath_hal_hastkipmic(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_TKIP_MIC, 0, NULL) == HAL_OK)" 170 , "HAL_BOOL ath_hal_hastkipsplit(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_TKIP_SPLIT, 0, NULL) == HAL_OK)" 171 , "HAL_BOOL ath_hal_hastpc(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_TPC, 0, NULL) == HAL_OK)" 172 , "HAL_BOOL ath_hal_hastsfadjust(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_TSF_ADJUST, 0, NULL) == HAL_OK)" 173 , "HAL_BOOL ath_hal_hastxpowlimit(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_TXPOW, 0, NULL) == HAL_OK)" 174 , "HAL_BOOL ath_hal_hasveol(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_VEOL, 0, NULL) == HAL_OK)" 175 , "HAL_BOOL ath_hal_hwphycounters(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_PHYCOUNTERS, 0, NULL) == HAL_OK)" 176 , "HAL_BOOL ath_hal_quarterrate_chansupported(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_CHAN_QUARTERRATE, 0, NULL) == HAL_OK)" 177 , "HAL_BOOL ath_hal_setdiversity(struct ath_hal * ah, int v)" => "(ath_hal_setcapability(ah, HAL_CAP_DIVERSITY, 1, v, NULL))" 178 , "HAL_BOOL ath_hal_setrfsilent(struct ath_hal * ah, u_int32_t v)" => "(ath_hal_setcapability(ah, HAL_CAP_RFSILENT, 1, v, NULL))" 179 , "HAL_BOOL ath_hal_settkipmic(struct ath_hal * ah, u_int32_t v)" => "(ath_hal_setcapability(ah, HAL_CAP_TKIP_MIC, 1, v, NULL))" 180 , "HAL_BOOL ath_hal_settkipsplit(struct ath_hal * ah, int v)" => "(ath_hal_setcapability(ah, HAL_CAP_TKIP_SPLIT, 1, v, NULL))" 181 , "HAL_BOOL ath_hal_settpc(struct ath_hal * ah, u_int32_t v)" => "(ath_hal_setcapability(ah, HAL_CAP_TPC, 1, v, NULL))" 182 , "HAL_BOOL ath_hal_settpscale(struct ath_hal * ah, u_int32_t v)" => "(ath_hal_setcapability(ah, HAL_CAP_TXPOW, 3, v, NULL))" 183 , "HAL_BOOL ath_hal_settsfadjust(struct ath_hal * ah, u_int32_t v)" => "(ath_hal_setcapability(ah, HAL_CAP_TSF_ADJUST, 1, v, NULL))" 184 , "HAL_BOOL ath_hal_turboagsupported(struct ath_hal * ah, int countrycode)" => "(ath_hal_getwirelessmodes(ah, countrycode) & (HAL_MODE_108G|HAL_MODE_TURBO))" 185 , "HAL_BOOL ath_hal_wmetkipmic(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_WME_TKIPMIC, 0, NULL) == HAL_OK)" 186 , "HAL_BOOL ath_hal_xrsupported(struct ath_hal * ah)" => "(ath_hal_getcapability(ah, HAL_CAP_XR, 0, NULL) == HAL_OK)" 187 ); 188 189 190 # 191 # This text is generated verbatim at the top of the .h file, 192 # before generated content is added. 193 # 194 $header_for_h = <<EOF 195 $header_comment 196 #ifndef _IF_ATH_HAL_H 197 #define _IF_ATH_HAL_H 198 199 #define GET_ATH_SOFTC(_ah) ((struct ath_softc*)(_ah->ah_sc)) 200 #define ATH_HAL_LOCK_INIT(_sc) spin_lock_init(&(_sc)->sc_hal_lock) 201 #define ATH_HAL_LOCK_DESTROY(_sc) 202 #define ATH_HAL_LOCK_IRQ(_sc) do { \\ 203 unsigned long __sc_halLockflags; \\ 204 spin_lock_irqsave(&(_sc)->sc_hal_lock, __sc_halLockflags); 205 #define ATH_HAL_UNLOCK_IRQ(_sc) \\ 206 spin_unlock_irqrestore(&(_sc)->sc_hal_lock, __sc_halLockflags); \\ 207 } while(0) 208 #define ATH_HAL_UNLOCK_IRQ_EARLY(_sc) \\ 209 spin_unlock_irqrestore(&(_sc)->sc_hal_lock, __sc_halLockflags); 210 211 static inline void 212 ath_reg_write(struct ath_softc *sc, u_int reg, u_int32_t val) { 213 ATH_HAL_LOCK_IRQ(sc); 214 OS_REG_WRITE(sc->sc_ah, reg, val); 215 ATH_HAL_UNLOCK_IRQ(sc); 216 } 217 218 static inline u_int32_t 219 ath_reg_read(struct ath_softc *sc, u_int reg) { 220 u_int32_t ret; 221 ATH_HAL_LOCK_IRQ(sc); 222 ret = OS_REG_READ(sc->sc_ah, reg); 223 ATH_HAL_UNLOCK_IRQ(sc); 224 return ret; 225 } 226 227 /* 228 These wrappers are generated by scripts/regenerate_ath_hal_api.pl and are used 229 to protect access to the HAL with locking as well as providing improved 230 debugging support, despite obfuscation. 231 */ 232 EOF 233 ; 234 235 # 236 # This text is generated verbatim at the bottom of the .h file 237 # 238 $footer_for_h = <<EOF 239 240 #endif /* _IF_ATH_HAL_H */ 241 EOF 242 ; 243 # 244 # This text is generated verbatim at the top of the .c file 245 # 246 $header_for_c = <<EOF 247 $header_comment 248 #include "opt_ah.h" 249 250 #ifdef AH_HALOPS_FUNC 251 252 #ifndef AUTOCONF_INCLUDED 253 #include <linux/config.h> 254 #endif 255 #include <linux/version.h> 256 #include <linux/module.h> 257 #include <linux/init.h> 258 #include <linux/skbuff.h> 259 #include <linux/netdevice.h> 260 #include <linux/etherdevice.h> 261 #include <linux/random.h> 262 #include <linux/delay.h> 263 #include <linux/cache.h> 264 #include <linux/sysctl.h> 265 #include <linux/proc_fs.h> 266 #include <linux/if_arp.h> 267 #include <linux/rtnetlink.h> 268 #include <asm/uaccess.h> 269 270 #include "ath_hal_api.h" 271 EOF 272 ; 273 # 274 # This text is generated verbatim at the bottom of the .c file 275 # 276 $footer_for_c = <<EOF 277 278 #endif /* #ifndef AH_HALOPS_FUNC */ 279 EOF 280 ; 281 -
scripts/if_ath_hal_generator.pl
old new 1 #!/usr/bin/perl 2 strict; 3 use warnings; 4 require 'dumpvar.pl'; 5 6 # 7 # Workaround for perl's warning mechanism, avoids 'possible typo' for every setting used only one time. 8 # 9 10 $header_for_c = undef; 11 $footer_for_c = undef; 12 $header_for_h = undef; 13 $footer_for_h = undef; 14 $hal_functions_not_to_wrap = undef; 15 require "scripts/if_ath_hal_settings.pl"; 16 17 # 18 # Parsed Function Data 19 # 20 21 # list of declarations in document order 22 @hal_prototypes = (); 23 # hash of string->string (hal's function name to return type) 24 %hal_functionname_to_return_type = (); 25 # hash of string->list of strings (ordered list of parameter names) 26 %hal_functionname_to_parameter_name_array = (); 27 # hash of string->list of strings (ordered list of parameter types) 28 %hal_functionname_to_parameter_types_array = (); 29 # hash of string->string (hal's function name to return type) 30 %wrapper_functionname_to_return_type = (); 31 # hash of string->string (hal's function name to expression) 32 %wrapper_functionname_to_expression = (); 33 # hash of string->list of strings (ordered list of wrapper function parameter names) 34 %wrapper_functionname_to_parameter_name_array = (); 35 # hash of string->list of strings (ordered list of wrapper function parameter types) 36 %wrapper_functionname_to_parameter_types_array = (); 37 38 # 39 # Open the files we need 40 # 41 if(!open AH_H, "<$path_to_ah_h") { 42 die "Cannot open $path_to_ah_h: $!"; 43 } 44 if(!open ATH_HAL_API_H, ">$path_to_ath_hal_api_h") { 45 close AH_H; 46 die "Cannot open $path_to_ath_hal_api_h: $!"; 47 } 48 if(!open ATH_HAL_API_C, ">$path_to_ath_hal_api_c") { 49 close AH_H; 50 close ATH_HAL_API_H; 51 die "Cannot open $path_to_ath_hal_api_c: $!"; 52 } 53 54 # Parse and scrub the hal structure's member function declarations 55 $line_continued = 0; 56 $line_buffer = ""; 57 foreach (<AH_H>) { 58 chomp($_); 59 s/\s+$//g; 60 s/^\s+//g; 61 s/\s+/ /g; 62 if (/__ahdecl\s*\(.*/ || $line_continued) { 63 $line_buffer .= "$_"; 64 if (/__ahdecl.*;/ || ($line_continued && /;/)) { 65 push @hal_prototypes, $line_buffer; 66 $line_buffer = ""; 67 $line_continued = 0; 68 } 69 else { 70 $line_buffer .= " "; 71 $line_continued = 1; 72 } 73 } 74 } 75 # 76 # Now pick apart the return type, parameter types, and parameter names for each HAL function 77 # 78 foreach $proto (@hal_prototypes) { 79 $proto =~ /^((?:(?:const|struct)\s*)*[^\s]+[\s]*\*?)[\s]*__ahdecl\(\*([^\)]*)\)\((.*)\);/; 80 my $return_type = $1; 81 my $member_name = $2; 82 my $parameterlist = $3; 83 if(! grep{/$member_name/} @hal_functions_not_to_wrap ) { 84 $hal_functionname_to_return_type{"$member_name"} = $return_type; 85 @{$hal_functionname_to_parameter_name_array{"$member_name"}} = (); 86 @{$hal_functionname_to_parameter_types_array{"$member_name"}} = (); 87 my @parameters = split /,\s?/, $parameterlist; 88 $argnum = 0; 89 $first = 1; 90 foreach(@parameters) { 91 $_ =~ s/ \*/\* /; 92 $_ =~ /^((?:(?:const|struct|\*)\s*)*)([^\s]+\*?)\s*([^\s]*)\s*/; 93 my $type = "$1$2"; 94 my $name = "$3"; 95 if(0 == length($name)) { 96 if($argnum == 0 && $type =~ /ath_hal/) { 97 $name = "ah"; 98 } 99 else { 100 $name = "a" . $argnum; 101 } 102 } 103 104 push @{$hal_functionname_to_parameter_name_array{$member_name}}, $name; 105 push @{$hal_functionname_to_parameter_types_array{$member_name}}, $type; 106 $first = 0; 107 $argnum++; 108 } 109 } 110 } 111 112 # 113 # Now pick apart the return type, parameter types, and parameter names for each HAL wrapper 114 # 115 foreach $proto (keys %custom_wrappers) { 116 $proto =~ /^((?:(?:const|struct|\*))*\s*[^\s]+)[\s]*([^\(]*)\((.*)\)/; 117 my $return_type = $1; 118 my $wrapper_name = $2; 119 my $parameterlist = $3; 120 $wrapper_functionname_to_return_type{$wrapper_name} = $return_type; 121 $wrapper_functionname_to_expression{$wrapper_name} = $custom_wrappers{$proto}; 122 @{$wrapper_functionname_to_parameter_name_array{$wrapper_name}} = (); 123 @{$wrapper_functionname_to_parameter_types_array{$wrapper_name}} = (); 124 my @parameters = split /,\s?/, $parameterlist; 125 $argnum = 0; 126 $first = 1; 127 foreach(@parameters) { 128 $_ =~ s/ \*/\* /; 129 $_ =~ /^((?:(?:const|struct|\*)\s*)*)([^\s]+\*?)\s*([^\s]*)\s*/; 130 my $type = "$1$2"; 131 my $name = "$3"; 132 if(0 == length($name)) { 133 if($argnum == 0 && $type =~ /ath_hal/) { 134 $name = "ah"; 135 } 136 else { 137 $name = "a" . $argnum; 138 } 139 } 140 141 push @{$wrapper_functionname_to_parameter_name_array{$wrapper_name}}, $name; 142 push @{$wrapper_functionname_to_parameter_types_array{$wrapper_name}}, $type; 143 $first = 0; 144 $argnum++; 145 } 146 } 147 148 # 149 # Generate the header file 150 # 151 print ATH_HAL_API_H $header_for_h; 152 153 for $member_name (keys %hal_functionname_to_return_type) { 154 my $api_return_type = $hal_functionname_to_return_type{$member_name}; 155 my $api_name = $member_name; 156 if(exists $hal_function_name_to_madwifi_name{$member_name}) { 157 $api_name = $hal_function_name_to_madwifi_name{$member_name}; 158 } 159 print ATH_HAL_API_H "static inline " . $api_return_type . " " . $api_name . "("; 160 my @names = @{$hal_functionname_to_parameter_name_array{$member_name}}; 161 my @types = @{$hal_functionname_to_parameter_types_array{$member_name}}; 162 for $i (0..$#names) { 163 if($i) { 164 print ATH_HAL_API_H ", "; 165 } 166 print ATH_HAL_API_H $types[$i] . " " . $names[$i]; 167 } 168 print ATH_HAL_API_H ") {"; 169 if(! ($api_return_type =~ /void/ )) { 170 print ATH_HAL_API_H "\n\t" . $api_return_type . " ret;"; 171 } 172 print ATH_HAL_API_H "\n\tATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah));"; 173 print ATH_HAL_API_H "\n\t"; 174 if(! ($api_return_type =~ /void/ )) { 175 print ATH_HAL_API_H "ret = "; 176 } 177 178 print ATH_HAL_API_H "ah->$member_name("; 179 for $j (0..$#names) { 180 if($j) { 181 print ATH_HAL_API_H ", "; 182 } 183 print ATH_HAL_API_H $names[$j]; 184 } 185 print ATH_HAL_API_H ");"; 186 print ATH_HAL_API_H "\n\tATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah));"; 187 if(! ($api_return_type =~ /void/ )) { 188 print ATH_HAL_API_H "\n\treturn ret;"; 189 } 190 print ATH_HAL_API_H "\n};\n"; 191 } 192 print ATH_HAL_API_H <<EOF 193 /* 194 These custom wrappers are defined in scripts/regenerate_ath_hal_api.pl and are used 195 as shortcut accessors for HAL functions. 196 */ 197 EOF 198 ; 199 for $wrapper_name (keys %wrapper_functionname_to_return_type) { 200 my $api_return_type = $wrapper_functionname_to_return_type{$wrapper_name}; 201 my $api_name = $wrapper_name; 202 if(exists $hal_function_name_to_madwifi_name{$wrapper_name}) { 203 $api_name = $hal_function_name_to_madwifi_name{$wrapper_name}; 204 } 205 print ATH_HAL_API_H "static inline " . $api_return_type . " " . $api_name . "("; 206 my @names = @{$wrapper_functionname_to_parameter_name_array{$wrapper_name}}; 207 my @types = @{$wrapper_functionname_to_parameter_types_array{$wrapper_name}}; 208 for $i (0..$#names) { 209 if($i) { 210 print ATH_HAL_API_H ", "; 211 } 212 print ATH_HAL_API_H $types[$i] . " " . $names[$i]; 213 } 214 print ATH_HAL_API_H ") {"; 215 print ATH_HAL_API_H "\n\t"; 216 if(! ($api_return_type =~ /void/ )) { 217 print ATH_HAL_API_H "return "; 218 } 219 print ATH_HAL_API_H "(" . $wrapper_functionname_to_expression{"$wrapper_name"} . ");"; 220 print ATH_HAL_API_H "\n};\n"; 221 } 222 223 print ATH_HAL_API_H $footer_for_h; 224 225 # 226 # Generate the implementation file 227 # 228 print ATH_HAL_API_C $header_for_c; 229 #foreach (<AH_H>) { 230 # print ATH_HAL_API_C "$_"; 231 #} 232 print ATH_HAL_API_C $footer_for_c; 233 234 # Close up the files 235 close AH_H; 236 close ATH_HAL_API_H; 237 close ATH_HAL_API_C; 238 -
ath_rate/onoe/onoe.c
old new 61 61 #include <net80211/ieee80211_rate.h> 62 62 63 63 #include "if_athvar.h" 64 #include "if_ath_hal.h" 64 65 #include "ah_desc.h" 65 66 66 67 #include "onoe.h" -
ath_rate/amrr/amrr.c
old new 65 65 #include <net80211/ieee80211_rate.h> 66 66 67 67 #include "if_athvar.h" 68 #include "if_ath_hal.h" 68 69 #include "ah_desc.h" 69 70 70 71 #include "amrr.h" -
ath_rate/sample/sample.c
old new 63 63 #include <net80211/ieee80211_rate.h> 64 64 65 65 #include "if_athvar.h" 66 #include "if_ath_hal.h" 66 67 #include "ah_desc.h" 67 68 68 69 #include "sample.h" -
ath_rate/minstrel/minstrel.c
old new 112 112 #include <net80211/ieee80211_rate.h> 113 113 114 114 #include "if_athvar.h" 115 #include "if_ath_hal.h" 115 116 #include "ah_desc.h" 116 117 117 118 #include "minstrel.h" -
ath_hal/ah_os.h
old new 38 38 #ifndef _ATH_AH_OS_H_ 39 39 #define _ATH_AH_OS_H_ 40 40 41 #include <ah.h>42 43 41 /* 44 42 * Atheros Hardware Access Layer (HAL) OS Dependent Definitions. 45 43 */ 46 44 45 /* 46 MadWifi safe register operations: 47 48 When hacking on registers directly we need to use the macros 49 below, to avoid concurrent PCI access and abort mode errors. 50 51 * ath_reg_read 52 * ATH_REG_WRITE 53 54 HAL-ONLY register operations: 55 56 * _OS_REG_READ 57 * _OS_REG_WRITE 58 * OS_REG_READ 59 * OS_REG_WRITE 60 * ath_hal_reg_read. 61 * ath_hal_reg_write 62 63 When compiled in HAL: 64 * We do not require locking overhead and function call unless user is debugging. 65 * All HAL operations are executed in the context of a MadWifi wrapper call which holds 66 the HAL lock. 67 * Normally HAL is build with the non-modified version of this file so it doesnt have our 68 funny macros anyway. 69 70 When compiled in MadWifi: 71 * The HAL wrapper API takes the HAL lock before invoking the HAL. 72 * HAL access is already protected, and MadWifi must NOT access the functions listed above. 73 74 */ 75 47 76 /* 48 77 * When building the HAL proper we use no GPL-contaminated include 49 78 * files and must define these types ourself. Beware of these being … … 143 172 * never byte-swapped by PCI chipsets or bridges, but always 144 173 * written directly (i.e. the format defined by the manufacturer). 145 174 */ 146 147 175 #if (AH_BYTE_ORDER == AH_BIG_ENDIAN) 148 176 #define _OS_REG_WRITE(_ah, _reg, _val) do { \ 149 177 (0x4000 <= (_reg) && (_reg) < 0x5000) ? \ … … 164 192 readl((_ah)->ah_sh + (_reg)) 165 193 #endif /* AH_BYTE_ORDER */ 166 194 195 /* 196 The functions in this section are not intended to be invoked by MadWifi driver 197 code, but by the HAL. They are NOT safe for direct invocation when the 198 sc->sc_hal_lock is not held. Use ath_reg_read and ATH_REG_WRITE instead! 199 */ 167 200 #if defined(AH_DEBUG) || defined(AH_REGOPS_FUNC) || defined(AH_DEBUG_ALQ) 168 /* use functions to do register operations */169 201 #define OS_REG_WRITE(_ah, _reg, _val) ath_hal_reg_write(_ah, _reg, _val) 170 202 #define OS_REG_READ(_ah, _reg) ath_hal_reg_read(_ah, _reg) 171 172 extern void __ahdecl ath_hal_reg_write(struct ath_hal *ah, 173 u_int reg, u_int32_t val); 203 extern void __ahdecl ath_hal_reg_write(struct ath_hal *ah, u_int reg, u_int32_t val); 174 204 extern u_int32_t __ahdecl ath_hal_reg_read(struct ath_hal *ah, u_int reg); 175 205 #else 176 /* inline register operations */177 206 #define OS_REG_WRITE(_ah, _reg, _val) _OS_REG_WRITE(_ah, _reg, _val) 178 207 #define OS_REG_READ(_ah, _reg) _OS_REG_READ(_ah, _reg) 179 208 #endif /* AH_DEBUG || AH_REGFUNC || AH_DEBUG_ALQ */ -
ath_hal/ah_os.c
old new 223 223 return ath_hal_setlogging(enable); 224 224 } 225 225 226 /* 227 This should only be called while holding the lock, sc->sc_hal_lock. 228 */ 226 229 static struct ale * 227 230 ath_hal_alq_get(struct ath_hal *ah) 228 231 { 229 232 struct ale *ale; 230 231 233 if (ath_hal_alq_emitdev) { 232 234 ale = alq_get(ath_hal_alq, ALQ_NOWAIT); 233 235 if (ale) { … … 247 249 return ale; 248 250 } 249 251 252 /* 253 This should only be called while holding the lock, sc->sc_hal_lock. 254 */ 250 255 void __ahdecl 251 256 ath_hal_reg_write(struct ath_hal *ah, u_int32_t reg, u_int32_t val) 252 257 { … … 269 274 } 270 275 EXPORT_SYMBOL(ath_hal_reg_write); 271 276 277 /* 278 This should only be called while holding the lock, sc->sc_hal_lock. 279 */ 272 280 u_int32_t __ahdecl 273 281 ath_hal_reg_read(struct ath_hal *ah, u_int32_t reg) 274 282 { 275 283 u_int32_t val; 276 277 284 val = _OS_REG_READ(ah, reg); 278 285 if (ath_hal_alq) { 279 286 unsigned long flags; 280 287 struct ale *ale; 281 288 282 local_irq_save(flags);283 289 ale = ath_hal_alq_get(ah); 284 290 if (ale) { 285 291 struct athregrec *r = (struct athregrec *) ale->ae_data; … … 288 294 r->val = val; 289 295 alq_post(ath_hal_alq, ale); 290 296 } 291 local_irq_restore(flags);292 297 } 293 298 return val; 294 299 } 295 300 EXPORT_SYMBOL(ath_hal_reg_read); 296 301 302 /* 303 * This should only be called while holding the lock, sc->sc_hal_lock. 304 */ 297 305 void __ahdecl 298 306 OS_MARK(struct ath_hal *ah, u_int id, u_int32_t v) 299 307 { 300 308 if (ath_hal_alq) { 301 unsigned long flags;302 309 struct ale *ale; 303 310 304 local_irq_save(flags);305 311 ale = ath_hal_alq_get(ah); 306 312 if (ale) { 307 313 struct athregrec *r = (struct athregrec *) ale->ae_data; … … 310 316 r->val = v; 311 317 alq_post(ath_hal_alq, ale); 312 318 } 313 local_irq_restore(flags);314 319 } 315 320 } 316 321 EXPORT_SYMBOL(OS_MARK); … … 322 327 * for architectures that might need to do something before 323 328 * referencing memory (e.g. remap an i/o window). 324 329 * 330 * This should only be called while holding the lock, sc->sc_hal_lock. 331 * 325 332 * NB: see the comments in ah_osdep.h about byte-swapping register 326 333 * reads and writes to understand what's going on below. 327 334 */ … … 336 343 } 337 344 EXPORT_SYMBOL(ath_hal_reg_write); 338 345 346 /* 347 This should only be called while holding the lock, sc->sc_hal_lock. 348 */ 339 349 u_int32_t __ahdecl 340 350 ath_hal_reg_read(struct ath_hal *ah, u_int reg) 341 351 { -
ath_hal/Makefile
old new 49 49 include $(TOP)/Makefile.inc 50 50 51 51 obj-m += ath_hal.o 52 ath_hal-objs := ah_os.o ath_hal_api.o$(TARGET).hal.o52 ath_hal-objs := ah_os.o $(TARGET).hal.o 53 53 54 54 hostprogs-y := uudecode 55 55 -
ath/if_ath_hal.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 ath_hal_foo(ah,p1,p2,p3,...) turns into ah->ah_foo(p1,p2,p3,...) where ah_foo 7 * is a function pointer and a member of the struct ath_hal (usually named ah). 8 * 9 */ 10 11 #include "opt_ah.h" 12 13 #ifdef AH_HALOPS_FUNC 14 15 #ifndef AUTOCONF_INCLUDED 16 #include <linux/config.h> 17 #endif 18 #include <linux/version.h> 19 #include <linux/module.h> 20 #include <linux/init.h> 21 #include <linux/skbuff.h> 22 #include <linux/netdevice.h> 23 #include <linux/etherdevice.h> 24 #include <linux/random.h> 25 #include <linux/delay.h> 26 #include <linux/cache.h> 27 #include <linux/sysctl.h> 28 #include <linux/proc_fs.h> 29 #include <linux/if_arp.h> 30 #include <linux/rtnetlink.h> 31 #include <asm/uaccess.h> 32 33 #include "ath_hal_api.h" 34 35 #endif /* #ifndef AH_HALOPS_FUNC */ -
ath/if_ath_hal.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 ath_hal_foo(ah,p1,p2,p3,...) turns into ah->ah_foo(p1,p2,p3,...) where ah_foo 7 * is a function pointer and a member of the struct ath_hal (usually named ah). 8 * 9 */ 10 11 #ifndef _IF_ATH_HAL_H 12 #define _IF_ATH_HAL_H 13 14 #define GET_ATH_SOFTC(_ah) ((struct ath_softc*)(_ah->ah_sc)) 15 #define ATH_HAL_LOCK_INIT(_sc) spin_lock_init(&(_sc)->sc_hal_lock) 16 #define ATH_HAL_LOCK_DESTROY(_sc) 17 #define ATH_HAL_LOCK_IRQ(_sc) do { \ 18 unsigned long __sc_halLockflags; \ 19 spin_lock_irqsave(&(_sc)->sc_hal_lock, __sc_halLockflags); 20 #define ATH_HAL_UNLOCK_IRQ(_sc) \ 21 spin_unlock_irqrestore(&(_sc)->sc_hal_lock, __sc_halLockflags); \ 22 } while(0) 23 #define ATH_HAL_UNLOCK_IRQ_EARLY(_sc) \ 24 spin_unlock_irqrestore(&(_sc)->sc_hal_lock, __sc_halLockflags); 25 26 static inline void 27 ath_reg_write(struct ath_softc *sc, u_int reg, u_int32_t val) { 28 ATH_HAL_LOCK_IRQ(sc); 29 OS_REG_WRITE(sc->sc_ah, reg, val); 30 ATH_HAL_UNLOCK_IRQ(sc); 31 } 32 33 static inline u_int32_t 34 ath_reg_read(struct ath_softc *sc, u_int reg) { 35 u_int32_t ret; 36 ATH_HAL_LOCK_IRQ(sc); 37 ret = OS_REG_READ(sc->sc_ah, reg); 38 ATH_HAL_UNLOCK_IRQ(sc); 39 return ret; 40 } 41 42 /* 43 These wrappers are generated by scripts/regenerate_ath_hal_api.pl and are used 44 to protect access to the HAL with locking as well as providing improved 45 debugging support, despite obfuscation. 46 */ 47 static inline void ath_hal_getmac(struct ath_hal* ah, u_int8_t* a1) { 48 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 49 ah->ah_getMacAddress(ah, a1); 50 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 51 }; 52 static inline HAL_POWER_MODE ath_hal_getPowerMode(struct ath_hal* ah) { 53 HAL_POWER_MODE ret; 54 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 55 ret = ah->ah_getPowerMode(ah); 56 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 57 return ret; 58 }; 59 static inline HAL_BOOL ath_hal_getdiagstate(struct ath_hal* ah, int request, const void* args, u_int32_t argsize, void* *result, u_int32_t* resultsize) { 60 HAL_BOOL ret; 61 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 62 ret = ah->ah_getDiagState(ah, request, args, argsize, *result, resultsize); 63 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 64 return ret; 65 }; 66 static inline void ath_hal_beaconreset(struct ath_hal* ah) { 67 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 68 ah->ah_resetStationBeaconTimers(ah); 69 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 70 }; 71 static inline void ath_hal_setcoverageclass(struct ath_hal* ah, u_int8_t a1, int a2) { 72 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 73 ah->ah_setCoverageClass(ah, a1, a2); 74 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 75 }; 76 static inline u_int64_t ath_hal_gettsf64(struct ath_hal* ah) { 77 u_int64_t ret; 78 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 79 ret = ah->ah_getTsf64(ah); 80 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 81 return ret; 82 }; 83 static inline void ath_hal_rxena(struct ath_hal* ah) { 84 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 85 ah->ah_enableReceive(ah); 86 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 87 }; 88 static inline HAL_ANT_SETTING ath_hal_getantennaswitch(struct ath_hal* ah) { 89 HAL_ANT_SETTING ret; 90 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 91 ret = ah->ah_getAntennaSwitch(ah); 92 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 93 return ret; 94 }; 95 static inline HAL_BOOL ath_hal_gpioset(struct ath_hal* ah, u_int32_t gpio, u_int32_t val) { 96 HAL_BOOL ret; 97 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 98 ret = ah->ah_gpioSet(ah, gpio, val); 99 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 100 return ret; 101 }; 102 static inline HAL_BOOL ath_hal_gpioCfgOutput(struct ath_hal* ah, u_int32_t gpio) { 103 HAL_BOOL ret; 104 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 105 ret = ah->ah_gpioCfgOutput(ah, gpio); 106 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 107 return ret; 108 }; 109 static inline HAL_BOOL ath_hal_clearmcastfilter(struct ath_hal* ah, u_int32_t index) { 110 HAL_BOOL ret; 111 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 112 ret = ah->ah_clrMulticastFilterIndex(ah, index); 113 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 114 return ret; 115 }; 116 static inline void ath_hal_txreqintrdesc(struct ath_hal* ah, struct ath_desc* a1) { 117 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 118 ah->ah_reqTxIntrDesc(ah, a1); 119 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 120 }; 121 static inline void ath_hal_rxmonitor(struct ath_hal* ah, const HAL_NODE_STATS* a1, HAL_CHANNEL* a2) { 122 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 123 ah->ah_rxMonitor(ah, a1, a2); 124 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 125 }; 126 static inline HAL_BOOL ath_hal_puttxbuf(struct ath_hal* ah, u_int a1, u_int32_t txdp) { 127 HAL_BOOL ret; 128 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 129 ret = ah->ah_setTxDP(ah, a1, txdp); 130 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 131 return ret; 132 }; 133 static inline HAL_BOOL ath_hal_keyset(struct ath_hal* ah, u_int16_t a1, const HAL_KEYVAL* a2, const u_int8_t* a3, int a4) { 134 HAL_BOOL ret; 135 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 136 ret = ah->ah_setKeyCacheEntry(ah, a1, a2, a3, a4); 137 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 138 return ret; 139 }; 140 static inline void ath_hal_setopmode(struct ath_hal* ah) { 141 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 142 ah->ah_setPCUConfig(ah); 143 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 144 }; 145 static inline HAL_RFGAIN ath_hal_getrfgain(struct ath_hal* ah) { 146 HAL_RFGAIN ret; 147 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 148 ret = ah->ah_getRfGain(ah); 149 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 150 return ret; 151 }; 152 static inline void ath_hal_setmcastfilter(struct ath_hal* ah, u_int32_t filter0, u_int32_t filter1) { 153 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 154 ah->ah_setMulticastFilter(ah, filter0, filter1); 155 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 156 }; 157 static inline u_int ath_hal_getacktimeout(struct ath_hal* ah) { 158 u_int ret; 159 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 160 ret = ah->ah_getAckTimeout(ah); 161 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 162 return ret; 163 }; 164 static inline void ath_hal_beacontimers(struct ath_hal* ah, const HAL_BEACON_STATE* a1) { 165 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 166 ah->ah_setStationBeaconTimers(ah, a1); 167 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 168 }; 169 static inline HAL_BOOL ath_hal_detectcardpresent(struct ath_hal* ah) { 170 HAL_BOOL ret; 171 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 172 ret = ah->ah_detectCardPresent(ah); 173 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 174 return ret; 175 }; 176 static inline u_int ath_hal_getslottime(struct ath_hal* ah) { 177 u_int ret; 178 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 179 ret = ah->ah_getSlotTime(ah); 180 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 181 return ret; 182 }; 183 static inline void ath_hal_beaconinit(struct ath_hal* ah, u_int32_t nexttbtt, u_int32_t intval) { 184 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 185 ah->ah_beaconInit(ah, nexttbtt, intval); 186 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 187 }; 188 static inline void ath_hal_gpiosetintr(struct ath_hal* ah, u_int a1, u_int32_t a2) { 189 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 190 ah->ah_gpioSetIntr(ah, a1, a2); 191 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 192 }; 193 static inline HAL_BOOL ath_hal_releasetxqueue(struct ath_hal* ah, u_int q) { 194 HAL_BOOL ret; 195 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 196 ret = ah->ah_releaseTxQueue(ah, q); 197 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 198 return ret; 199 }; 200 static inline HAL_BOOL ath_hal_keysetmac(struct ath_hal* ah, u_int16_t a1, const u_int8_t* a2) { 201 HAL_BOOL ret; 202 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 203 ret = ah->ah_setKeyCacheEntryMac(ah, a1, a2); 204 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 205 return ret; 206 }; 207 static inline HAL_STATUS ath_hal_txprocdesc(struct ath_hal* ah, struct ath_desc* a1, struct ath_tx_status* a2) { 208 HAL_STATUS ret; 209 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 210 ret = ah->ah_procTxDesc(ah, a1, a2); 211 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 212 return ret; 213 }; 214 static inline HAL_INT ath_hal_intrget(struct ath_hal* ah) { 215 HAL_INT ret; 216 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 217 ret = ah->ah_getInterrupts(ah); 218 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 219 return ret; 220 }; 221 static inline HAL_BOOL ath_hal_setacktimeout(struct ath_hal* ah, u_int a1) { 222 HAL_BOOL ret; 223 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 224 ret = ah->ah_setAckTimeout(ah, a1); 225 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 226 return ret; 227 }; 228 static inline HAL_BOOL ath_hal_setbssidmask(struct ath_hal* ah, const u_int8_t* a1) { 229 HAL_BOOL ret; 230 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 231 ret = ah->ah_setBssIdMask(ah, a1); 232 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 233 return ret; 234 }; 235 static inline HAL_BOOL ath_hal_setackctsrate(struct ath_hal* ah, u_int a1) { 236 HAL_BOOL ret; 237 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 238 ret = ah->ah_setAckCTSRate(ah, a1); 239 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 240 return ret; 241 }; 242 static inline u_int32_t ath_hal_getrxfilter(struct ath_hal* ah) { 243 u_int32_t ret; 244 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 245 ret = ah->ah_getRxFilter(ah); 246 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 247 return ret; 248 }; 249 static inline int16_t ath_hal_get_channel_noise(struct ath_hal* ah, HAL_CHANNEL* a1) { 250 int16_t ret; 251 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 252 ret = ah->ah_getChanNoise(ah, a1); 253 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 254 return ret; 255 }; 256 static inline HAL_BOOL ath_hal_keyreset(struct ath_hal* ah, u_int16_t a1) { 257 HAL_BOOL ret; 258 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 259 ret = ah->ah_resetKeyCacheEntry(ah, a1); 260 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 261 return ret; 262 }; 263 static inline HAL_BOOL ath_hal_setantennaswitch(struct ath_hal* ah, HAL_ANT_SETTING a1) { 264 HAL_BOOL ret; 265 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 266 ret = ah->ah_setAntennaSwitch(ah, a1); 267 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 268 return ret; 269 }; 270 static inline HAL_BOOL ath_hal_settxqueueprops(struct ath_hal* ah, int q, const HAL_TXQ_INFO* qInfo) { 271 HAL_BOOL ret; 272 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 273 ret = ah->ah_setTxQueueProps(ah, q, qInfo); 274 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 275 return ret; 276 }; 277 static inline void ath_hal_putrxbuf(struct ath_hal* ah, u_int32_t rxdp) { 278 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 279 ah->ah_setRxDP(ah, rxdp); 280 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 281 }; 282 static inline HAL_BOOL ath_hal_reset(struct ath_hal* ah, HAL_OPMODE a1, HAL_CHANNEL* a2, HAL_BOOL bChannelChange, HAL_STATUS* status) { 283 HAL_BOOL ret; 284 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 285 ret = ah->ah_reset(ah, a1, a2, bChannelChange, status); 286 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 287 return ret; 288 }; 289 static inline HAL_BOOL ath_hal_setdecompmask(struct ath_hal* ah, u_int16_t a1, int a2) { 290 HAL_BOOL ret; 291 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 292 ret = ah->ah_setDecompMask(ah, a1, a2); 293 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 294 return ret; 295 }; 296 static inline HAL_BOOL ath_hal_gettxqueueprops(struct ath_hal* ah, int q, HAL_TXQ_INFO* qInfo) { 297 HAL_BOOL ret; 298 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 299 ret = ah->ah_getTxQueueProps(ah, q, qInfo); 300 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 301 return ret; 302 }; 303 static inline HAL_BOOL ath_hal_filltxdesc(struct ath_hal* ah, struct ath_desc* a1, u_int segLen, HAL_BOOL firstSeg, HAL_BOOL lastSeg, const struct ath_desc* a5) { 304 HAL_BOOL ret; 305 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 306 ret = ah->ah_fillTxDesc(ah, a1, segLen, firstSeg, lastSeg, a5); 307 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 308 return ret; 309 }; 310 static inline u_int32_t ath_hal_numtxpending(struct ath_hal* ah, u_int q) { 311 u_int32_t ret; 312 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 313 ret = ah->ah_numTxPending(ah, q); 314 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 315 return ret; 316 }; 317 static inline void ath_hal_startpcurecv(struct ath_hal* ah) { 318 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 319 ah->ah_startPcuReceive(ah); 320 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 321 }; 322 static inline void ath_hal_setdefantenna(struct ath_hal* ah, u_int a1) { 323 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 324 ah->ah_setDefAntenna(ah, a1); 325 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 326 }; 327 static inline HAL_BOOL ath_hal_setpower(struct ath_hal* ah, HAL_POWER_MODE mode, int setChip) { 328 HAL_BOOL ret; 329 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 330 ret = ah->ah_setPowerMode(ah, mode, setChip); 331 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 332 return ret; 333 }; 334 static inline HAL_STATUS ath_hal_rxprocdesc(struct ath_hal* ah, struct ath_desc* a1, u_int32_t phyAddr, struct ath_desc* next, u_int64_t tsf, struct ath_rx_status* a5) { 335 HAL_STATUS ret; 336 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 337 ret = ah->ah_procRxDesc(ah, a1, phyAddr, next, tsf, a5); 338 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 339 return ret; 340 }; 341 static inline u_int ath_hal_getackctsrate(struct ath_hal* ah) { 342 u_int ret; 343 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 344 ret = ah->ah_getAckCTSRate(ah); 345 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 346 return ret; 347 }; 348 static inline u_int32_t ath_hal_keycachesize(struct ath_hal* ah) { 349 u_int32_t ret; 350 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 351 ret = ah->ah_getKeyCacheSize(ah); 352 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 353 return ret; 354 }; 355 static inline HAL_BOOL ath_hal_setupxtxdesc(struct ath_hal* ah, struct ath_desc* a1, u_int txRate1, u_int txTries1, u_int txRate2, u_int txTries2, u_int txRate3, u_int txTries3) { 356 HAL_BOOL ret; 357 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 358 ret = ah->ah_setupXTxDesc(ah, a1, txRate1, txTries1, txRate2, txTries2, txRate3, txTries3); 359 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 360 return ret; 361 }; 362 static inline HAL_INT ath_hal_intrset(struct ath_hal* ah, HAL_INT a1) { 363 HAL_INT ret; 364 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 365 ret = ah->ah_setInterrupts(ah, a1); 366 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 367 return ret; 368 }; 369 static inline u_int ath_hal_getctstimeout(struct ath_hal* ah) { 370 u_int ret; 371 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 372 ret = ah->ah_getCTSTimeout(ah); 373 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 374 return ret; 375 }; 376 static inline void ath_hal_updatemibcounters(struct ath_hal* ah, HAL_MIB_STATS* a1) { 377 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 378 ah->ah_updateMibCounters(ah, a1); 379 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 380 }; 381 static inline HAL_BOOL ath_hal_calibrate(struct ath_hal* ah, HAL_CHANNEL* a1, HAL_BOOL* a2) { 382 HAL_BOOL ret; 383 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 384 ret = ah->ah_perCalibration(ah, a1, a2); 385 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 386 return ret; 387 }; 388 static inline u_int32_t ath_hal_getrxbuf(struct ath_hal* ah) { 389 u_int32_t ret; 390 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 391 ret = ah->ah_getRxDP(ah); 392 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 393 return ret; 394 }; 395 static inline HAL_BOOL ath_hal_settxpowlimit(struct ath_hal* ah, u_int32_t a1) { 396 HAL_BOOL ret; 397 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 398 ret = ah->ah_setTxPowerLimit(ah, a1); 399 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 400 return ret; 401 }; 402 static inline HAL_BOOL ath_hal_getisr(struct ath_hal* ah, HAL_INT* a1) { 403 HAL_BOOL ret; 404 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 405 ret = ah->ah_getPendingInterrupts(ah, a1); 406 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 407 return ret; 408 }; 409 static inline HAL_BOOL ath_hal_updatetxtriglevel(struct ath_hal* ah, HAL_BOOL incTrigLevel) { 410 HAL_BOOL ret; 411 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 412 ret = ah->ah_updateTxTrigLevel(ah, incTrigLevel); 413 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 414 return ret; 415 }; 416 static inline HAL_BOOL ath_hal_resettxqueue(struct ath_hal* ah, u_int q) { 417 HAL_BOOL ret; 418 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 419 ret = ah->ah_resetTxQueue(ah, q); 420 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 421 return ret; 422 }; 423 static inline HAL_BOOL ath_hal_setmac(struct ath_hal* ah, const u_int8_t* a1) { 424 HAL_BOOL ret; 425 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 426 ret = ah->ah_setMacAddress(ah, a1); 427 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 428 return ret; 429 }; 430 static inline HAL_BOOL ath_hal_setctstimeout(struct ath_hal* ah, u_int a1) { 431 HAL_BOOL ret; 432 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 433 ret = ah->ah_setCTSTimeout(ah, a1); 434 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 435 return ret; 436 }; 437 static inline const HAL_RATE_TABLE * ath_hal_getratetable(struct ath_hal* ah, u_int mode) { 438 const HAL_RATE_TABLE * ret; 439 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 440 ret = ah->ah_getRateTable(ah, mode); 441 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 442 return ret; 443 }; 444 static inline u_int32_t ath_hal_gettsf32(struct ath_hal* ah) { 445 u_int32_t ret; 446 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 447 ret = ah->ah_getTsf32(ah); 448 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 449 return ret; 450 }; 451 static inline void ath_hal_mibevent(struct ath_hal* ah, const HAL_NODE_STATS* a1) { 452 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 453 ah->ah_procMibEvent(ah, a1); 454 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 455 }; 456 static inline void ath_hal_setbeacontimers(struct ath_hal* ah, const HAL_BEACON_TIMERS* a1) { 457 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 458 ah->ah_setBeaconTimers(ah, a1); 459 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 460 }; 461 static inline HAL_STATUS ath_hal_getcapability(struct ath_hal* ah, HAL_CAPABILITY_TYPE a1, u_int32_t capability, u_int32_t* result) { 462 HAL_STATUS ret; 463 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 464 ret = ah->ah_getCapability(ah, a1, capability, result); 465 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 466 return ret; 467 }; 468 static inline HAL_BOOL ath_hal_radar_wait(struct ath_hal* ah, HAL_CHANNEL* a1) { 469 HAL_BOOL ret; 470 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 471 ret = ah->ah_radarWait(ah, a1); 472 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 473 return ret; 474 }; 475 static inline HAL_BOOL ath_hal_setmcastfilterindex(struct ath_hal* ah, u_int32_t index) { 476 HAL_BOOL ret; 477 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 478 ret = ah->ah_setMulticastFilterIndex(ah, index); 479 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 480 return ret; 481 }; 482 static inline void ath_hal_getbssidmask(struct ath_hal* ah, u_int8_t* a1) { 483 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 484 ah->ah_getBssIdMask(ah, a1); 485 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 486 }; 487 static inline HAL_BOOL ath_hal_intrpend(struct ath_hal* ah) { 488 HAL_BOOL ret; 489 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 490 ret = ah->ah_isInterruptPending(ah); 491 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 492 return ret; 493 }; 494 static inline HAL_BOOL ath_hal_txstart(struct ath_hal* ah, u_int a1) { 495 HAL_BOOL ret; 496 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 497 ret = ah->ah_startTxDma(ah, a1); 498 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 499 return ret; 500 }; 501 static inline void ath_hal_gettxintrtxqs(struct ath_hal* ah, u_int32_t* a1) { 502 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 503 ah->ah_getTxIntrQueue(ah, a1); 504 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 505 }; 506 static inline HAL_BOOL ath_hal_setslottime(struct ath_hal* ah, u_int a1) { 507 HAL_BOOL ret; 508 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 509 ret = ah->ah_setSlotTime(ah, a1); 510 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 511 return ret; 512 }; 513 static inline void ath_hal_setledstate(struct ath_hal* ah, HAL_LED_STATE a1) { 514 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 515 ah->ah_setLedState(ah, a1); 516 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 517 }; 518 static inline void ath_hal_setassocid(struct ath_hal* ah, const u_int8_t* bssid, u_int16_t assocId) { 519 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 520 ah->ah_writeAssocid(ah, bssid, assocId); 521 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 522 }; 523 static inline void ath_hal_resettsf(struct ath_hal* ah) { 524 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 525 ah->ah_resetTsf(ah); 526 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 527 }; 528 static inline HAL_BOOL ath_hal_setuprxdesc(struct ath_hal* ah, struct ath_desc* a1, u_int32_t size, u_int flags) { 529 HAL_BOOL ret; 530 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 531 ret = ah->ah_setupRxDesc(ah, a1, size, flags); 532 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 533 return ret; 534 }; 535 static inline void ath_hal_setrxfilter(struct ath_hal* ah, u_int32_t a1) { 536 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 537 ah->ah_setRxFilter(ah, a1); 538 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 539 }; 540 static inline HAL_BOOL ath_hal_keyisvalid(struct ath_hal* ah, u_int16_t a1) { 541 HAL_BOOL ret; 542 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 543 ret = ah->ah_isKeyCacheEntryValid(ah, a1); 544 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 545 return ret; 546 }; 547 static inline void ath_hal_stoppcurecv(struct ath_hal* ah) { 548 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 549 ah->ah_stopPcuReceive(ah); 550 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 551 }; 552 static inline HAL_BOOL ath_hal_stoptxdma(struct ath_hal* ah, u_int a1) { 553 HAL_BOOL ret; 554 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 555 ret = ah->ah_stopTxDma(ah, a1); 556 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 557 return ret; 558 }; 559 static inline HAL_BOOL ath_hal_setcapability(struct ath_hal* ah, HAL_CAPABILITY_TYPE a1, u_int32_t capability, u_int32_t setting, HAL_STATUS* a4) { 560 HAL_BOOL ret; 561 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 562 ret = ah->ah_setCapability(ah, a1, capability, setting, a4); 563 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 564 return ret; 565 }; 566 static inline HAL_BOOL ath_hal_stopdmarecv(struct ath_hal* ah) { 567 HAL_BOOL ret; 568 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 569 ret = ah->ah_stopDmaReceive(ah); 570 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 571 return ret; 572 }; 573 static inline u_int32_t ath_hal_gettxbuf(struct ath_hal* ah, u_int a1) { 574 u_int32_t ret; 575 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 576 ret = ah->ah_getTxDP(ah, a1); 577 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 578 return ret; 579 }; 580 static inline int ath_hal_setuptxqueue(struct ath_hal* ah, HAL_TX_QUEUE a1, const HAL_TXQ_INFO* qInfo) { 581 int ret; 582 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 583 ret = ah->ah_setupTxQueue(ah, a1, qInfo); 584 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 585 return ret; 586 }; 587 static inline u_int ath_hal_getdefantenna(struct ath_hal* ah) { 588 u_int ret; 589 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 590 ret = ah->ah_getDefAntenna(ah); 591 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 592 return ret; 593 }; 594 static inline HAL_BOOL ath_hal_phydisable(struct ath_hal* ah) { 595 HAL_BOOL ret; 596 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 597 ret = ah->ah_phyDisable(ah); 598 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 599 return ret; 600 }; 601 static inline HAL_BOOL ath_hal_setregulatorydomain(struct ath_hal* ah, u_int16_t a1, HAL_STATUS* a2) { 602 HAL_BOOL ret; 603 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 604 ret = ah->ah_setRegulatoryDomain(ah, a1, a2); 605 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 606 return ret; 607 }; 608 static inline HAL_BOOL ath_hal_setuptxdesc(struct ath_hal* ah, struct ath_desc* a1, u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int txPower, u_int txRate0, u_int txTries0, u_int keyIx, u_int antMode, u_int flags, u_int rtsctsRate, u_int rtsctsDuration, u_int compicvLen, u_int compivLen, u_int comp) { 609 HAL_BOOL ret; 610 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 611 ret = ah->ah_setupTxDesc(ah, a1, pktLen, hdrLen, type, txPower, txRate0, txTries0, keyIx, antMode, flags, rtsctsRate, rtsctsDuration, compicvLen, compivLen, comp); 612 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 613 return ret; 614 }; 615 static inline HAL_BOOL ath_hal_gpiCfgInput(struct ath_hal* ah, u_int32_t gpio) { 616 HAL_BOOL ret; 617 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 618 ret = ah->ah_gpioCfgInput(ah, gpio); 619 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 620 return ret; 621 }; 622 static inline u_int32_t ath_hal_gpioget(struct ath_hal* ah, u_int32_t gpio) { 623 u_int32_t ret; 624 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 625 ret = ah->ah_gpioGet(ah, gpio); 626 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 627 return ret; 628 }; 629 static inline HAL_BOOL ath_hal_disable(struct ath_hal* ah) { 630 HAL_BOOL ret; 631 ATH_HAL_LOCK_IRQ(GET_ATH_SOFTC(ah)); 632 ret = ah->ah_disable(ah); 633 ATH_HAL_UNLOCK_IRQ(GET_ATH_SOFTC(ah)); 634 return ret; 635 }; 636 /* 637 These custom wrappers are defined in scripts/regenerate_ath_hal_api.pl and are used 638 as shortcut accessors for HAL functions. 639 */ 640 static inline HAL_BOOL ath_hal_settpc(struct ath_hal* ah, u_int32_t v) { 641 return ((ath_hal_setcapability(ah, HAL_CAP_TPC, 1, v, NULL))); 642 }; 643 static inline HAL_BOOL ath_hal_gettsfadjust(struct ath_hal* ah) { 644 return ((ath_hal_getcapability(ah, HAL_CAP_TSF_ADJUST, 1, NULL) == HAL_OK)); 645 }; 646 static inline HAL_BOOL ath_hal_hasrfsilent(struct ath_hal* ah) { 647 return ((ath_hal_getcapability(ah, HAL_CAP_RFSILENT, 0, NULL) == HAL_OK)); 648 }; 649 static inline HAL_BOOL ath_hal_quarterrate_chansupported(struct ath_hal* ah) { 650 return ((ath_hal_getcapability(ah, HAL_CAP_CHAN_QUARTERRATE, 0, NULL) == HAL_OK)); 651 }; 652 static inline HAL_BOOL ath_hal_xrsupported(struct ath_hal* ah) { 653 return ((ath_hal_getcapability(ah, HAL_CAP_XR, 0, NULL) == HAL_OK)); 654 }; 655 static inline HAL_BOOL ath_hal_getmaxtxpow(struct ath_hal* ah, u_int32_t* destination) { 656 return ((ath_hal_getcapability(ah, HAL_CAP_TXPOW, 2, destination) == HAL_OK)); 657 }; 658 static inline HAL_BOOL ath_hal_gettkipmic(struct ath_hal* ah) { 659 return ((ath_hal_getcapability(ah, HAL_CAP_TKIP_MIC, 1, NULL) == HAL_OK)); 660 }; 661 static inline HAL_BOOL ath_hal_hasbssidmask(struct ath_hal* ah) { 662 return ((ath_hal_getcapability(ah, HAL_CAP_BSSIDMASK, 0, NULL) == HAL_OK)); 663 }; 664 static inline HAL_BOOL ath_hal_settkipmic(struct ath_hal* ah, u_int32_t v) { 665 return ((ath_hal_setcapability(ah, HAL_CAP_TKIP_MIC, 1, v, NULL))); 666 }; 667 static inline HAL_BOOL ath_hal_hasdiversity(struct ath_hal* ah) { 668 return ((ath_hal_getcapability(ah, HAL_CAP_DIVERSITY, 0, NULL) == HAL_OK)); 669 }; 670 static inline HAL_BOOL ath_hal_getregdomain(struct ath_hal* ah, u_int32_t* destination) { 671 return ((ath_hal_getcapability(ah, HAL_CAP_REG_DMN, 0, destination))); 672 }; 673 static inline HAL_BOOL ath_hal_setdiversity(struct ath_hal* ah, int v) { 674 return ((ath_hal_setcapability(ah, HAL_CAP_DIVERSITY, 1, v, NULL))); 675 }; 676 static inline HAL_BOOL ath_hal_fastframesupported(struct ath_hal* ah) { 677 return ((ath_hal_getcapability(ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK)); 678 }; 679 static inline HAL_BOOL ath_hal_gettpscale(struct ath_hal* ah, u_int32_t* destination) { 680 return ((ath_hal_getcapability(ah, HAL_CAP_TXPOW, 3, destination) == HAL_OK)); 681 }; 682 static inline HAL_BOOL ath_hal_settkipsplit(struct ath_hal* ah, int v) { 683 return ((ath_hal_setcapability(ah, HAL_CAP_TKIP_SPLIT, 1, v, NULL))); 684 }; 685 static inline HAL_BOOL ath_hal_getnumtxqueues(struct ath_hal* ah, u_int32_t* destination) { 686 return ((ath_hal_getcapability(ah, HAL_CAP_NUM_TXQUEUES, 0, destination) == HAL_OK)); 687 }; 688 static inline HAL_BOOL ath_hal_compressionsupported(struct ath_hal* ah) { 689 return ((ath_hal_getcapability(ah, HAL_CAP_COMPRESSION, 0, NULL) == HAL_OK)); 690 }; 691 static inline HAL_BOOL ath_hal_burstsupported(struct ath_hal* ah) { 692 return ((ath_hal_getcapability(ah, HAL_CAP_BURST, 0, NULL) == HAL_OK)); 693 }; 694 static inline HAL_BOOL ath_hal_gettpc(struct ath_hal* ah) { 695 return ((ath_hal_getcapability(ah, HAL_CAP_TPC, 1, NULL) == HAL_OK)); 696 }; 697 static inline HAL_BOOL ath_hal_gettkipsplit(struct ath_hal* ah) { 698 return ((ath_hal_getcapability(ah, HAL_CAP_TKIP_SPLIT, 1, NULL) == HAL_OK)); 699 }; 700 static inline HAL_BOOL ath_hal_hastkipsplit(struct ath_hal* ah) { 701 return ((ath_hal_getcapability(ah, HAL_CAP_TKIP_SPLIT, 0, NULL) == HAL_OK)); 702 }; 703 static inline HAL_BOOL ath_hal_halfrate_chansupported(struct ath_hal* ah) { 704 return ((ath_hal_getcapability(ah, HAL_CAP_CHAN_HALFRATE, 0, NULL) == HAL_OK)); 705 }; 706 static inline HAL_BOOL ath_hal_getdiversity(struct ath_hal* ah) { 707 return ((ath_hal_getcapability(ah, HAL_CAP_DIVERSITY, 1, NULL) == HAL_OK)); 708 }; 709 static inline HAL_BOOL ath_hal_hwphycounters(struct ath_hal* ah) { 710 return ((ath_hal_getcapability(ah, HAL_CAP_PHYCOUNTERS, 0, NULL) == HAL_OK)); 711 }; 712 static inline HAL_BOOL ath_hal_hastsfadjust(struct ath_hal* ah) { 713 return ((ath_hal_getcapability(ah, HAL_CAP_TSF_ADJUST, 0, NULL) == HAL_OK)); 714 }; 715 static inline HAL_BOOL ath_hal_settpscale(struct ath_hal* ah, u_int32_t v) { 716 return ((ath_hal_setcapability(ah, HAL_CAP_TXPOW, 3, v, NULL))); 717 }; 718 static inline HAL_BOOL ath_hal_hasbursting(struct ath_hal* ah) { 719 return ((ath_hal_getcapability(ah, HAL_CAP_BURST, 0, NULL) == HAL_OK)); 720 }; 721 static inline HAL_BOOL ath_hal_settsfadjust(struct ath_hal* ah, u_int32_t v) { 722 return ((ath_hal_setcapability(ah, HAL_CAP_TSF_ADJUST, 1, v, NULL))); 723 }; 724 static inline HAL_BOOL ath_hal_hastxpowlimit(struct ath_hal* ah) { 725 return ((ath_hal_getcapability(ah, HAL_CAP_TXPOW, 0, NULL) == HAL_OK)); 726 }; 727 static inline HAL_BOOL ath_hal_setrfsilent(struct ath_hal* ah, u_int32_t v) { 728 return ((ath_hal_setcapability(ah, HAL_CAP_RFSILENT, 1, v, NULL))); 729 }; 730 static inline HAL_BOOL ath_hal_hasfastframes(struct ath_hal* ah) { 731 return ((ath_hal_getcapability(ah, HAL_CAP_FASTFRAME, 0, NULL) == HAL_OK)); 732 }; 733 static inline HAL_BOOL ath_hal_hasmcastkeysearch(struct ath_hal* ah) { 734 return ((ath_hal_getcapability(ah, HAL_CAP_MCAST_KEYSRCH, 0, NULL) == HAL_OK)); 735 }; 736 static inline HAL_BOOL ath_hal_turboagsupported(struct ath_hal* ah, int countrycode) { 737 return ((ath_hal_getwirelessmodes(ah, countrycode) & (HAL_MODE_108G|HAL_MODE_TURBO))); 738 }; 739 static inline HAL_BOOL ath_hal_hasveol(struct ath_hal* ah) { 740 return ((ath_hal_getcapability(ah, HAL_CAP_VEOL, 0, NULL) == HAL_OK)); 741 }; 742 static inline HAL_BOOL ath_hal_wmetkipmic(struct ath_hal* ah) { 743 return ((ath_hal_getcapability(ah, HAL_CAP_WME_TKIPMIC, 0, NULL) == HAL_OK)); 744 }; 745 static inline HAL_BOOL ath_hal_hascompression(struct ath_hal* ah) { 746 return ((ath_hal_getcapability(ah, HAL_CAP_COMPRESSION, 0, NULL) == HAL_OK)); 747 }; 748 static inline HAL_BOOL ath_hal_getmcastkeysearch(struct ath_hal* ah) { 749 return ((ath_hal_getcapability(ah, HAL_CAP_MCAST_KEYSRCH, 1, NULL) == HAL_OK)); 750 }; 751 static inline HAL_BOOL ath_hal_ciphersupported(struct ath_hal* ah, u_int32_t cipher) { 752 return ((ath_hal_getcapability(ah, HAL_CAP_CIPHER, cipher, NULL) == HAL_OK)); 753 }; 754 static inline HAL_BOOL ath_hal_gettxpowlimit(struct ath_hal* ah, u_int32_t* destination) { 755 return ((ath_hal_getcapability(ah, HAL_CAP_TXPOW, 1, destination) == HAL_OK)); 756 }; 757 static inline HAL_BOOL ath_hal_hastkipmic(struct ath_hal* ah) { 758 return ((ath_hal_getcapability(ah, HAL_CAP_TKIP_MIC, 0, NULL) == HAL_OK)); 759 }; 760 static inline HAL_BOOL ath_hal_hastpc(struct ath_hal* ah) { 761 return ((ath_hal_getcapability(ah, HAL_CAP_TPC, 0, NULL) == HAL_OK)); 762 }; 763 static inline HAL_BOOL ath_hal_getcountrycode(struct ath_hal* ah, u_int32_t* destination) { 764 return (((*(destination) = ah->ah_countryCode), AH_TRUE)); 765 }; 766 767 #endif /* _IF_ATH_HAL_H */ -
ath/if_athvar.h
old new 47 47 #include "ah_os.h" 48 48 #include "if_athioctl.h" 49 49 #include "net80211/ieee80211.h" /* XXX for WME_NUM_AC */ 50 #include <asm/io.h> 50 51 51 52 /* 52 53 * Deduce if tasklets are available. If not then … … 535 536 void (*sc_node_free)(struct ieee80211_node *); 536 537 void *sc_bdev; /* associated bus device */ 537 538 struct ath_hal *sc_ah; /* Atheros HAL */ 539 spinlock_t sc_hal_lock; /* hardware access lock */ 538 540 struct ath_ratectrl *sc_rc; /* tx rate control support */ 539 541 struct ath_tx99 *sc_tx99; /* tx99 support */ 540 542 void (*sc_setdefantenna)(struct ath_softc *, u_int); … … 737 739 void ath_sysctl_register(void); 738 740 void ath_sysctl_unregister(void); 739 741 740 #include "ath_hal_api.h"741 742 742 #endif /* _DEV_ATH_ATHVAR_H */ -
ath/if_ath.c
old new 91 91 #include "if_ath_ahb.h" 92 92 #endif /* AHB BUS */ 93 93 94 #include "ah.h" 95 #include "if_ath_hal.h" 96 94 97 #ifdef ATH_TX99_DIAG 95 98 #include "ath_tx99.h" 96 99 #endif … … 440 443 sc->sc_cachelsz = csz << 2; /* convert to bytes */ 441 444 442 445 ATH_LOCK_INIT(sc); 446 ATH_HAL_LOCK_INIT(sc); 443 447 ATH_TXBUF_LOCK_INIT(sc); 444 448 ATH_RXBUF_LOCK_INIT(sc); 445 449 … … 526 530 ic->ic_country_code = ath_countrycode; 527 531 ic->ic_country_outdoor = ath_outdoor; 528 532 529 if (rfkill != -1) { 530 printk(KERN_INFO "ath_pci: switching rfkill capability %s\n", 531 rfkill ? "on" : "off"); 532 ath_hal_setrfsilent(ah, rfkill); 533 } 533 printk(KERN_INFO "ath_pci: switching rfkill capability %s\n", 534 rfkill ? "on" : "off"); 535 ath_hal_setrfsilent(ah, rfkill); 534 536 535 537 #ifdef ATH_CAP_TPC 536 538 printk(KERN_INFO "ath_pci: ath_pci: switching per-packet transmit power control %s\n", … … 965 967 ath_hal_detach(ah); 966 968 ATH_TXBUF_LOCK_DESTROY(sc); 967 969 ATH_LOCK_DESTROY(sc); 970 ATH_HAL_LOCK_DESTROY(sc); 968 971 sc->sc_invalid = 1; 969 972 970 973 return error; … … 980 983 DPRINTF(sc, ATH_DEBUG_ANY, "%s: flags %x\n", __func__, dev->flags); 981 984 ath_stop(dev); 982 985 983 ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE );986 ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE, AH_TRUE); 984 987 985 988 sc->sc_invalid = 1; 986 989 … … 1015 1018 1016 1019 ath_dynamic_sysctl_unregister(sc); 1017 1020 ATH_LOCK_DESTROY(sc); 1021 ATH_HAL_LOCK_DESTROY(sc); 1018 1022 dev->stop = NULL; /* prevent calling ath_stop again */ 1019 1023 unregister_netdev(dev); 1020 1024 return 0; … … 2008 2012 ATH_LOCK(sc); 2009 2013 2010 2014 if (!sc->sc_invalid) 2011 ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE );2015 ath_hal_setpower(sc->sc_ah, HAL_PM_AWAKE, AH_TRUE); 2012 2016 2013 2017 error = ath_stop_locked(dev); 2014 2018 … … 2079 2083 static int 2080 2084 ath_set_ack_bitrate(struct ath_softc *sc, int high) 2081 2085 { 2082 struct ath_hal *ah = sc->sc_ah;2083 2086 if (ar_device(sc->devid) == 5212 || ar_device(sc->devid) == 5213) { 2084 2087 /* set ack to be sent at low bit-rate */ 2085 2088 /* registers taken from the OpenBSD 5212 HAL */ … … 2088 2091 #define AR5K_AR5212_STA_ID1_BASE_RATE_11B 0x02000000 2089 2092 u_int32_t v = AR5K_AR5212_STA_ID1_BASE_RATE_11B | AR5K_AR5212_STA_ID1_ACKCTS_6MB; 2090 2093 if (high) { 2091 OS_REG_WRITE(ah, AR5K_AR5212_STA_ID1, OS_REG_READ(ah, AR5K_AR5212_STA_ID1) & ~v);2094 ath_reg_write(sc, AR5K_AR5212_STA_ID1, ath_reg_read(sc, AR5K_AR5212_STA_ID1) & ~v); 2092 2095 } else { 2093 OS_REG_WRITE(ah, AR5K_AR5212_STA_ID1, OS_REG_READ(ah, AR5K_AR5212_STA_ID1) | v);2096 ath_reg_write(sc, AR5K_AR5212_STA_ID1, ath_reg_read(sc, AR5K_AR5212_STA_ID1) | v); 2094 2097 } 2095 2098 #undef AR5K_AR5212_STA_ID1 2096 2099 #undef AR5K_AR5212_STA_ID1_BASE_RATE_11B … … 2892 2895 */ 2893 2896 memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_mic)); 2894 2897 KEYPRINTF(sc, k->wk_keyix, hk, zerobssid); 2895 if (!ath_hal_keyset(ah, ATH_KEY(k->wk_keyix), hk, zerobssid ))2898 if (!ath_hal_keyset(ah, ATH_KEY(k->wk_keyix), hk, zerobssid, AH_FALSE)) 2896 2899 return 0; 2897 2900 2898 2901 memcpy(hk->kv_mic, k->wk_rxmic, sizeof(hk->kv_mic)); 2899 2902 KEYPRINTF(sc, k->wk_keyix + 32, hk, mac); 2900 2903 /* XXX delete tx key on failure? */ 2901 return ath_hal_keyset(ah, ATH_KEY(k->wk_keyix + 32), hk, mac );2904 return ath_hal_keyset(ah, ATH_KEY(k->wk_keyix + 32), hk, mac, AH_FALSE); 2902 2905 } else { 2903 2906 /* 2904 2907 * Room for both TX+RX MIC keys in one key cache … … 2910 2913 memcpy(hk->kv_txmic, k->wk_txmic, sizeof(hk->kv_txmic)); 2911 2914 #endif 2912 2915 KEYPRINTF(sc, k->wk_keyix, hk, mac); 2913 return ath_hal_keyset(ah, ATH_KEY(k->wk_keyix), hk, mac );2916 return ath_hal_keyset(ah, ATH_KEY(k->wk_keyix), hk, mac, AH_FALSE); 2914 2917 } 2915 2918 } else if (k->wk_flags & IEEE80211_KEY_XR) { 2916 2919 /* … … 2920 2923 memcpy(hk->kv_mic, k->wk_flags & IEEE80211_KEY_XMIT ? 2921 2924 k->wk_txmic : k->wk_rxmic, sizeof(hk->kv_mic)); 2922 2925 KEYPRINTF(sc, k->wk_keyix, hk, mac); 2923 return ath_hal_keyset(ah, ATH_KEY(k->wk_keyix), hk, mac );2926 return ath_hal_keyset(ah, ATH_KEY(k->wk_keyix), hk, mac, AH_FALSE); 2924 2927 } 2925 2928 return 0; 2926 2929 #undef IEEE80211_KEY_XR … … 2984 2987 return ath_keyset_tkip(sc, k, &hk, mac); 2985 2988 } else { 2986 2989 KEYPRINTF(sc, k->wk_keyix, &hk, mac); 2987 return ath_hal_keyset(ah, ATH_KEY(k->wk_keyix), &hk, mac );2990 return ath_hal_keyset(ah, ATH_KEY(k->wk_keyix), &hk, mac, AH_FALSE); 2988 2991 } 2989 2992 #undef N 2990 2993 } … … 10408 10411 if (ath_regdump_filter(sc, address)) 10409 10412 continue; 10410 10413 ath_lookup_register_name(sc, name, MAX_REGISTER_NAME_LEN, address); 10411 value = OS_REG_READ(ah,address);10414 value = ath_reg_read(sc,address); 10412 10415 ath_print_register(name, address, value); 10413 10416 } while ((address += 4) < MAX_REGISTER_ADDRESS); 10414 10417 } … … 10429 10432 do { 10430 10433 if (ath_regdump_filter(sc, address)) 10431 10434 continue; 10432 value = OS_REG_READ(ah,address);10435 value = ath_reg_read(sc,address); 10433 10436 p_old = (unsigned int*)&sc->register_snapshot[address]; 10434 10437 if (*p_old != value) { 10435 10438 ath_lookup_register_name(sc, name, MAX_REGISTER_NAME_LEN, address); … … 10453 10456 do { 10454 10457 *((unsigned int*)&sc->register_snapshot[address]) = 10455 10458 ath_regdump_filter(sc, address) ? 10456 0x0 : OS_REG_READ(ah,address);10459 0x0 : ath_reg_read(sc,address); 10457 10460 } while ((address += 4) < MAX_REGISTER_ADDRESS); 10458 10461 } 10459 10462 #endif /* #ifdef ATH_REVERSE_ENGINEERING */ … … 10477 10480 DEV_NAME(sc->sc_dev), __func__, address); 10478 10481 return 1; 10479 10482 } 10480 *value = OS_REG_READ(sc->sc_ah, address);10483 *value = ath_reg_read(sc, address); 10481 10484 printk(KERN_DEBUG "*0x%04x -> 0x%08x\n", address, *value); 10482 10485 return 0; 10483 10486 } … … 10507 10510 DEV_NAME(sc->sc_dev), __func__, address); 10508 10511 return 1; 10509 10512 } 10510 OS_REG_WRITE(sc->sc_ah, address, value);10513 ath_reg_write(sc, address, value); 10511 10514 printk(KERN_DEBUG "*0x%04x <- 0x%08x = 0x%08x\n", address, value, 10512 OS_REG_READ(sc->sc_ah, address));10515 ath_reg_read(sc, address)); 10513 10516 return 0; 10514 10517 } 10515 10518 #endif /* #ifdef ATH_REVERSE_ENGINEERING */ -
ath/Makefile
old new 57 57 include $(TOP)/Makefile.inc 58 58 59 59 obj-m += ath_$(BUSNAME).o 60 ath_$(BUSNAME)-objs := if_ath.o if_ath_ $(BUSNAME).o60 ath_$(BUSNAME)-objs := if_ath.o if_ath_hal.o if_ath_$(BUSNAME).o 61 61 62 62 INCS += -I$(TOP) -I$(ATH_HAL) -I$(HAL) -I$(WLAN) 63 63
