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

ar5211reg.h

Go to the documentation of this file.
00001 /*      $OpenBSD: ar5211reg.h,v 1.6 2005/07/30 17:13:17 reyk Exp $      */
00002 
00003 /*
00004  * Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
00005  *
00006  * Permission to use, copy, modify, and distribute this software for any
00007  * purpose with or without fee is hereby granted, provided that the above
00008  * copyright notice and this permission notice appear in all copies.
00009  *
00010  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
00011  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
00012  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
00013  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
00014  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
00015  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
00016  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00017  */
00018 
00019 /*
00020  * Known registers of the Atheros AR5001 Wireless LAN chipsets
00021  * (AR5211/AR5311).
00022  */
00023 
00024 #ifndef _AR5K_AR5211_REG_H
00025 #define _AR5K_AR5211_REG_H
00026 
00027 /*
00028  * Command register
00029  */
00030 #define AR5K_AR5211_CR          0x0008
00031 #define AR5K_AR5211_CR_RXE      0x00000004
00032 #define AR5K_AR5211_CR_RXD      0x00000020
00033 #define AR5K_AR5211_CR_SWI      0x00000040
00034 
00035 /*
00036  * Receive queue descriptor pointer register
00037  */
00038 #define AR5K_AR5211_RXDP        0x000c
00039 
00040 /*
00041  * Configuration and status register
00042  */
00043 #define AR5K_AR5211_CFG                 0x0014
00044 #define AR5K_AR5211_CFG_SWTD            0x00000001
00045 #define AR5K_AR5211_CFG_SWTB            0x00000002
00046 #define AR5K_AR5211_CFG_SWRD            0x00000004
00047 #define AR5K_AR5211_CFG_SWRB            0x00000008
00048 #define AR5K_AR5211_CFG_SWRG            0x00000010
00049 #define AR5K_AR5211_CFG_ADHOC           0x00000020
00050 #define AR5K_AR5211_CFG_PHY_OK          0x00000100
00051 #define AR5K_AR5211_CFG_EEBS            0x00000200
00052 #define AR5K_AR5211_CFG_CLKGD           0x00000400
00053 #define AR5K_AR5211_CFG_PCI_THRES       0x00060000
00054 #define AR5K_AR5211_CFG_PCI_THRES_S     17
00055 
00056 /*
00057  * Interrupt enable register
00058  */
00059 #define AR5K_AR5211_IER         0x0024
00060 #define AR5K_AR5211_IER_DISABLE 0x00000000
00061 #define AR5K_AR5211_IER_ENABLE  0x00000001
00062 
00063 /*
00064  * First RTS duration register
00065  */
00066 #define AR5K_AR5211_RTSD0       0x0028
00067 #define AR5K_AR5211_RTSD0_6     0x000000ff
00068 #define AR5K_AR5211_RTSD0_6_S   0
00069 #define AR5K_AR5211_RTSD0_9     0x0000ff00
00070 #define AR5K_AR5211_RTSD0_9_S   8
00071 #define AR5K_AR5211_RTSD0_12    0x00ff0000
00072 #define AR5K_AR5211_RTSD0_12_S  16
00073 #define AR5K_AR5211_RTSD0_18    0xff000000
00074 #define AR5K_AR5211_RTSD0_18_S  24
00075 
00076 /*
00077  * Second RTS duration register
00078  */
00079 #define AR5K_AR5211_RTSD1       0x002c
00080 #define AR5K_AR5211_RTSD1_24    0x000000ff
00081 #define AR5K_AR5211_RTSD1_24_S  0
00082 #define AR5K_AR5211_RTSD1_36    0x0000ff00
00083 #define AR5K_AR5211_RTSD1_36_S  8
00084 #define AR5K_AR5211_RTSD1_48    0x00ff0000
00085 #define AR5K_AR5211_RTSD1_48_S  16
00086 #define AR5K_AR5211_RTSD1_54    0xff000000
00087 #define AR5K_AR5211_RTSD1_54_S  24
00088 
00089 /*
00090  * Transmit configuration register
00091  */
00092 #define AR5K_AR5211_TXCFG               0x0030
00093 #define AR5K_AR5211_TXCFG_SDMAMR        0x00000007
00094 #define AR5K_AR5211_TXCFG_SDMAMR_S      0
00095 #define AR5K_AR5211_TXCFG_B_MODE        0x00000008
00096 #define AR5K_AR5211_TXCFG_TXFULL        0x000003f0
00097 #define AR5K_AR5211_TXCFG_TXFULL_S      4
00098 #define AR5K_AR5211_TXCFG_TXFULL_0B     0x00000000
00099 #define AR5K_AR5211_TXCFG_TXFULL_64B    0x00000010
00100 #define AR5K_AR5211_TXCFG_TXFULL_128B   0x00000020
00101 #define AR5K_AR5211_TXCFG_TXFULL_192B   0x00000030
00102 #define AR5K_AR5211_TXCFG_TXFULL_256B   0x00000040
00103 #define AR5K_AR5211_TXCFG_TXCONT_ENABLE 0x00000080
00104 #define AR5K_AR5211_TXCFG_DMASIZE       0x00000100
00105 #define AR5K_AR5211_TXCFG_JUMBO_TXE     0x00000400
00106 #define AR5K_AR5211_TXCFG_RTSRND        0x00001000
00107 #define AR5K_AR5211_TXCFG_FRMPAD_DIS    0x00002000
00108 #define AR5K_AR5211_TXCFG_RDY_DIS       0x00004000
00109 
00110 /*
00111  * Receive configuration register
00112  */
00113 #define AR5K_AR5211_RXCFG                       0x0034
00114 #define AR5K_AR5211_RXCFG_SDMAMW                0x00000007
00115 #define AR5K_AR5211_RXCFG_SDMAMW_S              0
00116 #define AR5K_AR5311_RXCFG_DEFAULT_ANTENNA       0x00000008
00117 #define AR5K_AR5211_RXCFG_ZLFDMA                0x00000010
00118 #define AR5K_AR5211_RXCFG_JUMBO_RXE             0x00000020
00119 #define AR5K_AR5211_RXCFG_JUMBO_WRAP            0x00000040
00120 
00121 /*
00122  * Receive jumbo descriptor last address register
00123  */
00124 #define AR5K_AR5211_RXJLA               0x0038
00125 
00126 /*
00127  * MIB control register
00128  */
00129 #define AR5K_AR5211_MIBC                0x0040
00130 #define AR5K_AR5211_MIBC_COW            0x00000001
00131 #define AR5K_AR5211_MIBC_FMC            0x00000002
00132 #define AR5K_AR5211_MIBC_CMC            0x00000004
00133 #define AR5K_AR5211_MIBC_MCS            0x00000008
00134 
00135 /*
00136  * Timeout prescale register
00137  */
00138 #define AR5K_AR5211_TOPS                0x0044
00139 #define AR5K_AR5211_TOPS_M              0x0000ffff
00140 
00141 /*
00142  * Receive timeout register (no frame received)
00143  */
00144 #define AR5K_AR5211_RXNOFRM             0x0048
00145 #define AR5K_AR5211_RXNOFRM_M           0x000003ff
00146 
00147 /*
00148  * Transmit timeout register (no frame sent)
00149  */
00150 #define AR5K_AR5211_TXNOFRM             0x004c
00151 #define AR5K_AR5211_TXNOFRM_M           0x000003ff
00152 #define AR5K_AR5211_TXNOFRM_QCU         0x000ffc00
00153 
00154 /*
00155  * Receive frame gap timeout register
00156  */
00157 #define AR5K_AR5211_RPGTO               0x0050
00158 #define AR5K_AR5211_RPGTO_M             0x000003ff
00159 
00160 /*
00161  * Receive frame count limit register
00162  */
00163 #define AR5K_AR5211_RFCNT               0x0054
00164 #define AR5K_AR5211_RFCNT_M             0x0000001f
00165 
00166 /*
00167  * Misc settings register
00168  */
00169 #define AR5K_AR5211_MISC                0x0058
00170 #define AR5K_AR5211_MISC_DMA_OBS_M      0x000001e0
00171 #define AR5K_AR5211_MISC_DMA_OBS_S      5
00172 #define AR5K_AR5211_MISC_MISC_OBS_M     0x00000e00
00173 #define AR5K_AR5211_MISC_MISC_OBS_S     9
00174 #define AR5K_AR5211_MISC_MAC_OBS_LSB_M  0x00007000
00175 #define AR5K_AR5211_MISC_MAC_OBS_LSB_S  12
00176 #define AR5K_AR5211_MISC_MAC_OBS_MSB_M  0x00038000
00177 #define AR5K_AR5211_MISC_MAC_OBS_MSB_S  15
00178 
00179 /*
00180  * QCU/DCU clock gating register
00181  */
00182 #define AR5K_AR5311_QCUDCU_CLKGT
00183 #define AR5K_AR5311_QCUDCU_CLKGT_QCU    0x0000ffff
00184 #define AR5K_AR5311_QCUDCU_CLKGT_DCU    0x07ff0000
00185 
00186 /*
00187  * Primary interrupt status register
00188  */
00189 #define AR5K_AR5211_PISR                0x0080
00190 #define AR5K_AR5211_PISR_RXOK           0x00000001
00191 #define AR5K_AR5211_PISR_RXDESC         0x00000002
00192 #define AR5K_AR5211_PISR_RXERR          0x00000004
00193 #define AR5K_AR5211_PISR_RXNOFRM        0x00000008
00194 #define AR5K_AR5211_PISR_RXEOL          0x00000010
00195 #define AR5K_AR5211_PISR_RXORN          0x00000020
00196 #define AR5K_AR5211_PISR_TXOK           0x00000040
00197 #define AR5K_AR5211_PISR_TXDESC         0x00000080
00198 #define AR5K_AR5211_PISR_TXERR          0x00000100
00199 #define AR5K_AR5211_PISR_TXNOFRM        0x00000200
00200 #define AR5K_AR5211_PISR_TXEOL          0x00000400
00201 #define AR5K_AR5211_PISR_TXURN          0x00000800
00202 #define AR5K_AR5211_PISR_MIB            0x00001000
00203 #define AR5K_AR5211_PISR_SWI            0x00002000
00204 #define AR5K_AR5211_PISR_RXPHY          0x00004000
00205 #define AR5K_AR5211_PISR_RXKCM          0x00008000
00206 #define AR5K_AR5211_PISR_SWBA           0x00010000
00207 #define AR5K_AR5211_PISR_BRSSI          0x00020000
00208 #define AR5K_AR5211_PISR_BMISS          0x00040000
00209 #define AR5K_AR5211_PISR_HIUERR         0x00080000
00210 #define AR5K_AR5211_PISR_BNR            0x00100000
00211 #define AR5K_AR5211_PISR_TIM            0x00800000
00212 #define AR5K_AR5211_PISR_GPIO           0x01000000
00213 #define AR5K_AR5211_PISR_QCBRORN        0x02000000
00214 #define AR5K_AR5211_PISR_QCBRURN        0x04000000
00215 #define AR5K_AR5211_PISR_QTRIG          0x08000000
00216 
00217 /*
00218  * Secondary interrupt status registers (0 - 4)
00219  */
00220 #define AR5K_AR5211_SISR0               0x0084
00221 #define AR5K_AR5211_SISR0_QCU_TXOK      0x000003ff
00222 #define AR5K_AR5211_SISR0_QCU_TXDESC    0x03ff0000
00223 
00224 #define AR5K_AR5211_SISR1               0x0088
00225 #define AR5K_AR5211_SISR1_QCU_TXERR     0x000003ff
00226 #define AR5K_AR5211_SISR1_QCU_TXEOL     0x03ff0000
00227 
00228 #define AR5K_AR5211_SISR2               0x008c
00229 #define AR5K_AR5211_SISR2_QCU_TXURN     0x000003ff
00230 #define AR5K_AR5211_SISR2_MCABT         0x00100000
00231 #define AR5K_AR5211_SISR2_SSERR         0x00200000
00232 #define AR5K_AR5211_SISR2_DPERR         0x00400000
00233 
00234 #define AR5K_AR5211_SISR3               0x0090
00235 #define AR5K_AR5211_SISR3_QCBRORN       0x000003ff
00236 #define AR5K_AR5211_SISR3_QCBRURN       0x03ff0000
00237 
00238 #define AR5K_AR5211_SISR4               0x0094
00239 #define AR5K_AR5211_SISR4_QTRIG         0x000003ff
00240 
00241 /*
00242  * Shadow read-and-clear interrupt status registers
00243  */
00244 #define AR5K_AR5211_RAC_PISR    0x00c0
00245 #define AR5K_AR5211_RAC_SISR0   0x00c4
00246 #define AR5K_AR5211_RAC_SISR1   0x00c8
00247 #define AR5K_AR5211_RAC_SISR2   0x00cc
00248 #define AR5K_AR5211_RAC_SISR3   0c00d0
00249 #define AR5K_AR5211_RAC_SISR4   0c00d4
00250 
00251 /*
00252  * Primary interrupt mask register
00253  */
00254 #define AR5K_AR5211_PIMR                0x00a0
00255 #define AR5K_AR5211_PIMR_RXOK           0x00000001
00256 #define AR5K_AR5211_PIMR_RXDESC         0x00000002
00257 #define AR5K_AR5211_PIMR_RXERR          0x00000004
00258 #define AR5K_AR5211_PIMR_RXNOFRM        0x00000008
00259 #define AR5K_AR5211_PIMR_RXEOL          0x00000010
00260 #define AR5K_AR5211_PIMR_RXORN          0x00000020
00261 #define AR5K_AR5211_PIMR_TXOK           0x00000040
00262 #define AR5K_AR5211_PIMR_TXDESC         0x00000080
00263 #define AR5K_AR5211_PIMR_TXERR          0x00000100
00264 #define AR5K_AR5211_PIMR_TXNOFRM        0x00000200
00265 #define AR5K_AR5211_PIMR_TXEOL          0x00000400
00266 #define AR5K_AR5211_PIMR_TXURN          0x00000800
00267 #define AR5K_AR5211_PIMR_MIB            0x00001000
00268 #define AR5K_AR5211_PIMR_SWI            0x00002000
00269 #define AR5K_AR5211_PIMR_RXPHY          0x00004000
00270 #define AR5K_AR5211_PIMR_RXKCM          0x00008000
00271 #define AR5K_AR5211_PIMR_SWBA           0x00010000
00272 #define AR5K_AR5211_PIMR_BRSSI          0x00020000
00273 #define AR5K_AR5211_PIMR_BMISS          0x00040000
00274 #define AR5K_AR5211_PIMR_HIUERR         0x00080000
00275 #define AR5K_AR5211_PIMR_BNR            0x00100000
00276 #define AR5K_AR5211_PIMR_TIM            0x00800000
00277 #define AR5K_AR5211_PIMR_GPIO           0x01000000
00278 #define AR5K_AR5211_PIMR_QCBRORN        0x02000000
00279 #define AR5K_AR5211_PIMR_QCBRURN        0x04000000
00280 #define AR5K_AR5211_PIMR_QTRIG          0x08000000
00281 
00282 /*
00283  * Secondary interrupt mask registers (0 - 4)
00284  */
00285 #define AR5K_AR5211_SIMR0               0x00a4
00286 #define AR5K_AR5211_SIMR0_QCU_TXOK      0x000003ff
00287 #define AR5K_AR5211_SIMR0_QCU_TXOK_S    0
00288 #define AR5K_AR5211_SIMR0_QCU_TXDESC    0x03ff0000
00289 #define AR5K_AR5211_SIMR0_QCU_TXDESC_S  16
00290 
00291 #define AR5K_AR5211_SIMR1               0x00a8
00292 #define AR5K_AR5211_SIMR1_QCU_TXERR     0x000003ff
00293 #define AR5K_AR5211_SIMR1_QCU_TXERR_S   0
00294 #define AR5K_AR5211_SIMR1_QCU_TXEOL     0x03ff0000
00295 #define AR5K_AR5211_SIMR1_QCU_TXEOL_S   16
00296 
00297 #define AR5K_AR5211_SIMR2               0x00ac
00298 #define AR5K_AR5211_SIMR2_QCU_TXURN     0x000003ff
00299 #define AR5K_AR5211_SIMR2_QCU_TXURN_S   0
00300 #define AR5K_AR5211_SIMR2_MCABT         0x00100000
00301 #define AR5K_AR5211_SIMR2_SSERR         0x00200000
00302 #define AR5K_AR5211_SIMR2_DPERR         0x00400000
00303 
00304 #define AR5K_AR5211_SIMR3               0x00b0
00305 #define AR5K_AR5211_SIMR3_QCBRORN       0x000003ff
00306 #define AR5K_AR5211_SIMR3_QCBRORN_S     0
00307 #define AR5K_AR5211_SIMR3_QCBRURN       0x03ff0000
00308 #define AR5K_AR5211_SIMR3_QCBRURN_S     16
00309 
00310 #define AR5K_AR5211_SIMR4               0x00b4
00311 #define AR5K_AR5211_SIMR4_QTRIG         0x000003ff
00312 #define AR5K_AR5211_SIMR4_QTRIG_S       0
00313 
00314 /*
00315  * Queue control unit (QCU) registers (0 - 9)
00316  */
00317 #define AR5K_AR5211_QCU(_n, _a)         (((_n) << 2) + _a)
00318 
00319 /*
00320  * QCU Transmit descriptor pointer registers
00321  */
00322 #define AR5K_AR5211_QCU_TXDP(_n)        AR5K_AR5211_QCU(_n, 0x0800)
00323 
00324 /*
00325  * QCU Transmit enable register
00326  */
00327 #define AR5K_AR5211_QCU_TXE             0x0840
00328 
00329 /*
00330  * QCU Transmit disable register
00331  */
00332 #define AR5K_AR5211_QCU_TXD             0x0880
00333 
00334 /*
00335  * QCU CBR configuration registers
00336  */
00337 #define AR5K_AR5211_QCU_CBRCFG(_n)              AR5K_AR5211_QCU(_n, 0x08c0)
00338 #define AR5K_AR5211_QCU_CBRCFG_INTVAL           0x00ffffff
00339 #define AR5K_AR5211_QCU_CBRCFG_INTVAL_S         0
00340 #define AR5K_AR5211_QCU_CBRCFG_ORN_THRES        0xff000000
00341 #define AR5K_AR5211_QCU_CBRCFG_ORN_THRES_S      24
00342 
00343 /*
00344  * QCU Ready time configuration registers
00345  */
00346 #define AR5K_AR5211_QCU_RDYTIMECFG(_n)          AR5K_AR5211_QCU(_n, 0x0900)
00347 #define AR5K_AR5211_QCU_RDYTIMECFG_INTVAL       0x00ffffff
00348 #define AR5K_AR5211_QCU_RDYTIMECFG_INTVAL_S     0
00349 #define AR5K_AR5211_QCU_RDYTIMECFG_DURATION     0x00ffffff
00350 #define AR5K_AR5211_QCU_RDYTIMECFG_ENABLE       0x01000000
00351 
00352 /*
00353  * QCU one shot arm set registers
00354  */
00355 #define AR5K_AR5211_QCU_ONESHOTARMS(_n) AR5K_AR5211_QCU(_n, 0x0940)
00356 #define AR5K_AR5211_QCU_ONESHOTARMS_M   0x0000ffff
00357 
00358 /*
00359  * QCU one shot arm clear registers
00360  */
00361 #define AR5K_AR5211_QCU_ONESHOTARMC(_n) AR5K_AR5211_QCU(_n, 0x0980)
00362 #define AR5K_AR5211_QCU_ONESHOTARMC_M   0x0000ffff
00363 
00364 /*
00365  * QCU misc registers
00366  */
00367 #define AR5K_AR5211_QCU_MISC(_n)                AR5K_AR5211_QCU(_n, 0x09c0)
00368 #define AR5K_AR5211_QCU_MISC_FRSHED_M           0x0000000f
00369 #define AR5K_AR5211_QCU_MISC_FRSHED_ASAP        0
00370 #define AR5K_AR5211_QCU_MISC_FRSHED_CBR         1
00371 #define AR5K_AR5211_QCU_MISC_FRSHED_DBA_GT      2
00372 #define AR5K_AR5211_QCU_MISC_FRSHED_TIM_GT      3
00373 #define AR5K_AR5211_QCU_MISC_FRSHED_BCN_SENT_GT 4
00374 #define AR5K_AR5211_QCU_MISC_ONESHOT_ENABLE     0x00000010
00375 #define AR5K_AR5211_QCU_MISC_CBREXP             0x00000020
00376 #define AR5K_AR5211_QCU_MISC_CBREXP_BCN         0x00000040
00377 #define AR5K_AR5211_QCU_MISC_BCN_ENABLE         0x00000080
00378 #define AR5K_AR5211_QCU_MISC_CBR_THRES_ENABLE   0x00000100
00379 #define AR5K_AR5211_QCU_MISC_TXE                0x00000200
00380 #define AR5K_AR5211_QCU_MISC_CBR                0x00000400
00381 #define AR5K_AR5211_QCU_MISC_DCU_EARLY          0x00000800
00382 
00383 /*
00384  * QCU status registers
00385  */
00386 #define AR5K_AR5211_QCU_STS(_n)         AR5K_AR5211_QCU(_n, 0x0a00)
00387 #define AR5K_AR5211_QCU_STS_FRMPENDCNT  0x00000003
00388 #define AR5K_AR5211_QCU_STS_CBREXPCNT   0x0000ff00
00389 
00390 /*
00391  * QCU ready time shutdown register
00392  */
00393 #define AR5K_AR5211_QCU_RDYTIMESHDN     0x0a40
00394 #define AR5K_AR5211_QCU_RDYTIMESHDN_M   0x000003ff
00395 
00396 /*
00397  * DCF control unit (DCU) registers (0 - 9)
00398  */
00399 #define AR5K_AR5211_DCU(_n, _a)         AR5K_AR5211_QCU(_n, _a)
00400 
00401 /*
00402  * DCU QCU mask registers
00403  */
00404 #define AR5K_AR5211_DCU_QCUMASK(_n)     AR5K_AR5211_DCU(_n, 0x1000)
00405 #define AR5K_AR5211_DCU_QCUMASK_M       0x000003ff
00406 
00407 /*
00408  * DCU local IFS settings register
00409  */
00410 #define AR5K_AR5211_DCU_LCL_IFS(_n)             AR5K_AR5211_DCU(_n, 0x1040)
00411 #define AR5K_AR5211_DCU_LCL_IFS_CW_MIN          0x000003ff
00412 #define AR5K_AR5211_DCU_LCL_IFS_CW_MIN_S        0
00413 #define AR5K_AR5211_DCU_LCL_IFS_CW_MAX          0x000ffc00
00414 #define AR5K_AR5211_DCU_LCL_IFS_CW_MAX_S        10
00415 #define AR5K_AR5211_DCU_LCL_IFS_AIFS            0x0ff00000
00416 #define AR5K_AR5211_DCU_LCL_IFS_AIFS_S          20
00417 
00418 /*
00419  * DCU retry limit registers
00420  */
00421 #define AR5K_AR5211_DCU_RETRY_LMT(_n)           AR5K_AR5211_DCU(_n, 0x1080)
00422 #define AR5K_AR5211_DCU_RETRY_LMT_SH_RETRY      0x0000000f
00423 #define AR5K_AR5211_DCU_RETRY_LMT_SH_RETRY_S    0
00424 #define AR5K_AR5211_DCU_RETRY_LMT_LG_RETRY      0x000000f0
00425 #define AR5K_AR5211_DCU_RETRY_LMT_LG_RETRY_S    4
00426 #define AR5K_AR5211_DCU_RETRY_LMT_SSH_RETRY     0x00003f00
00427 #define AR5K_AR5211_DCU_RETRY_LMT_SSH_RETRY_S   8
00428 #define AR5K_AR5211_DCU_RETRY_LMT_SLG_RETRY     0x000fc000
00429 #define AR5K_AR5211_DCU_RETRY_LMT_SLG_RETRY_S   14
00430 
00431 /*
00432  * DCU channel time registers
00433  */
00434 #define AR5K_AR5211_DCU_CHAN_TIME(_n)           AR5K_AR5211_DCU(_n, 0x10c0)
00435 #define AR5K_AR5211_DCU_CHAN_TIME_ENABLE        0x00100000
00436 #define AR5K_AR5211_DCU_CHAN_TIME_DUR           0x000fffff
00437 #define AR5K_AR5211_DCU_CHAN_TIME_DUR_S         0
00438 
00439 /*
00440  * DCU misc registers
00441  */
00442 #define AR5K_AR5211_DCU_MISC(_n)                AR5K_AR5211_DCU(_n, 0x1100)
00443 #define AR5K_AR5211_DCU_MISC_BACKOFF            0x000007ff
00444 #define AR5K_AR5211_DCU_MISC_BACKOFF_FRAG       0x00000200
00445 #define AR5K_AR5211_DCU_MISC_HCFPOLL_ENABLE     0x00000800
00446 #define AR5K_AR5211_DCU_MISC_BACKOFF_PERSIST    0x00001000
00447 #define AR5K_AR5211_DCU_MISC_FRMPRFTCH_ENABLE   0x00002000
00448 #define AR5K_AR5211_DCU_MISC_VIRTCOL            0x0000c000
00449 #define AR5K_AR5211_DCU_MISC_VIRTCOL_NORMAL     0
00450 #define AR5K_AR5211_DCU_MISC_VIRTCOL_MODIFIED   1
00451 #define AR5K_AR5211_DCU_MISC_VIRTCOL_IGNORE     2
00452 #define AR5K_AR5211_DCU_MISC_BCN_ENABLE         0x00010000
00453 #define AR5K_AR5211_DCU_MISC_ARBLOCK_CTL        0x00060000
00454 #define AR5K_AR5211_DCU_MISC_ARBLOCK_CTL_S      17
00455 #define AR5K_AR5211_DCU_MISC_ARBLOCK_CTL_NONE   0
00456 #define AR5K_AR5211_DCU_MISC_ARBLOCK_CTL_INTFRM 1
00457 #define AR5K_AR5211_DCU_MISC_ARBLOCK_CTL_GLOBAL 2
00458 #define AR5K_AR5211_DCU_MISC_ARBLOCK_IGNORE     0x00080000
00459 #define AR5K_AR5211_DCU_MISC_SEQ_NUM_INCR_DIS   0x00100000
00460 #define AR5K_AR5211_DCU_MISC_POST_FR_BKOFF_DIS  0x00200000
00461 #define AR5K_AR5211_DCU_MISC_VIRT_COLL_POLICY   0x00400000
00462 #define AR5K_AR5211_DCU_MISC_BLOWN_IFS_POLICY   0x00800000
00463 #define AR5K_AR5211_DCU_MISC_SEQNUM_CTL         0x01000000
00464 
00465 /*
00466  * DCU frame sequence number registers
00467  */
00468 #define AR5K_AR5211_DCU_SEQNUM(_n)      AR5K_AR5211_DCU(_n, 0x1140)
00469 #define AR5K_AR5211_DCU_SEQNUM_M        0x00000fff
00470 /*
00471  * DCU global IFS SIFS registers
00472  */
00473 #define AR5K_AR5211_DCU_GBL_IFS_SIFS    0x1030
00474 #define AR5K_AR5211_DCU_GBL_IFS_SIFS_M  0x0000ffff
00475 
00476 /*
00477  * DCU global IFS slot interval registers
00478  */
00479 #define AR5K_AR5211_DCU_GBL_IFS_SLOT    0x1070
00480 #define AR5K_AR5211_DCU_GBL_IFS_SLOT_M  0x0000ffff
00481 
00482 /*
00483  * DCU global IFS EIFS registers
00484  */
00485 #define AR5K_AR5211_DCU_GBL_IFS_EIFS    0x10b0
00486 #define AR5K_AR5211_DCU_GBL_IFS_EIFS_M  0x0000ffff
00487 
00488 /*
00489  * DCU global IFS misc registers
00490  */
00491 #define AR5K_AR5211_DCU_GBL_IFS_MISC                    0x10f0
00492 #define AR5K_AR5211_DCU_GBL_IFS_MISC_LFSR_SLICE         0x00000007
00493 #define AR5K_AR5211_DCU_GBL_IFS_MISC_TURBO_MODE         0x00000008
00494 #define AR5K_AR5211_DCU_GBL_IFS_MISC_SIFS_DUR_USEC      0x000003f0
00495 #define AR5K_AR5211_DCU_GBL_IFS_MISC_USEC_DUR           0x000ffc00
00496 #define AR5K_AR5211_DCU_GBL_IFS_MISC_DCU_ARB_DELAY      0x00300000
00497 
00498 /*
00499  * DCU frame prefetch control register
00500  */
00501 #define AR5K_AR5211_DCU_FP              0x1230
00502 
00503 /*
00504  * DCU transmit pause control/status register
00505  */
00506 #define AR5K_AR5211_DCU_TXP             0x1270
00507 #define AR5K_AR5211_DCU_TXP_M           0x000003ff
00508 #define AR5K_AR5211_DCU_TXP_STATUS      0x00010000
00509 
00510 /*
00511  * DCU transmit filter register
00512  */
00513 #define AR5K_AR5211_DCU_TX_FILTER       0x1038
00514 
00515 /*
00516  * DCU clear transmit filter register
00517  */
00518 #define AR5K_AR5211_DCU_TX_FILTER_CLR   0x143c
00519 
00520 /*
00521  * DCU set transmit filter register
00522  */
00523 #define AR5K_AR5211_DCU_TX_FILTER_SET   0x147c
00524 
00525 /*
00526  * DMA size definitions
00527  */
00528 typedef enum {
00529         AR5K_AR5211_DMASIZE_4B = 0,
00530         AR5K_AR5211_DMASIZE_8B = 1,
00531         AR5K_AR5211_DMASIZE_16B = 2,
00532         AR5K_AR5211_DMASIZE_32B = 3,
00533         AR5K_AR5211_DMASIZE_64B = 4,
00534         AR5K_AR5211_DMASIZE_128B = 5,
00535         AR5K_AR5211_DMASIZE_256B = 6,
00536         AR5K_AR5211_DMASIZE_512B = 7
00537 } ar5k_ar5211_dmasize_t;
00538 
00539 /*
00540  * Reset control register
00541  */
00542 #define AR5K_AR5211_RC                  0x4000
00543 #define AR5K_AR5211_RC_PCU              0x00000001
00544 #define AR5K_AR5211_RC_BB               0x00000002
00545 #define AR5K_AR5211_RC_PCI              0x00000010
00546 #define AR5K_AR5211_RC_CHIP             (                               \
00547         AR5K_AR5211_RC_PCU | AR5K_AR5211_RC_BB | AR5K_AR5211_RC_PCI     \
00548 )
00549 
00550 /*
00551  * Sleep control register
00552  */
00553 #define AR5K_AR5211_SCR                 0x4004
00554 #define AR5K_AR5211_SCR_SLDUR           0x0000ffff
00555 #define AR5K_AR5211_SCR_SLDUR_S         0
00556 #define AR5K_AR5211_SCR_SLE             0x00030000
00557 #define AR5K_AR5211_SCR_SLE_S           16
00558 #define AR5K_AR5211_SCR_SLE_WAKE        0x00000000
00559 #define AR5K_AR5211_SCR_SLE_SLP         0x00010000
00560 #define AR5K_AR5211_SCR_SLE_ALLOW       0x00020000
00561 #define AR5K_AR5211_SCR_SLE_UNITS       0x00000008
00562 
00563 /*
00564  * Interrupt pending register
00565  */
00566 #define AR5K_AR5211_INTPEND     0x4008
00567 #define AR5K_AR5211_INTPEND_M   0x00000001
00568 
00569 /*
00570  * Sleep force register
00571  */
00572 #define AR5K_AR5211_SFR         0x400c
00573 #define AR5K_AR5211_SFR_M       0x00000001
00574 
00575 /*
00576  * PCI configuration register
00577  */
00578 #define AR5K_AR5211_PCICFG              0x4010
00579 #define AR5K_AR5211_PCICFG_CLKRUNEN     0x00000004
00580 #define AR5K_AR5211_PCICFG_EESIZE       0x00000018
00581 #define AR5K_AR5211_PCICFG_EESIZE_S     3
00582 #define AR5K_AR5211_PCICFG_EESIZE_4K    0
00583 #define AR5K_AR5211_PCICFG_EESIZE_8K    1
00584 #define AR5K_AR5211_PCICFG_EESIZE_16K   2
00585 #define AR5K_AR5211_PCICFG_EESIZE_FAIL  3
00586 #define AR5K_AR5211_PCICFG_LED          0x00000060
00587 #define AR5K_AR5211_PCICFG_LED_NONE     0x00000000
00588 #define AR5K_AR5211_PCICFG_LED_PEND     0x00000020
00589 #define AR5K_AR5211_PCICFG_LED_ASSOC    0x00000040
00590 #define AR5K_AR5211_PCICFG_BUS_SEL      0x00000380
00591 #define AR5K_AR5211_PCICFG_CBEFIX_DIS   0x00000400
00592 #define AR5K_AR5211_PCICFG_SL_INTEN     0x00000800
00593 #define AR5K_AR5211_PCICFG_SL_INPEN     0x00002800
00594 #define AR5K_AR5211_PCICFG_SPWR_DN      0x00010000
00595 #define AR5K_AR5211_PCICFG_LEDMODE      0x000e0000
00596 #define AR5K_AR5211_PCICFG_LEDMODE_PROP 0x00000000
00597 #define AR5K_AR5211_PCICFG_LEDMODE_PROM 0x00020000
00598 #define AR5K_AR5211_PCICFG_LEDMODE_PWR  0x00040000
00599 #define AR5K_AR5211_PCICFG_LEDMODE_RAND 0x00060000
00600 #define AR5K_AR5211_PCICFG_LEDBLINK     0x00700000
00601 #define AR5K_AR5211_PCICFG_LEDBLINK_S   20
00602 #define AR5K_AR5211_PCICFG_LEDSLOW      0x00800000
00603 #define AR5K_AR5211_PCICFG_LEDSTATE                                     \
00604         (AR5K_AR5211_PCICFG_LED | AR5K_AR5211_PCICFG_LEDMODE |          \
00605         AR5K_AR5211_PCICFG_LEDBLINK | AR5K_AR5211_PCICFG_LEDSLOW)
00606 
00607 /*
00608  * "General Purpose Input/Output" (GPIO) control register
00609  */
00610 #define AR5K_AR5211_GPIOCR              0x4014
00611 #define AR5K_AR5211_GPIOCR_INT_ENA      0x00008000
00612 #define AR5K_AR5211_GPIOCR_INT_SELL     0x00000000
00613 #define AR5K_AR5211_GPIOCR_INT_SELH     0x00010000
00614 #define AR5K_AR5211_GPIOCR_NONE(n)      (0 << ((n) * 2))
00615 #define AR5K_AR5211_GPIOCR_OUT0(n)      (1 << ((n) * 2))
00616 #define AR5K_AR5211_GPIOCR_OUT1(n)      (2 << ((n) * 2))
00617 #define AR5K_AR5211_GPIOCR_ALL(n)       (3 << ((n) * 2))
00618 #define AR5K_AR5211_GPIOCR_INT_SEL(n)   ((n) << 12)
00619 
00620 #define AR5K_AR5211_NUM_GPIO    6
00621 
00622 /*
00623  * "General Purpose Input/Output" (GPIO) data output register
00624  */
00625 #define AR5K_AR5211_GPIODO      0x4018
00626 
00627 /*
00628  * "General Purpose Input/Output" (GPIO) data input register
00629  */
00630 #define AR5K_AR5211_GPIODI      0x401c
00631 #define AR5K_AR5211_GPIODI_M    0x0000002f
00632 
00633 /*
00634  * Silicon revision register
00635  */
00636 #define AR5K_AR5211_SREV                0x4020
00637 #define AR5K_AR5211_SREV_REV            0x0000000f
00638 #define AR5K_AR5211_SREV_REV_S          0
00639 #define AR5K_AR5211_SREV_VER            0x000000ff
00640 #define AR5K_AR5211_SREV_VER_S          4
00641 
00642 /*
00643  * EEPROM access registers
00644  */
00645 #define AR5K_AR5211_EEPROM_BASE         0x6000
00646 #define AR5K_AR5211_EEPROM_DATA         0x6004
00647 #define AR5K_AR5211_EEPROM_CMD          0x6008
00648 #define AR5K_AR5211_EEPROM_CMD_READ     0x00000001
00649 #define AR5K_AR5211_EEPROM_CMD_WRITE    0x00000002
00650 #define AR5K_AR5211_EEPROM_CMD_RESET    0x00000004
00651 #define AR5K_AR5211_EEPROM_STATUS       0x600c
00652 #define AR5K_AR5211_EEPROM_STAT_RDERR   0x00000001
00653 #define AR5K_AR5211_EEPROM_STAT_RDDONE  0x00000002
00654 #define AR5K_AR5211_EEPROM_STAT_WRERR   0x00000004
00655 #define AR5K_AR5211_EEPROM_STAT_WRDONE  0x00000008
00656 #define AR5K_AR5211_EEPROM_CFG          0x6010
00657 
00658 /*
00659  * AR5211 EEPROM data registers
00660  */
00661 #define AR5K_AR5211_EEPROM_MAGIC                0x3d
00662 #define AR5K_AR5211_EEPROM_MAGIC_VALUE          0x5aa5
00663 #define AR5K_AR5211_EEPROM_PROTECT              0x3f
00664 #define AR5K_AR5211_EEPROM_PROTECT_128_191      0x80
00665 #define AR5K_AR5211_EEPROM_REG_DOMAIN           0xbf
00666 #define AR5K_AR5211_EEPROM_INFO_BASE            0xc0
00667 #define AR5K_AR5211_EEPROM_INFO_VERSION                                 \
00668         (AR5K_AR5211_EEPROM_INFO_BASE + 1)
00669 #define AR5K_AR5211_EEPROM_INFO_MAX                                     \
00670         (0x400 - AR5K_AR5211_EEPROM_INFO_BASE)
00671 
00672 /*
00673  * PCU registers
00674  */
00675 
00676 #define AR5K_AR5211_PCU_MIN     0x8000
00677 #define AR5K_AR5211_PCU_MAX     0x8fff
00678 
00679 /*
00680  * First station id register (MAC address in lower 32 bits)
00681  */
00682 #define AR5K_AR5211_STA_ID0     0x8000
00683 
00684 /*
00685  * Second station id register (MAC address in upper 16 bits)
00686  */
00687 #define AR5K_AR5211_STA_ID1                     0x8004
00688 #define AR5K_AR5211_STA_ID1_AP                  0x00010000
00689 #define AR5K_AR5211_STA_ID1_ADHOC               0x00020000
00690 #define AR5K_AR5211_STA_ID1_PWR_SV              0x00040000
00691 #define AR5K_AR5211_STA_ID1_NO_KEYSRCH          0x00080000
00692 #define AR5K_AR5211_STA_ID1_PCF                 0x00100000
00693 #define AR5K_AR5211_STA_ID1_DEFAULT_ANTENNA     0x00200000
00694 #define AR5K_AR5211_STA_ID1_DESC_ANTENNA        0x00400000
00695 #define AR5K_AR5211_STA_ID1_RTS_DEFAULT_ANTENNA 0x00800000
00696 #define AR5K_AR5211_STA_ID1_ACKCTS_6MB          0x01000000
00697 #define AR5K_AR5211_STA_ID1_BASE_RATE_11B       0x02000000
00698 
00699 /*
00700  * First BSSID register (MAC address, lower 32bits)
00701  */
00702 #define AR5K_AR5211_BSS_ID0     0x8008
00703 
00704 /*
00705  * Second BSSID register (MAC address in upper 16 bits)
00706  *
00707  * AID: Association ID
00708  */
00709 #define AR5K_AR5211_BSS_ID1             0x800c
00710 #define AR5K_AR5211_BSS_ID1_AID         0xffff0000
00711 #define AR5K_AR5211_BSS_ID1_AID_S       16
00712 
00713 /*
00714  * Backoff slot time register
00715  */
00716 #define AR5K_AR5211_SLOT_TIME   0x8010
00717 
00718 /*
00719  * ACK/CTS timeout register
00720  */
00721 #define AR5K_AR5211_TIME_OUT            0x8014
00722 #define AR5K_AR5211_TIME_OUT_ACK        0x00001fff
00723 #define AR5K_AR5211_TIME_OUT_ACK_S      0
00724 #define AR5K_AR5211_TIME_OUT_CTS        0x1fff0000
00725 #define AR5K_AR5211_TIME_OUT_CTS_S      16
00726 
00727 /*
00728  * RSSI threshold register
00729  */
00730 #define AR5K_AR5211_RSSI_THR            0x8018
00731 #define AR5K_AR5211_RSSI_THR_M          0x000000ff
00732 #define AR5K_AR5211_RSSI_THR_BMISS      0x0000ff00
00733 #define AR5K_AR5211_RSSI_THR_BMISS_S    8
00734 
00735 /*
00736  * Transmit latency register
00737  */
00738 #define AR5K_AR5211_USEC                0x801c
00739 #define AR5K_AR5211_USEC_1              0x0000007f
00740 #define AR5K_AR5211_USEC_1_S            0
00741 #define AR5K_AR5211_USEC_32             0x00003f80
00742 #define AR5K_AR5211_USEC_32_S           7
00743 #define AR5K_AR5211_USEC_TX_LATENCY     0x007fc000
00744 #define AR5K_AR5211_USEC_TX_LATENCY_S   14
00745 #define AR5K_AR5211_USEC_RX_LATENCY     0x1f800000
00746 #define AR5K_AR5211_USEC_RX_LATENCY_S   23
00747 #define AR5K_AR5311_USEC_TX_LATENCY     0x000fc000
00748 #define AR5K_AR5311_USEC_TX_LATENCY_S   14
00749 #define AR5K_AR5311_USEC_RX_LATENCY     0x03f00000
00750 #define AR5K_AR5311_USEC_RX_LATENCY_S   20
00751 
00752 /*
00753  * PCU beacon control register
00754  */
00755 #define AR5K_AR5211_BEACON              0x8020
00756 #define AR5K_AR5211_BEACON_PERIOD       0x0000ffff
00757 #define AR5K_AR5211_BEACON_PERIOD_S     0
00758 #define AR5K_AR5211_BEACON_TIM          0x007f0000
00759 #define AR5K_AR5211_BEACON_TIM_S        16
00760 #define AR5K_AR5211_BEACON_ENABLE       0x00800000
00761 #define AR5K_AR5211_BEACON_RESET_TSF    0x01000000
00762 
00763 /*
00764  * CFP period register
00765  */
00766 #define AR5K_AR5211_CFP_PERIOD          0x8024
00767 
00768 /*
00769  * Next beacon time register
00770  */
00771 #define AR5K_AR5211_TIMER0              0x8028
00772 
00773 /*
00774  * Next DMA beacon alert register
00775  */
00776 #define AR5K_AR5211_TIMER1              0x802c
00777 
00778 /*
00779  * Next software beacon alert register
00780  */
00781 #define AR5K_AR5211_TIMER2              0x8030
00782 
00783 /*
00784  * Next ATIM window time register
00785  */
00786 #define AR5K_AR5211_TIMER3              0x8034
00787 
00788 /*
00789  * CFP duration register
00790  */
00791 #define AR5K_AR5211_CFP_DUR             0x8038
00792 
00793 /*
00794  * Receive filter register
00795  */
00796 #define AR5K_AR5211_RX_FILTER           0x803c
00797 #define AR5K_AR5211_RX_FILTER_UNICAST   0x00000001
00798 #define AR5K_AR5211_RX_FILTER_MULTICAST 0x00000002
00799 #define AR5K_AR5211_RX_FILTER_BROADCAST 0x00000004
00800 #define AR5K_AR5211_RX_FILTER_CONTROL   0x00000008
00801 #define AR5K_AR5211_RX_FILTER_BEACON    0x00000010
00802 #define AR5K_AR5211_RX_FILTER_PROMISC   0x00000020
00803 #define AR5K_AR5211_RX_FILTER_PHYERR    0x00000040
00804 #define AR5K_AR5211_RX_FILTER_RADARERR  0x00000080
00805 
00806 /*
00807  * Multicast filter register (lower 32 bits)
00808  */
00809 #define AR5K_AR5211_MCAST_FIL0  0x8040
00810 
00811 /*
00812  * Multicast filter register (higher 16 bits)
00813  */
00814 #define AR5K_AR5211_MCAST_FIL1  0x8044
00815 
00816 /*
00817  * PCU control register
00818  */
00819 #define AR5K_AR5211_DIAG_SW                     0x8048
00820 #define AR5K_AR5211_DIAG_SW_DIS_WEP_ACK         0x00000001
00821 #define AR5K_AR5211_DIAG_SW_DIS_ACK             0x00000002
00822 #define AR5K_AR5211_DIAG_SW_DIS_CTS             0x00000004
00823 #define AR5K_AR5211_DIAG_SW_DIS_ENC             0x00000008
00824 #define AR5K_AR5211_DIAG_SW_DIS_DEC             0x00000010
00825 #define AR5K_AR5211_DIAG_SW_DIS_RX              0x00000020
00826 #define AR5K_AR5211_DIAG_SW_LOOP_BACK           0x00000040
00827 #define AR5K_AR5211_DIAG_SW_CORR_FCS            0x00000080
00828 #define AR5K_AR5211_DIAG_SW_CHAN_INFO           0x00000100
00829 #define AR5K_AR5211_DIAG_SW_EN_SCRAM_SEED       0x00000200
00830 #define AR5K_AR5211_DIAG_SW_ECO_ENABLE          0x00000400
00831 #define AR5K_AR5211_DIAG_SW_SCRAM_SEED_M        0x0001fc00
00832 #define AR5K_AR5211_DIAG_SW_SCRAM_SEED_S        10
00833 #define AR5K_AR5211_DIAG_SW_FRAME_NV0           0x00020000
00834 #define AR5K_AR5211_DIAG_SW_OBSPT_M             0x000c0000
00835 #define AR5K_AR5211_DIAG_SW_OBSPT_S             18
00836 
00837 /*
00838  * TSF (clock) register (lower 32 bits)
00839  */
00840 #define AR5K_AR5211_TSF_L32     0x804c
00841 
00842 /*
00843  * TSF (clock) register (higher 32 bits)
00844  */
00845 #define AR5K_AR5211_TSF_U32     0x8050
00846 
00847 /*
00848  * ADDAC test register
00849  */
00850 #define AR5K_AR5211_ADDAC_TEST  0x8054
00851 
00852 /*
00853  * Default antenna register
00854  */
00855 #define AR5K_AR5211_DEFAULT_ANTENNA     0x8058
00856 
00857 /*
00858  * Last beacon timestamp register
00859  */
00860 #define AR5K_AR5211_LAST_TSTP   0x8080
00861 
00862 /*
00863  * NAV register (current)
00864  */
00865 #define AR5K_AR5211_NAV         0x8084
00866 
00867 /*
00868  * RTS success register
00869  */
00870 #define AR5K_AR5211_RTS_OK      0x8088
00871 
00872 /*
00873  * RTS failure register
00874  */
00875 #define AR5K_AR5211_RTS_FAIL    0x808c
00876 
00877 /*
00878  * ACK failure register
00879  */
00880 #define AR5K_AR5211_ACK_FAIL    0x8090
00881 
00882 /*
00883  * FCS failure register
00884  */
00885 #define AR5K_AR5211_FCS_FAIL    0x8094
00886 
00887 /*
00888  * Beacon count register
00889  */
00890 #define AR5K_AR5211_BEACON_CNT  0x8098
00891 
00892 /*
00893  * Key table (WEP) register
00894  */
00895 #define AR5K_AR5211_KEYTABLE_0          0x8800
00896 #define AR5K_AR5211_KEYTABLE(n)         (AR5K_AR5211_KEYTABLE_0 + ((n) * 32))
00897 #define AR5K_AR5211_KEYTABLE_OFF(_n, x) (AR5K_AR5211_KEYTABLE(_n) + (x << 2))
00898 #define AR5K_AR5211_KEYTABLE_TYPE(_n)   AR5K_AR5211_KEYTABLE_OFF(_n, 5)
00899 #define AR5K_AR5211_KEYTABLE_TYPE_40    0x00000000
00900 #define AR5K_AR5211_KEYTABLE_TYPE_104   0x00000001
00901 #define AR5K_AR5211_KEYTABLE_TYPE_128   0x00000003
00902 #define AR5K_AR5211_KEYTABLE_TYPE_AES   0x00000005
00903 #define AR5K_AR5211_KEYTABLE_TYPE_NULL  0x00000007
00904 #define AR5K_AR5211_KEYTABLE_MAC0(_n)   AR5K_AR5211_KEYTABLE_OFF(_n, 6)
00905 #define AR5K_AR5211_KEYTABLE_MAC1(_n)   AR5K_AR5211_KEYTABLE_OFF(_n, 7)
00906 #define AR5K_AR5211_KEYTABLE_VALID      0x00008000
00907 
00908 #define AR5K_AR5211_KEYTABLE_SIZE       128
00909 #define AR5K_AR5211_KEYCACHE_SIZE       8
00910 
00911 /*
00912  * PHY register
00913  */
00914 #define AR5K_AR5211_PHY(_n)             (0x9800 + ((_n) << 2))
00915 #define AR5K_AR5211_PHY_SHIFT_2GHZ      0x00004007
00916 #define AR5K_AR5211_PHY_SHIFT_5GHZ      0x00000007
00917 
00918 /*
00919  * PHY turbo mode register
00920  */
00921 #define AR5K_AR5211_PHY_TURBO           0x9804
00922 #define AR5K_AR5211_PHY_TURBO_MODE      0x00000001
00923 #define AR5K_AR5211_PHY_TURBO_SHORT     0x00000002
00924 
00925 /*
00926  * PHY agility command register
00927  */
00928 #define AR5K_AR5211_PHY_AGC             0x9808
00929 #define AR5K_AR5211_PHY_AGC_DISABLE     0x08000000
00930 
00931 /*
00932  * PHY chip revision register
00933  */
00934 #define AR5K_AR5211_PHY_CHIP_ID         0x9818
00935 
00936 /*
00937  * PHY activation register
00938  */
00939 #define AR5K_AR5211_PHY_ACTIVE          0x981c
00940 #define AR5K_AR5211_PHY_ENABLE          0x00000001
00941 #define AR5K_AR5211_PHY_DISABLE         0x00000002
00942 
00943 /*
00944  * PHY agility control register
00945  */
00946 #define AR5K_AR5211_PHY_AGCCTL          0x9860
00947 #define AR5K_AR5211_PHY_AGCCTL_CAL      0x00000001
00948 #define AR5K_AR5211_PHY_AGCCTL_NF       0x00000002
00949 
00950 /*
00951  * PHY noise floor status register
00952  */
00953 #define AR5K_AR5211_PHY_NF              0x9864
00954 #define AR5K_AR5211_PHY_NF_M            0x000001ff
00955 #define AR5K_AR5211_PHY_NF_ACTIVE       0x00000100
00956 #define AR5K_AR5211_PHY_NF_RVAL(_n)     (((_n) >> 19) & AR5K_AR5211_PHY_NF_M)
00957 #define AR5K_AR5211_PHY_NF_AVAL(_n)     (-((_n) ^ AR5K_AR5211_PHY_NF_M) + 1)
00958 #define AR5K_AR5211_PHY_NF_SVAL(_n)     (((_n) & AR5K_AR5211_PHY_NF_M) | (1 << 9))
00959 
00960 /*
00961  * PHY PLL control register
00962  */
00963 #define AR5K_AR5211_PHY_PLL             0x987c
00964 #define AR5K_AR5211_PHY_PLL_20MHZ       0x13
00965 #define AR5K_AR5211_PHY_PLL_40MHZ       0x18
00966 #define AR5K_AR5211_PHY_PLL_44MHZ       0x19
00967 
00968 /*
00969  * PHY receiver delay register
00970  */
00971 #define AR5K_AR5211_PHY_RX_DELAY        0x9914
00972 #define AR5K_AR5211_PHY_RX_DELAY_M      0x00003fff
00973 
00974 /*
00975  * PHY timing IQ control register
00976  */
00977 #define AR5K_AR5211_PHY_IQ                      0x9920
00978 #define AR5K_AR5211_PHY_IQ_CORR_Q_Q_COFF        0x0000001f
00979 #define AR5K_AR5211_PHY_IQ_CORR_Q_I_COFF        0x000007e0
00980 #define AR5K_AR5211_PHY_IQ_CORR_Q_I_COFF_S      5
00981 #define AR5K_AR5211_PHY_IQ_CORR_ENABLE          0x00000800
00982 #define AR5K_AR5211_PHY_IQ_CAL_NUM_LOG_MAX      0x0000f000
00983 #define AR5K_AR5211_PHY_IQ_CAL_NUM_LOG_MAX_S    12
00984 #define AR5K_AR5211_PHY_IQ_RUN                  0x00010000
00985 
00986 /*
00987  * PHY PAPD probe register
00988  */
00989 #define AR5K_AR5211_PHY_PAPD_PROBE              0x9930
00990 #define AR5K_AR5211_PHY_PAPD_PROBE_TX_PWR       0x00007e00
00991 #define AR5K_AR5211_PHY_PAPD_PROBE_TX_PWR_S     9
00992 #define AR5K_AR5211_PHY_PAPD_PROBE_TX_NEXT      0x00008000
00993 #define AR5K_AR5211_PHY_PAPD_PROBE_GAINF        0xfe000000
00994 #define AR5K_AR5211_PHY_PAPD_PROBE_GAINF_S      25
00995 
00996 /*
00997  * PHY frame control register
00998  */
00999 #define AR5K_AR5211_PHY_FC              0x9944
01000 #define AR5K_AR5211_PHY_FC_TX_CLIP      0x00000038
01001 #define AR5K_AR5211_PHY_FC_TX_CLIP_S    3
01002 
01003 /*
01004  * PHY radar detection enable register
01005  */
01006 #define AR5K_AR5211_PHY_RADAR           0x9954
01007 #define AR5K_AR5211_PHY_RADAR_DISABLE   0x00000000
01008 #define AR5K_AR5211_PHY_RADAR_ENABLE    0x00000001
01009 
01010 /*
01011  * PHY antenna switch table registers
01012  */
01013 #define AR5K_AR5211_PHY_ANT_SWITCH_TABLE_0      0x9960
01014 #define AR5K_AR5211_PHY_ANT_SWITCH_TABLE_1      0x9964
01015 
01016 /*
01017  * PHY timing IQ calibration result register
01018  */
01019 #define AR5K_AR5211_PHY_IQRES_CAL_PWR_I 0x9c10
01020 #define AR5K_AR5211_PHY_IQRES_CAL_PWR_Q 0x9c14
01021 #define AR5K_AR5211_PHY_IQRES_CAL_CORR  0x9c18
01022 
01023 /*
01024  * PHY current RSSI register
01025  */
01026 #define AR5K_AR5211_PHY_CURRENT_RSSI    0x9c1c
01027 
01028 /*
01029  * PHY mode register
01030  */
01031 #define AR5K_AR5211_PHY_MODE            0xa200
01032 #define AR5K_AR5211_PHY_MODE_MOD        0x00000001
01033 #define AR5K_AR5211_PHY_MODE_MOD_OFDM   0
01034 #define AR5K_AR5211_PHY_MODE_MOD_CCK    1
01035 #define AR5K_AR5211_PHY_MODE_FREQ       0x00000002
01036 #define AR5K_AR5211_PHY_MODE_FREQ_5GHZ  0
01037 #define AR5K_AR5211_PHY_MODE_FREQ_2GHZ  2
01038 
01039 /*
01040  * Misc PHY/radio registers
01041  */
01042 #define AR5K_AR5211_BB_GAIN(_n)         (0x9b00 + ((_n) << 2))
01043 #define AR5K_AR5211_RF_GAIN(_n)         (0x9a00 + ((_n) << 2))
01044 
01045 #endif

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