iPXE
ath5k.h File Reference
#include <stddef.h>
#include <string.h>
#include <byteswap.h>
#include <ipxe/io.h>
#include <ipxe/netdevice.h>
#include <ipxe/net80211.h>
#include <errno.h>
#include "desc.h"
#include "eeprom.h"

Go to the source code of this file.

Data Structures

struct  ath5k_srev_name
struct  ath5k_tx_status
struct  ath5k_txq_info
struct  ath5k_rx_status
struct  ath5k_gain
struct  ath5k_athchan_2ghz
struct  ath5k_capabilities
struct  ath5k_hw
 ath5k_hw_get_isr - Get interrupt status More...

Macros

#define ERRFILE   ERRFILE_ath5k
#define PCI_DEVICE_ID_ATHEROS_AR5210   0x0007 /* AR5210 */
#define PCI_DEVICE_ID_ATHEROS_AR5311   0x0011 /* AR5311 */
#define PCI_DEVICE_ID_ATHEROS_AR5211   0x0012 /* AR5211 */
#define PCI_DEVICE_ID_ATHEROS_AR5212   0x0013 /* AR5212 */
#define PCI_DEVICE_ID_3COM_3CRDAG675   0x0013 /* 3CRDAG675 (Atheros AR5212) */
#define PCI_DEVICE_ID_3COM_2_3CRPAG175   0x0013 /* 3CRPAG175 (Atheros AR5212) */
#define PCI_DEVICE_ID_ATHEROS_AR5210_AP   0x0207 /* AR5210 (Early) */
#define PCI_DEVICE_ID_ATHEROS_AR5212_IBM   0x1014 /* AR5212 (IBM MiniPCI) */
#define PCI_DEVICE_ID_ATHEROS_AR5210_DEFAULT   0x1107 /* AR5210 (no eeprom) */
#define PCI_DEVICE_ID_ATHEROS_AR5212_DEFAULT   0x1113 /* AR5212 (no eeprom) */
#define PCI_DEVICE_ID_ATHEROS_AR5211_DEFAULT   0x1112 /* AR5211 (no eeprom) */
#define PCI_DEVICE_ID_ATHEROS_AR5212_FPGA   0xf013 /* AR5212 (emulation board) */
#define PCI_DEVICE_ID_ATHEROS_AR5211_LEGACY   0xff12 /* AR5211 (emulation board) */
#define PCI_DEVICE_ID_ATHEROS_AR5211_FPGA11B   0xf11b /* AR5211 (emulation board) */
#define PCI_DEVICE_ID_ATHEROS_AR5312_REV2   0x0052 /* AR5312 WMAC (AP31) */
#define PCI_DEVICE_ID_ATHEROS_AR5312_REV7   0x0057 /* AR5312 WMAC (AP30-040) */
#define PCI_DEVICE_ID_ATHEROS_AR5312_REV8   0x0058 /* AR5312 WMAC (AP43-030) */
#define PCI_DEVICE_ID_ATHEROS_AR5212_0014   0x0014 /* AR5212 compatible */
#define PCI_DEVICE_ID_ATHEROS_AR5212_0015   0x0015 /* AR5212 compatible */
#define PCI_DEVICE_ID_ATHEROS_AR5212_0016   0x0016 /* AR5212 compatible */
#define PCI_DEVICE_ID_ATHEROS_AR5212_0017   0x0017 /* AR5212 compatible */
#define PCI_DEVICE_ID_ATHEROS_AR5212_0018   0x0018 /* AR5212 compatible */
#define PCI_DEVICE_ID_ATHEROS_AR5212_0019   0x0019 /* AR5212 compatible */
#define PCI_DEVICE_ID_ATHEROS_AR2413   0x001a /* AR2413 (Griffin-lite) */
#define PCI_DEVICE_ID_ATHEROS_AR5413   0x001b /* AR5413 (Eagle) */
#define PCI_DEVICE_ID_ATHEROS_AR5424   0x001c /* AR5424 (Condor PCI-E) */
#define PCI_DEVICE_ID_ATHEROS_AR5416   0x0023 /* AR5416 */
#define PCI_DEVICE_ID_ATHEROS_AR5418   0x0024 /* AR5418 */
#define AR5K_REG_SM(_val, _flags)
#define AR5K_REG_MS(_val, _flags)
#define AR5K_REG_WRITE_BITS(ah, _reg, _flags, _val)
#define AR5K_REG_MASKED_BITS(ah, _reg, _flags, _mask)
#define AR5K_REG_ENABLE_BITS(ah, _reg, _flags)
#define AR5K_REG_DISABLE_BITS(ah, _reg, _flags)
#define AR5K_PHY_READ(ah, _reg)
#define AR5K_PHY_WRITE(ah, _reg, _val)
#define AR5K_REG_READ_Q(ah, _reg, _queue)
#define AR5K_REG_WRITE_Q(ah, _reg, _queue)
#define AR5K_Q_ENABLE_BITS(_reg, _queue)
#define AR5K_Q_DISABLE_BITS(_reg, _queue)
#define AR5K_REG_WAIT(_i)
#define AR5K_INI_RFGAIN_5GHZ   0
#define AR5K_INI_RFGAIN_2GHZ   1
#define AR5K_INI_VAL_11A   0
#define AR5K_INI_VAL_11A_TURBO   1
#define AR5K_INI_VAL_11B   2
#define AR5K_INI_VAL_11G   3
#define AR5K_INI_VAL_11G_TURBO   4
#define AR5K_INI_VAL_XR   0
#define AR5K_INI_VAL_MAX   5
#define AR5K_LOW_ID(_a)
#define AR5K_HIGH_ID(_a)
#define IEEE80211_MAX_LEN   2352
#define AR5K_TUNE_DMA_BEACON_RESP   2
#define AR5K_TUNE_SW_BEACON_RESP   10
#define AR5K_TUNE_ADDITIONAL_SWBA_BACKOFF   0
#define AR5K_TUNE_RADAR_ALERT   0
#define AR5K_TUNE_MIN_TX_FIFO_THRES   1
#define AR5K_TUNE_MAX_TX_FIFO_THRES   ((IEEE80211_MAX_LEN / 64) + 1)
#define AR5K_TUNE_REGISTER_TIMEOUT   20000
#define AR5K_TUNE_RSSI_THRES   129
#define AR5K_TUNE_BMISS_THRES   7
#define AR5K_TUNE_REGISTER_DWELL_TIME   20000
#define AR5K_TUNE_BEACON_INTERVAL   100
#define AR5K_TUNE_AIFS   2
#define AR5K_TUNE_AIFS_11B   2
#define AR5K_TUNE_AIFS_XR   0
#define AR5K_TUNE_CWMIN   15
#define AR5K_TUNE_CWMIN_11B   31
#define AR5K_TUNE_CWMIN_XR   3
#define AR5K_TUNE_CWMAX   1023
#define AR5K_TUNE_CWMAX_11B   1023
#define AR5K_TUNE_CWMAX_XR   7
#define AR5K_TUNE_NOISE_FLOOR   -72
#define AR5K_TUNE_MAX_TXPOWER   63
#define AR5K_TUNE_DEFAULT_TXPOWER   25
#define AR5K_TUNE_TPC_TXPOWER   0
#define AR5K_TUNE_ANT_DIVERSITY   1
#define AR5K_TUNE_HWTXTRIES   4
#define AR5K_INIT_CARR_SENSE_EN   1
#define AR5K_INIT_CFG
#define AR5K_INIT_CYCRSSI_THR1   2
#define AR5K_INIT_TX_LATENCY   502
#define AR5K_INIT_USEC   39
#define AR5K_INIT_USEC_TURBO   79
#define AR5K_INIT_USEC_32   31
#define AR5K_INIT_SLOT_TIME   396
#define AR5K_INIT_SLOT_TIME_TURBO   480
#define AR5K_INIT_ACK_CTS_TIMEOUT   1024
#define AR5K_INIT_ACK_CTS_TIMEOUT_TURBO   0x08000800
#define AR5K_INIT_PROG_IFS   920
#define AR5K_INIT_PROG_IFS_TURBO   960
#define AR5K_INIT_EIFS   3440
#define AR5K_INIT_EIFS_TURBO   6880
#define AR5K_INIT_SIFS   560
#define AR5K_INIT_SIFS_TURBO   480
#define AR5K_INIT_SH_RETRY   10
#define AR5K_INIT_LG_RETRY   AR5K_INIT_SH_RETRY
#define AR5K_INIT_SSH_RETRY   32
#define AR5K_INIT_SLG_RETRY   AR5K_INIT_SSH_RETRY
#define AR5K_INIT_TX_RETRY   10
#define AR5K_INIT_TRANSMIT_LATENCY
#define AR5K_INIT_TRANSMIT_LATENCY_TURBO
#define AR5K_INIT_PROTO_TIME_CNTRL
#define AR5K_INIT_PROTO_TIME_CNTRL_TURBO
#define AR5K_TXQ_USEDEFAULT   ((u32) -1)
#define AR5K_SREV_UNKNOWN   0xffff
#define AR5K_SREV_AR5210   0x00 /* Crete */
#define AR5K_SREV_AR5311   0x10 /* Maui 1 */
#define AR5K_SREV_AR5311A   0x20 /* Maui 2 */
#define AR5K_SREV_AR5311B   0x30 /* Spirit */
#define AR5K_SREV_AR5211   0x40 /* Oahu */
#define AR5K_SREV_AR5212   0x50 /* Venice */
#define AR5K_SREV_AR5213   0x55 /* ??? */
#define AR5K_SREV_AR5213A   0x59 /* Hainan */
#define AR5K_SREV_AR2413   0x78 /* Griffin lite */
#define AR5K_SREV_AR2414   0x70 /* Griffin */
#define AR5K_SREV_AR5424   0x90 /* Condor */
#define AR5K_SREV_AR5413   0xa4 /* Eagle lite */
#define AR5K_SREV_AR5414   0xa0 /* Eagle */
#define AR5K_SREV_AR2415   0xb0 /* Talon */
#define AR5K_SREV_AR5416   0xc0 /* PCI-E */
#define AR5K_SREV_AR5418   0xca /* PCI-E */
#define AR5K_SREV_AR2425   0xe0 /* Swan */
#define AR5K_SREV_AR2417   0xf0 /* Nala */
#define AR5K_SREV_RAD_5110   0x00
#define AR5K_SREV_RAD_5111   0x10
#define AR5K_SREV_RAD_5111A   0x15
#define AR5K_SREV_RAD_2111   0x20
#define AR5K_SREV_RAD_5112   0x30
#define AR5K_SREV_RAD_5112A   0x35
#define AR5K_SREV_RAD_5112B   0x36
#define AR5K_SREV_RAD_2112   0x40
#define AR5K_SREV_RAD_2112A   0x45
#define AR5K_SREV_RAD_2112B   0x46
#define AR5K_SREV_RAD_2413   0x50
#define AR5K_SREV_RAD_5413   0x60
#define AR5K_SREV_RAD_2316   0x70 /* Cobra SoC */
#define AR5K_SREV_RAD_2317   0x80
#define AR5K_SREV_RAD_5424   0xa0 /* Mostly same as 5413 */
#define AR5K_SREV_RAD_2425   0xa2
#define AR5K_SREV_RAD_5133   0xc0
#define AR5K_SREV_PHY_5211   0x30
#define AR5K_SREV_PHY_5212   0x41
#define AR5K_SREV_PHY_5212A   0x42
#define AR5K_SREV_PHY_5212B   0x43
#define AR5K_SREV_PHY_2413   0x45
#define AR5K_SREV_PHY_5413   0x61
#define AR5K_SREV_PHY_2425   0x70
#define MODULATION_XR   0x00000200
#define MODULATION_TURBO   0x00000080
#define AR5K_TXSTAT_ALTRATE   0x80
#define AR5K_TXERR_XRETRY   0x01
#define AR5K_TXERR_FILT   0x02
#define AR5K_TXERR_FIFO   0x04
#define AR5K_TXQ_FLAG_TXOKINT_ENABLE   0x0001 /* Enable TXOK interrupt */
#define AR5K_TXQ_FLAG_TXERRINT_ENABLE   0x0002 /* Enable TXERR interrupt */
#define AR5K_TXQ_FLAG_TXEOLINT_ENABLE   0x0004 /* Enable TXEOL interrupt -not used- */
#define AR5K_TXQ_FLAG_TXDESCINT_ENABLE   0x0008 /* Enable TXDESC interrupt -not used- */
#define AR5K_TXQ_FLAG_TXURNINT_ENABLE   0x0010 /* Enable TXURN interrupt */
#define AR5K_TXQ_FLAG_CBRORNINT_ENABLE   0x0020 /* Enable CBRORN interrupt */
#define AR5K_TXQ_FLAG_CBRURNINT_ENABLE   0x0040 /* Enable CBRURN interrupt */
#define AR5K_TXQ_FLAG_QTRIGINT_ENABLE   0x0080 /* Enable QTRIG interrupt */
#define AR5K_TXQ_FLAG_TXNOFRMINT_ENABLE   0x0100 /* Enable TXNOFRM interrupt */
#define AR5K_TXQ_FLAG_BACKOFF_DISABLE   0x0200 /* Disable random post-backoff */
#define AR5K_TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE   0x0300 /* Enable ready time expiry policy (?)*/
#define AR5K_TXQ_FLAG_FRAG_BURST_BACKOFF_ENABLE   0x0800 /* Enable backoff while bursting */
#define AR5K_TXQ_FLAG_POST_FR_BKOFF_DIS   0x1000 /* Disable backoff while bursting */
#define AR5K_TXQ_FLAG_COMPRESSION_ENABLE   0x2000 /* Enable hw compression -not implemented-*/
#define AR5K_TXPOWER_OFDM(_r, _v)
#define AR5K_TXPOWER_CCK(_r, _v)
#define AR5K_RXERR_CRC   0x01
#define AR5K_RXERR_PHY   0x02
#define AR5K_RXERR_FIFO   0x04
#define AR5K_RXERR_DECRYPT   0x08
#define AR5K_RXERR_MIC   0x10
#define AR5K_RXKEYIX_INVALID   ((u8) - 1)
#define AR5K_TXKEYIX_INVALID   ((u32) - 1)
#define TSF_TO_TU(_tsf)
#define AR5K_SLOT_TIME_9   396
#define AR5K_SLOT_TIME_20   880
#define AR5K_SLOT_TIME_MAX   0xffff
#define CHANNEL_CW_INT   0x0008 /* Contention Window interference detected */
#define CHANNEL_TURBO   0x0010 /* Turbo Channel */
#define CHANNEL_CCK   0x0020 /* CCK channel */
#define CHANNEL_OFDM   0x0040 /* OFDM channel */
#define CHANNEL_2GHZ   0x0080 /* 2GHz channel. */
#define CHANNEL_5GHZ   0x0100 /* 5GHz channel */
#define CHANNEL_PASSIVE   0x0200 /* Only passive scan allowed */
#define CHANNEL_DYN   0x0400 /* Dynamic CCK-OFDM channel (for g operation) */
#define CHANNEL_XR   0x0800 /* XR channel */
#define CHANNEL_A   (CHANNEL_5GHZ|CHANNEL_OFDM)
#define CHANNEL_B   (CHANNEL_2GHZ|CHANNEL_CCK)
#define CHANNEL_G   (CHANNEL_2GHZ|CHANNEL_OFDM)
#define CHANNEL_T   (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_TURBO)
#define CHANNEL_TG   (CHANNEL_2GHZ|CHANNEL_OFDM|CHANNEL_TURBO)
#define CHANNEL_108A   CHANNEL_T
#define CHANNEL_108G   CHANNEL_TG
#define CHANNEL_X   (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_XR)
#define CHANNEL_ALL
#define CHANNEL_ALL_NOTURBO   (CHANNEL_ALL & ~CHANNEL_TURBO)
#define CHANNEL_MODES   CHANNEL_ALL
#define IS_CHAN_XR(_c)
#define IS_CHAN_B(_c)
#define AR5K_MAX_RATES   32
 Seems the ar5xxx harware supports up to 32 rates, indexed by 1-32.
#define ATH5K_RATE_CODE_1M   0x1B
#define ATH5K_RATE_CODE_2M   0x1A
#define ATH5K_RATE_CODE_5_5M   0x19
#define ATH5K_RATE_CODE_11M   0x18
#define ATH5K_RATE_CODE_6M   0x0B
#define ATH5K_RATE_CODE_9M   0x0F
#define ATH5K_RATE_CODE_12M   0x0A
#define ATH5K_RATE_CODE_18M   0x0E
#define ATH5K_RATE_CODE_24M   0x09
#define ATH5K_RATE_CODE_36M   0x0D
#define ATH5K_RATE_CODE_48M   0x08
#define ATH5K_RATE_CODE_54M   0x0C
#define ATH5K_RATE_CODE_XR_500K   0x07
#define ATH5K_RATE_CODE_XR_1M   0x02
#define ATH5K_RATE_CODE_XR_2M   0x06
#define ATH5K_RATE_CODE_XR_3M   0x01
#define AR5K_SET_SHORT_PREAMBLE   0x04
#define AR5K_KEYCACHE_SIZE   8
#define AR5K_RSSI_EP_MULTIPLIER   (1<<7)
#define AR5K_ASSERT_ENTRY(_e, _s)
#define AR5K_SOFTLED_PIN   0
#define AR5K_SOFTLED_ON   0
#define AR5K_SOFTLED_OFF   1
#define AR5K_MAX_GPIO   10
#define AR5K_MAX_RF_BANKS   8
#define ah_regdomain   ah_capabilities.cap_regdomain.reg_current
#define ah_regdomain_hw   ah_capabilities.cap_regdomain.reg_hw
#define ah_modes   ah_capabilities.cap_mode
#define ah_ee_version   ah_capabilities.cap_eeprom.ee_version

Enumerations

enum  ath5k_version { AR5K_AR5210 = 0 , AR5K_AR5211 = 1 , AR5K_AR5212 = 2 }
enum  ath5k_radio {
  AR5K_RF5110 = 0 , AR5K_RF5111 = 1 , AR5K_RF5112 = 2 , AR5K_RF2413 = 3 ,
  AR5K_RF5413 = 4 , AR5K_RF2316 = 5 , AR5K_RF2317 = 6 , AR5K_RF2425 = 7
}
enum  ath5k_srev_type { AR5K_VERSION_MAC , AR5K_VERSION_RAD }
enum  ath5k_driver_mode {
  AR5K_MODE_11A = 0 , AR5K_MODE_11A_TURBO = 1 , AR5K_MODE_11B = 2 , AR5K_MODE_11G = 3 ,
  AR5K_MODE_11G_TURBO = 4 , AR5K_MODE_XR = 5
}
enum  {
  AR5K_MODE_BIT_11A = (1 << AR5K_MODE_11A) , AR5K_MODE_BIT_11A_TURBO = (1 << AR5K_MODE_11A_TURBO) , AR5K_MODE_BIT_11B = (1 << AR5K_MODE_11B) , AR5K_MODE_BIT_11G = (1 << AR5K_MODE_11G) ,
  AR5K_MODE_BIT_11G_TURBO = (1 << AR5K_MODE_11G_TURBO) , AR5K_MODE_BIT_XR = (1 << AR5K_MODE_XR)
}
enum  ath5k_tx_queue {
  AR5K_TX_QUEUE_INACTIVE = 0 , AR5K_TX_QUEUE_DATA , AR5K_TX_QUEUE_XR_DATA , AR5K_TX_QUEUE_BEACON ,
  AR5K_TX_QUEUE_CAB , AR5K_TX_QUEUE_UAPSD
}
 enum ath5k_tx_queue - Queue types used to classify tx queues. More...
enum  ath5k_tx_queue_subtype { AR5K_WME_AC_BK = 0 , AR5K_WME_AC_BE , AR5K_WME_AC_VI , AR5K_WME_AC_VO }
enum  ath5k_tx_queue_id {
  AR5K_TX_QUEUE_ID_NOQCU_DATA = 0 , AR5K_TX_QUEUE_ID_NOQCU_BEACON = 1 , AR5K_TX_QUEUE_ID_DATA_MIN = 0 , AR5K_TX_QUEUE_ID_DATA_MAX = 4 ,
  AR5K_TX_QUEUE_ID_DATA_SVP = 5 , AR5K_TX_QUEUE_ID_CAB = 6 , AR5K_TX_QUEUE_ID_BEACON = 7 , AR5K_TX_QUEUE_ID_UAPSD = 8 ,
  AR5K_TX_QUEUE_ID_XR_DATA = 9
}
enum  ath5k_pkt_type {
  AR5K_PKT_TYPE_NORMAL = 0 , AR5K_PKT_TYPE_ATIM = 1 , AR5K_PKT_TYPE_PSPOLL = 2 , AR5K_PKT_TYPE_BEACON = 3 ,
  AR5K_PKT_TYPE_PROBE_RESP = 4 , AR5K_PKT_TYPE_PIFS = 5
}
enum  ath5k_dmasize {
  AR5K_DMASIZE_4B = 0 , AR5K_DMASIZE_8B , AR5K_DMASIZE_16B , AR5K_DMASIZE_32B ,
  AR5K_DMASIZE_64B , AR5K_DMASIZE_128B , AR5K_DMASIZE_256B , AR5K_DMASIZE_512B
}
enum  ath5k_rfgain { AR5K_RFGAIN_INACTIVE = 0 , AR5K_RFGAIN_ACTIVE , AR5K_RFGAIN_READ_REQUESTED , AR5K_RFGAIN_NEED_CHANGE }
enum  ath5k_int {
  AR5K_INT_RXOK = 0x00000001 , AR5K_INT_RXDESC = 0x00000002 , AR5K_INT_RXERR = 0x00000004 , AR5K_INT_RXNOFRM = 0x00000008 ,
  AR5K_INT_RXEOL = 0x00000010 , AR5K_INT_RXORN = 0x00000020 , AR5K_INT_TXOK = 0x00000040 , AR5K_INT_TXDESC = 0x00000080 ,
  AR5K_INT_TXERR = 0x00000100 , AR5K_INT_TXNOFRM = 0x00000200 , AR5K_INT_TXEOL = 0x00000400 , AR5K_INT_TXURN = 0x00000800 ,
  AR5K_INT_MIB = 0x00001000 , AR5K_INT_SWI = 0x00002000 , AR5K_INT_RXPHY = 0x00004000 , AR5K_INT_RXKCM = 0x00008000 ,
  AR5K_INT_SWBA = 0x00010000 , AR5K_INT_BRSSI = 0x00020000 , AR5K_INT_BMISS = 0x00040000 , AR5K_INT_FATAL = 0x00080000 ,
  AR5K_INT_BNR = 0x00100000 , AR5K_INT_TIM = 0x00200000 , AR5K_INT_DTIM = 0x00400000 , AR5K_INT_DTIM_SYNC = 0x00800000 ,
  AR5K_INT_GPIO = 0x01000000 , AR5K_INT_BCN_TIMEOUT = 0x02000000 , AR5K_INT_CAB_TIMEOUT = 0x04000000 , AR5K_INT_RX_DOPPLER = 0x08000000 ,
  AR5K_INT_QCBRORN = 0x10000000 , AR5K_INT_QCBRURN = 0x20000000 , AR5K_INT_QTRIG = 0x40000000 , AR5K_INT_GLOBAL = 0x80000000 ,
  AR5K_INT_COMMON , AR5K_INT_NOCARD = 0xffffffff
}
 enum ath5k_int - Hardware interrupt masks helpers More...
enum  ath5k_power_mode {
  AR5K_PM_UNDEFINED = 0 , AR5K_PM_AUTO , AR5K_PM_AWAKE , AR5K_PM_FULL_SLEEP ,
  AR5K_PM_NETWORK_SLEEP
}
enum  ath5k_capability_type {
  AR5K_CAP_REG_DMN = 0 , AR5K_CAP_TKIP_MIC = 2 , AR5K_CAP_TKIP_SPLIT = 3 , AR5K_CAP_PHYCOUNTERS = 4 ,
  AR5K_CAP_DIVERSITY = 5 , AR5K_CAP_NUM_TXQUEUES = 6 , AR5K_CAP_VEOL = 7 , AR5K_CAP_COMPRESSION = 8 ,
  AR5K_CAP_BURST = 9 , AR5K_CAP_FASTFRAME = 10 , AR5K_CAP_TXPOW = 11 , AR5K_CAP_TPC = 12 ,
  AR5K_CAP_BSSIDMASK = 13 , AR5K_CAP_MCAST_KEYSRCH = 14 , AR5K_CAP_TSF_ADJUST = 15 , AR5K_CAP_XR = 16 ,
  AR5K_CAP_WME_TKIPMIC = 17 , AR5K_CAP_CHAN_HALFRATE = 18 , AR5K_CAP_CHAN_QUARTERRATE = 19 , AR5K_CAP_RFSILENT = 20
}

Functions

 FILE_LICENCE (MIT)
 FILE_SECBOOT (FORBIDDEN)
int ath5k_bitrate_to_hw_rix (int bitrate)
int ath5k_hw_attach (struct ath5k_softc *sc, u8 mac_version, struct ath5k_hw **ah)
 ath5k_hw_attach - Check if hw is supported and init the needed structs
void ath5k_hw_detach (struct ath5k_hw *ah)
 ath5k_hw_detach - Free the ath5k_hw struct
int ath5k_init_leds (struct ath5k_softc *sc)
void ath5k_led_enable (struct ath5k_softc *sc)
void ath5k_led_off (struct ath5k_softc *sc)
void ath5k_unregister_leds (struct ath5k_softc *sc)
int ath5k_hw_nic_wakeup (struct ath5k_hw *ah, int flags, int initial)
int ath5k_hw_reset (struct ath5k_hw *ah, struct net80211_channel *channel, int change_channel)
int ath5k_hw_set_power (struct ath5k_hw *ah, enum ath5k_power_mode mode, int set_chip, u16 sleep_duration)
void ath5k_hw_start_rx_dma (struct ath5k_hw *ah)
 ath5k_hw_start_rx_dma - Start DMA receive
int ath5k_hw_stop_rx_dma (struct ath5k_hw *ah)
 ath5k_hw_stop_rx_dma - Stop DMA receive
u32 ath5k_hw_get_rxdp (struct ath5k_hw *ah)
 ath5k_hw_get_rxdp - Get RX Descriptor's address
void ath5k_hw_set_rxdp (struct ath5k_hw *ah, u32 phys_addr)
 ath5k_hw_set_rxdp - Set RX Descriptor's address
int ath5k_hw_start_tx_dma (struct ath5k_hw *ah, unsigned int queue)
 ath5k_hw_start_tx_dma - Start DMA transmit for a specific queue
int ath5k_hw_stop_tx_dma (struct ath5k_hw *ah, unsigned int queue)
 ath5k_hw_stop_tx_dma - Stop DMA transmit on a specific queue
u32 ath5k_hw_get_txdp (struct ath5k_hw *ah, unsigned int queue)
 ath5k_hw_get_txdp - Get TX Descriptor's address for a specific queue
int ath5k_hw_set_txdp (struct ath5k_hw *ah, unsigned int queue, u32 phys_addr)
 ath5k_hw_set_txdp - Set TX Descriptor's address for a specific queue
int ath5k_hw_update_tx_triglevel (struct ath5k_hw *ah, int increase)
 ath5k_hw_update_tx_triglevel - Update tx trigger level
int ath5k_hw_is_intr_pending (struct ath5k_hw *ah)
 ath5k_hw_is_intr_pending - Check if we have pending interrupts
int ath5k_hw_get_isr (struct ath5k_hw *ah, enum ath5k_int *interrupt_mask)
enum ath5k_int ath5k_hw_set_imr (struct ath5k_hw *ah, enum ath5k_int new_mask)
 ath5k_hw_set_imr - Set interrupt mask
int ath5k_eeprom_init (struct ath5k_hw *ah)
void ath5k_eeprom_detach (struct ath5k_hw *ah)
int ath5k_eeprom_read_mac (struct ath5k_hw *ah, u8 *mac)
int ath5k_eeprom_is_hb63 (struct ath5k_hw *ah)
int ath5k_hw_set_opmode (struct ath5k_hw *ah)
 ath5k_hw_set_opmode - Set PCU operating mode
void ath5k_hw_get_lladdr (struct ath5k_hw *ah, u8 *mac)
 ath5k_hw_get_lladdr - Get station id
int ath5k_hw_set_lladdr (struct ath5k_hw *ah, const u8 *mac)
 ath5k_hw_set_lladdr - Set station id
void ath5k_hw_set_associd (struct ath5k_hw *ah, const u8 *bssid, u16 assoc_id)
 ath5k_hw_set_associd - Set BSSID for association
int ath5k_hw_set_bssid_mask (struct ath5k_hw *ah, const u8 *mask)
 ath5k_hw_set_bssid_mask - filter out bssids we listen
void ath5k_hw_start_rx_pcu (struct ath5k_hw *ah)
 ath5k_hw_start_rx_pcu - Start RX engine
void ath5k_hw_stop_rx_pcu (struct ath5k_hw *ah)
 at5k_hw_stop_rx_pcu - Stop RX engine
void ath5k_hw_set_mcast_filter (struct ath5k_hw *ah, u32 filter0, u32 filter1)
u32 ath5k_hw_get_rx_filter (struct ath5k_hw *ah)
 ath5k_hw_get_rx_filter - Get current rx filter
void ath5k_hw_set_rx_filter (struct ath5k_hw *ah, u32 filter)
 ath5k_hw_set_rx_filter - Set rx filter
void ath5k_hw_set_ack_bitrate_high (struct ath5k_hw *ah, int high)
 ath5k_hw_set_ack_bitrate - set bitrate for ACKs
int ath5k_hw_set_ack_timeout (struct ath5k_hw *ah, unsigned int timeout)
 ath5k_hw_set_ack_timeout - Set ACK timeout on PCU
unsigned int ath5k_hw_get_ack_timeout (struct ath5k_hw *ah)
 ath5k_hw_het_ack_timeout - Get ACK timeout from PCU in usec
int ath5k_hw_set_cts_timeout (struct ath5k_hw *ah, unsigned int timeout)
 ath5k_hw_set_cts_timeout - Set CTS timeout on PCU
unsigned int ath5k_hw_get_cts_timeout (struct ath5k_hw *ah)
 ath5k_hw_get_cts_timeout - Get CTS timeout from PCU in usec
int ath5k_hw_reset_key (struct ath5k_hw *ah, u16 entry)
int ath5k_hw_set_tx_queueprops (struct ath5k_hw *ah, const struct ath5k_txq_info *queue_info)
int ath5k_hw_setup_tx_queue (struct ath5k_hw *ah, enum ath5k_tx_queue queue_type, struct ath5k_txq_info *queue_info)
u32 ath5k_hw_num_tx_pending (struct ath5k_hw *ah)
void ath5k_hw_release_tx_queue (struct ath5k_hw *ah)
int ath5k_hw_reset_tx_queue (struct ath5k_hw *ah)
int ath5k_hw_set_slot_time (struct ath5k_hw *ah, unsigned int slot_time)
int ath5k_hw_init_desc_functions (struct ath5k_hw *ah)
int ath5k_hw_set_gpio_input (struct ath5k_hw *ah, u32 gpio)
int ath5k_hw_set_gpio_output (struct ath5k_hw *ah, u32 gpio)
u32 ath5k_hw_get_gpio (struct ath5k_hw *ah, u32 gpio)
int ath5k_hw_set_gpio (struct ath5k_hw *ah, u32 gpio, u32 val)
void ath5k_hw_set_gpio_intr (struct ath5k_hw *ah, unsigned int gpio, u32 interrupt_level)
void ath5k_rfkill_hw_start (struct ath5k_hw *ah)
void ath5k_rfkill_hw_stop (struct ath5k_hw *ah)
int ath5k_hw_set_capabilities (struct ath5k_hw *ah)
int ath5k_hw_get_capability (struct ath5k_hw *ah, enum ath5k_capability_type cap_type, u32 capability, u32 *result)
int ath5k_hw_enable_pspoll (struct ath5k_hw *ah, u8 *bssid, u16 assoc_id)
int ath5k_hw_disable_pspoll (struct ath5k_hw *ah)
int ath5k_hw_write_initvals (struct ath5k_hw *ah, u8 mode, int change_channel)
int ath5k_hw_rfregs_init (struct ath5k_hw *ah, struct net80211_channel *channel, unsigned int mode)
int ath5k_hw_rfgain_init (struct ath5k_hw *ah, unsigned int freq)
enum ath5k_rfgain ath5k_hw_gainf_calibrate (struct ath5k_hw *ah)
int ath5k_hw_rfgain_opt_init (struct ath5k_hw *ah)
int ath5k_channel_ok (struct ath5k_hw *ah, u16 freq, unsigned int flags)
int ath5k_hw_channel (struct ath5k_hw *ah, struct net80211_channel *channel)
int ath5k_hw_phy_calibrate (struct ath5k_hw *ah, struct net80211_channel *channel)
int ath5k_hw_noise_floor_calibration (struct ath5k_hw *ah, short freq)
 ath5k_hw_noise_floor_calibration - perform PHY noise floor calibration
u16 ath5k_hw_radio_revision (struct ath5k_hw *ah, unsigned int chan)
void ath5k_hw_set_def_antenna (struct ath5k_hw *ah, unsigned int ant)
unsigned int ath5k_hw_get_def_antenna (struct ath5k_hw *ah)
int ath5k_hw_phy_disable (struct ath5k_hw *ah)
int ath5k_hw_txpower (struct ath5k_hw *ah, struct net80211_channel *channel, u8 ee_mode, u8 txpower)
int ath5k_hw_set_txpower_limit (struct ath5k_hw *ah, u8 ee_mode, u8 txpower)
static unsigned int ath5k_hw_htoclock (unsigned int usec, int turbo)
static unsigned int ath5k_hw_clocktoh (unsigned int clock, int turbo)
static u32 ath5k_hw_reg_read (struct ath5k_hw *ah, u16 reg)
static void ath5k_hw_reg_write (struct ath5k_hw *ah, u32 val, u16 reg)
static u32 ath5k_hw_bitswap (u32 val, unsigned int bits)

Macro Definition Documentation

◆ ERRFILE

#define ERRFILE   ERRFILE_ath5k

Definition at line 37 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5210

#define PCI_DEVICE_ID_ATHEROS_AR5210   0x0007 /* AR5210 */

Definition at line 46 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5311

#define PCI_DEVICE_ID_ATHEROS_AR5311   0x0011 /* AR5311 */

Definition at line 47 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5211

#define PCI_DEVICE_ID_ATHEROS_AR5211   0x0012 /* AR5211 */

Definition at line 48 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5212

#define PCI_DEVICE_ID_ATHEROS_AR5212   0x0013 /* AR5212 */

Definition at line 49 of file ath5k.h.

◆ PCI_DEVICE_ID_3COM_3CRDAG675

#define PCI_DEVICE_ID_3COM_3CRDAG675   0x0013 /* 3CRDAG675 (Atheros AR5212) */

Definition at line 50 of file ath5k.h.

◆ PCI_DEVICE_ID_3COM_2_3CRPAG175

#define PCI_DEVICE_ID_3COM_2_3CRPAG175   0x0013 /* 3CRPAG175 (Atheros AR5212) */

Definition at line 51 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5210_AP

#define PCI_DEVICE_ID_ATHEROS_AR5210_AP   0x0207 /* AR5210 (Early) */

Definition at line 52 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5212_IBM

#define PCI_DEVICE_ID_ATHEROS_AR5212_IBM   0x1014 /* AR5212 (IBM MiniPCI) */

Definition at line 53 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5210_DEFAULT

#define PCI_DEVICE_ID_ATHEROS_AR5210_DEFAULT   0x1107 /* AR5210 (no eeprom) */

Definition at line 54 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5212_DEFAULT

#define PCI_DEVICE_ID_ATHEROS_AR5212_DEFAULT   0x1113 /* AR5212 (no eeprom) */

Definition at line 55 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5211_DEFAULT

#define PCI_DEVICE_ID_ATHEROS_AR5211_DEFAULT   0x1112 /* AR5211 (no eeprom) */

Definition at line 56 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5212_FPGA

#define PCI_DEVICE_ID_ATHEROS_AR5212_FPGA   0xf013 /* AR5212 (emulation board) */

Definition at line 57 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5211_LEGACY

#define PCI_DEVICE_ID_ATHEROS_AR5211_LEGACY   0xff12 /* AR5211 (emulation board) */

Definition at line 58 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5211_FPGA11B

#define PCI_DEVICE_ID_ATHEROS_AR5211_FPGA11B   0xf11b /* AR5211 (emulation board) */

Definition at line 59 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5312_REV2

#define PCI_DEVICE_ID_ATHEROS_AR5312_REV2   0x0052 /* AR5312 WMAC (AP31) */

Definition at line 60 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5312_REV7

#define PCI_DEVICE_ID_ATHEROS_AR5312_REV7   0x0057 /* AR5312 WMAC (AP30-040) */

Definition at line 61 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5312_REV8

#define PCI_DEVICE_ID_ATHEROS_AR5312_REV8   0x0058 /* AR5312 WMAC (AP43-030) */

Definition at line 62 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5212_0014

#define PCI_DEVICE_ID_ATHEROS_AR5212_0014   0x0014 /* AR5212 compatible */

Definition at line 63 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5212_0015

#define PCI_DEVICE_ID_ATHEROS_AR5212_0015   0x0015 /* AR5212 compatible */

Definition at line 64 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5212_0016

#define PCI_DEVICE_ID_ATHEROS_AR5212_0016   0x0016 /* AR5212 compatible */

Definition at line 65 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5212_0017

#define PCI_DEVICE_ID_ATHEROS_AR5212_0017   0x0017 /* AR5212 compatible */

Definition at line 66 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5212_0018

#define PCI_DEVICE_ID_ATHEROS_AR5212_0018   0x0018 /* AR5212 compatible */

Definition at line 67 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5212_0019

#define PCI_DEVICE_ID_ATHEROS_AR5212_0019   0x0019 /* AR5212 compatible */

Definition at line 68 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR2413

#define PCI_DEVICE_ID_ATHEROS_AR2413   0x001a /* AR2413 (Griffin-lite) */

Definition at line 69 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5413

#define PCI_DEVICE_ID_ATHEROS_AR5413   0x001b /* AR5413 (Eagle) */

Definition at line 70 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5424

#define PCI_DEVICE_ID_ATHEROS_AR5424   0x001c /* AR5424 (Condor PCI-E) */

Definition at line 71 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5416

#define PCI_DEVICE_ID_ATHEROS_AR5416   0x0023 /* AR5416 */

Definition at line 72 of file ath5k.h.

◆ PCI_DEVICE_ID_ATHEROS_AR5418

#define PCI_DEVICE_ID_ATHEROS_AR5418   0x0024 /* AR5418 */

Definition at line 73 of file ath5k.h.

◆ AR5K_REG_SM

#define AR5K_REG_SM ( _val,
_flags )

◆ AR5K_REG_MS

◆ AR5K_REG_WRITE_BITS

#define AR5K_REG_WRITE_BITS ( ah,
_reg,
_flags,
_val )
Value:
ath5k_hw_reg_write(ah, (ath5k_hw_reg_read(ah, _reg) & ~(_flags)) | \
(((_val) << _flags##_S) & (_flags)), _reg)
static u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg)
Definition ath5k.h:1216
static void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg)
Definition ath5k.h:1224
uint8_t ah
Definition registers.h:1

Definition at line 98 of file ath5k.h.

98#define AR5K_REG_WRITE_BITS(ah, _reg, _flags, _val) \
99 ath5k_hw_reg_write(ah, (ath5k_hw_reg_read(ah, _reg) & ~(_flags)) | \
100 (((_val) << _flags##_S) & (_flags)), _reg)

Referenced by ath5k_hw_commit_eeprom_settings(), ath5k_hw_reset(), ath5k_hw_rf511x_calibrate(), ath5k_hw_rfregs_init(), ath5k_hw_set_ack_timeout(), ath5k_hw_set_cts_timeout(), ath5k_hw_tweak_initval_settings(), ath5k_hw_update_tx_triglevel(), and ath5k_hw_write_ofdm_timings().

◆ AR5K_REG_MASKED_BITS

#define AR5K_REG_MASKED_BITS ( ah,
_reg,
_flags,
_mask )
Value:
(_mask)) | (_flags), _reg)

Definition at line 102 of file ath5k.h.

102#define AR5K_REG_MASKED_BITS(ah, _reg, _flags, _mask) \
103 ath5k_hw_reg_write(ah, (ath5k_hw_reg_read(ah, _reg) & \
104 (_mask)) | (_flags), _reg)

◆ AR5K_REG_ENABLE_BITS

#define AR5K_REG_ENABLE_BITS ( ah,
_reg,
_flags )

◆ AR5K_REG_DISABLE_BITS

#define AR5K_REG_DISABLE_BITS ( ah,
_reg,
_flags )
Value:
ath5k_hw_reg_write(ah, ath5k_hw_reg_read(ah, _reg) & ~(_flags), _reg)

Definition at line 109 of file ath5k.h.

109#define AR5K_REG_DISABLE_BITS(ah, _reg, _flags) \
110 ath5k_hw_reg_write(ah, ath5k_hw_reg_read(ah, _reg) & ~(_flags), _reg)

Referenced by ath5k_hw_reset(), ath5k_hw_reset_tx_queue(), ath5k_hw_rf5110_calibrate(), ath5k_hw_set_ack_bitrate_high(), ath5k_hw_set_rx_filter(), ath5k_hw_start_rx_pcu(), ath5k_hw_stop_tx_dma(), and ath5k_hw_tweak_initval_settings().

◆ AR5K_PHY_READ

#define AR5K_PHY_READ ( ah,
_reg )
Value:
ath5k_hw_reg_read(ah, (ah)->ah_phy + ((_reg) << 2))

Definition at line 113 of file ath5k.h.

113#define AR5K_PHY_READ(ah, _reg) \
114 ath5k_hw_reg_read(ah, (ah)->ah_phy + ((_reg) << 2))

◆ AR5K_PHY_WRITE

#define AR5K_PHY_WRITE ( ah,
_reg,
_val )
Value:
ath5k_hw_reg_write(ah, _val, (ah)->ah_phy + ((_reg) << 2))

Definition at line 116 of file ath5k.h.

116#define AR5K_PHY_WRITE(ah, _reg, _val) \
117 ath5k_hw_reg_write(ah, _val, (ah)->ah_phy + ((_reg) << 2))

◆ AR5K_REG_READ_Q

#define AR5K_REG_READ_Q ( ah,
_reg,
_queue )
Value:
(ath5k_hw_reg_read(ah, _reg) & (1 << _queue)) \

Definition at line 120 of file ath5k.h.

120#define AR5K_REG_READ_Q(ah, _reg, _queue) \
121 (ath5k_hw_reg_read(ah, _reg) & (1 << _queue)) \
122

Referenced by ath5k_hw_set_txdp(), and ath5k_hw_start_tx_dma().

◆ AR5K_REG_WRITE_Q

#define AR5K_REG_WRITE_Q ( ah,
_reg,
_queue )
Value:
ath5k_hw_reg_write(ah, (1 << _queue), _reg)

Definition at line 123 of file ath5k.h.

123#define AR5K_REG_WRITE_Q(ah, _reg, _queue) \
124 ath5k_hw_reg_write(ah, (1 << _queue), _reg)

Referenced by ath5k_hw_reset_tx_queue(), ath5k_hw_start_tx_dma(), and ath5k_hw_stop_tx_dma().

◆ AR5K_Q_ENABLE_BITS

#define AR5K_Q_ENABLE_BITS ( _reg,
_queue )
Value:
do { \
_reg |= 1 << _queue; \
} while (0)

Definition at line 126 of file ath5k.h.

126#define AR5K_Q_ENABLE_BITS(_reg, _queue) do { \
127 _reg |= 1 << _queue; \
128} while (0)

Referenced by ath5k_hw_reset_tx_queue(), and ath5k_hw_setup_tx_queue().

◆ AR5K_Q_DISABLE_BITS

#define AR5K_Q_DISABLE_BITS ( _reg,
_queue )
Value:
do { \
_reg &= ~(1 << _queue); \
} while (0)

Definition at line 130 of file ath5k.h.

130#define AR5K_Q_DISABLE_BITS(_reg, _queue) do { \
131 _reg &= ~(1 << _queue); \
132} while (0)

Referenced by ath5k_hw_release_tx_queue().

◆ AR5K_REG_WAIT

#define AR5K_REG_WAIT ( _i)
Value:
do { \
if (_i % 64) \
udelay(1); \
} while (0)

Definition at line 135 of file ath5k.h.

135#define AR5K_REG_WAIT(_i) do { \
136 if (_i % 64) \
137 udelay(1); \
138} while (0)

Referenced by ath5k_hw_ini_mode_registers(), ath5k_hw_ini_registers(), ath5k_hw_rfgain_init(), and ath5k_hw_rfregs_init().

◆ AR5K_INI_RFGAIN_5GHZ

#define AR5K_INI_RFGAIN_5GHZ   0

Definition at line 141 of file ath5k.h.

Referenced by ath5k_hw_reset(), and ath5k_hw_rfgain_init().

◆ AR5K_INI_RFGAIN_2GHZ

#define AR5K_INI_RFGAIN_2GHZ   1

Definition at line 142 of file ath5k.h.

Referenced by ath5k_hw_reset(), and ath5k_hw_rfgain_init().

◆ AR5K_INI_VAL_11A

#define AR5K_INI_VAL_11A   0

Definition at line 145 of file ath5k.h.

◆ AR5K_INI_VAL_11A_TURBO

#define AR5K_INI_VAL_11A_TURBO   1

Definition at line 146 of file ath5k.h.

◆ AR5K_INI_VAL_11B

#define AR5K_INI_VAL_11B   2

Definition at line 147 of file ath5k.h.

◆ AR5K_INI_VAL_11G

#define AR5K_INI_VAL_11G   3

Definition at line 148 of file ath5k.h.

◆ AR5K_INI_VAL_11G_TURBO

#define AR5K_INI_VAL_11G_TURBO   4

Definition at line 149 of file ath5k.h.

◆ AR5K_INI_VAL_XR

#define AR5K_INI_VAL_XR   0

Definition at line 150 of file ath5k.h.

◆ AR5K_INI_VAL_MAX

#define AR5K_INI_VAL_MAX   5

Definition at line 151 of file ath5k.h.

◆ AR5K_LOW_ID

#define AR5K_LOW_ID ( _a)
Value:
( \
(_a)[0] | (_a)[1] << 8 | (_a)[2] << 16 | (_a)[3] << 24 \
)

Definition at line 154 of file ath5k.h.

154#define AR5K_LOW_ID(_a)( \
155(_a)[0] | (_a)[1] << 8 | (_a)[2] << 16 | (_a)[3] << 24 \
156)

Referenced by ath5k_hw_reset(), ath5k_hw_set_associd(), ath5k_hw_set_bssid_mask(), ath5k_hw_set_lladdr(), and ath5k_hw_set_opmode().

◆ AR5K_HIGH_ID

#define AR5K_HIGH_ID ( _a)
Value:
((_a)[4] | (_a)[5] << 8)

Definition at line 158 of file ath5k.h.

Referenced by ath5k_hw_reset(), ath5k_hw_set_associd(), ath5k_hw_set_bssid_mask(), ath5k_hw_set_lladdr(), and ath5k_hw_set_opmode().

◆ IEEE80211_MAX_LEN

#define IEEE80211_MAX_LEN   2352

Definition at line 160 of file ath5k.h.

Referenced by ath5k_rx_start().

◆ AR5K_TUNE_DMA_BEACON_RESP

#define AR5K_TUNE_DMA_BEACON_RESP   2

Definition at line 165 of file ath5k.h.

◆ AR5K_TUNE_SW_BEACON_RESP

#define AR5K_TUNE_SW_BEACON_RESP   10

Definition at line 166 of file ath5k.h.

◆ AR5K_TUNE_ADDITIONAL_SWBA_BACKOFF

#define AR5K_TUNE_ADDITIONAL_SWBA_BACKOFF   0

Definition at line 167 of file ath5k.h.

◆ AR5K_TUNE_RADAR_ALERT

#define AR5K_TUNE_RADAR_ALERT   0

Definition at line 168 of file ath5k.h.

◆ AR5K_TUNE_MIN_TX_FIFO_THRES

#define AR5K_TUNE_MIN_TX_FIFO_THRES   1

Definition at line 169 of file ath5k.h.

Referenced by ath5k_hw_update_tx_triglevel().

◆ AR5K_TUNE_MAX_TX_FIFO_THRES

#define AR5K_TUNE_MAX_TX_FIFO_THRES   ((IEEE80211_MAX_LEN / 64) + 1)

Definition at line 170 of file ath5k.h.

Referenced by ath5k_hw_update_tx_triglevel().

◆ AR5K_TUNE_REGISTER_TIMEOUT

#define AR5K_TUNE_REGISTER_TIMEOUT   20000

Definition at line 171 of file ath5k.h.

Referenced by ath5k_hw_eeprom_read().

◆ AR5K_TUNE_RSSI_THRES

#define AR5K_TUNE_RSSI_THRES   129

Definition at line 174 of file ath5k.h.

Referenced by ath5k_hw_reset().

◆ AR5K_TUNE_BMISS_THRES

#define AR5K_TUNE_BMISS_THRES   7

Definition at line 180 of file ath5k.h.

Referenced by ath5k_hw_reset().

◆ AR5K_TUNE_REGISTER_DWELL_TIME

#define AR5K_TUNE_REGISTER_DWELL_TIME   20000

Definition at line 181 of file ath5k.h.

◆ AR5K_TUNE_BEACON_INTERVAL

#define AR5K_TUNE_BEACON_INTERVAL   100

Definition at line 182 of file ath5k.h.

◆ AR5K_TUNE_AIFS

#define AR5K_TUNE_AIFS   2

Definition at line 183 of file ath5k.h.

Referenced by ath5k_hw_attach(), and ath5k_hw_reset_tx_queue().

◆ AR5K_TUNE_AIFS_11B

#define AR5K_TUNE_AIFS_11B   2

Definition at line 184 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TUNE_AIFS_XR

#define AR5K_TUNE_AIFS_XR   0

Definition at line 185 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TUNE_CWMIN

#define AR5K_TUNE_CWMIN   15

Definition at line 186 of file ath5k.h.

Referenced by ath5k_hw_attach(), and ath5k_hw_reset_tx_queue().

◆ AR5K_TUNE_CWMIN_11B

#define AR5K_TUNE_CWMIN_11B   31

Definition at line 187 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TUNE_CWMIN_XR

#define AR5K_TUNE_CWMIN_XR   3

Definition at line 188 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TUNE_CWMAX

#define AR5K_TUNE_CWMAX   1023

Definition at line 189 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TUNE_CWMAX_11B

#define AR5K_TUNE_CWMAX_11B   1023

Definition at line 190 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TUNE_CWMAX_XR

#define AR5K_TUNE_CWMAX_XR   7

Definition at line 191 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TUNE_NOISE_FLOOR

#define AR5K_TUNE_NOISE_FLOOR   -72

Definition at line 192 of file ath5k.h.

Referenced by ath5k_hw_noise_floor_calibration().

◆ AR5K_TUNE_MAX_TXPOWER

#define AR5K_TUNE_MAX_TXPOWER   63

◆ AR5K_TUNE_DEFAULT_TXPOWER

#define AR5K_TUNE_DEFAULT_TXPOWER   25

Definition at line 194 of file ath5k.h.

Referenced by ath5k_hw_reset(), and ath5k_hw_txpower().

◆ AR5K_TUNE_TPC_TXPOWER

#define AR5K_TUNE_TPC_TXPOWER   0

Definition at line 195 of file ath5k.h.

Referenced by ath5k_hw_txpower().

◆ AR5K_TUNE_ANT_DIVERSITY

#define AR5K_TUNE_ANT_DIVERSITY   1

Definition at line 196 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_TUNE_HWTXTRIES

#define AR5K_TUNE_HWTXTRIES   4

Definition at line 197 of file ath5k.h.

Referenced by ath5k_hw_setup_4word_tx_desc().

◆ AR5K_INIT_CARR_SENSE_EN

#define AR5K_INIT_CARR_SENSE_EN   1

Definition at line 199 of file ath5k.h.

◆ AR5K_INIT_CFG

#define AR5K_INIT_CFG
Value:
( \
)
#define AR5K_CFG_SWTD
Definition reg.h:73
#define AR5K_CFG_SWRD
Definition reg.h:75

Definition at line 203 of file ath5k.h.

203#define AR5K_INIT_CFG ( \
204 AR5K_CFG_SWTD | AR5K_CFG_SWRD \
205)

Referenced by ath5k_hw_nic_reset().

◆ AR5K_INIT_CYCRSSI_THR1

#define AR5K_INIT_CYCRSSI_THR1   2

Definition at line 211 of file ath5k.h.

Referenced by ath5k_hw_commit_eeprom_settings().

◆ AR5K_INIT_TX_LATENCY

#define AR5K_INIT_TX_LATENCY   502

Definition at line 212 of file ath5k.h.

◆ AR5K_INIT_USEC

#define AR5K_INIT_USEC   39

Definition at line 213 of file ath5k.h.

◆ AR5K_INIT_USEC_TURBO

#define AR5K_INIT_USEC_TURBO   79

Definition at line 214 of file ath5k.h.

◆ AR5K_INIT_USEC_32

#define AR5K_INIT_USEC_32   31

Definition at line 215 of file ath5k.h.

◆ AR5K_INIT_SLOT_TIME

#define AR5K_INIT_SLOT_TIME   396

Definition at line 216 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_SLOT_TIME_TURBO

#define AR5K_INIT_SLOT_TIME_TURBO   480

Definition at line 217 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_ACK_CTS_TIMEOUT

#define AR5K_INIT_ACK_CTS_TIMEOUT   1024

Definition at line 218 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_ACK_CTS_TIMEOUT_TURBO

#define AR5K_INIT_ACK_CTS_TIMEOUT_TURBO   0x08000800

Definition at line 219 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_PROG_IFS

#define AR5K_INIT_PROG_IFS   920

Definition at line 220 of file ath5k.h.

◆ AR5K_INIT_PROG_IFS_TURBO

#define AR5K_INIT_PROG_IFS_TURBO   960

Definition at line 221 of file ath5k.h.

◆ AR5K_INIT_EIFS

#define AR5K_INIT_EIFS   3440

Definition at line 222 of file ath5k.h.

◆ AR5K_INIT_EIFS_TURBO

#define AR5K_INIT_EIFS_TURBO   6880

Definition at line 223 of file ath5k.h.

◆ AR5K_INIT_SIFS

#define AR5K_INIT_SIFS   560

Definition at line 224 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_SIFS_TURBO

#define AR5K_INIT_SIFS_TURBO   480

Definition at line 225 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_SH_RETRY

#define AR5K_INIT_SH_RETRY   10

Definition at line 226 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_LG_RETRY

#define AR5K_INIT_LG_RETRY   AR5K_INIT_SH_RETRY

Definition at line 227 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_SSH_RETRY

#define AR5K_INIT_SSH_RETRY   32

Definition at line 228 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_SLG_RETRY

#define AR5K_INIT_SLG_RETRY   AR5K_INIT_SSH_RETRY

Definition at line 229 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_TX_RETRY

#define AR5K_INIT_TX_RETRY   10

Definition at line 230 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_INIT_TRANSMIT_LATENCY

#define AR5K_INIT_TRANSMIT_LATENCY
Value:
( \
)
#define AR5K_INIT_USEC
Definition ath5k.h:213
#define AR5K_INIT_TX_LATENCY
Definition ath5k.h:212
#define AR5K_INIT_USEC_32
Definition ath5k.h:215

Definition at line 232 of file ath5k.h.

232#define AR5K_INIT_TRANSMIT_LATENCY ( \
233 (AR5K_INIT_TX_LATENCY << 14) | (AR5K_INIT_USEC_32 << 7) | \
234 (AR5K_INIT_USEC) \
235)

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_TRANSMIT_LATENCY_TURBO

#define AR5K_INIT_TRANSMIT_LATENCY_TURBO
Value:
( \
)
#define AR5K_INIT_USEC_TURBO
Definition ath5k.h:214

Definition at line 236 of file ath5k.h.

236#define AR5K_INIT_TRANSMIT_LATENCY_TURBO ( \
237 (AR5K_INIT_TX_LATENCY << 14) | (AR5K_INIT_USEC_32 << 7) | \
238 (AR5K_INIT_USEC_TURBO) \
239)

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_PROTO_TIME_CNTRL

#define AR5K_INIT_PROTO_TIME_CNTRL
Value:
( \
)
#define AR5K_INIT_EIFS
Definition ath5k.h:222
#define AR5K_INIT_PROG_IFS
Definition ath5k.h:220
#define AR5K_INIT_CARR_SENSE_EN
Definition ath5k.h:199

Definition at line 240 of file ath5k.h.

240#define AR5K_INIT_PROTO_TIME_CNTRL ( \
241 (AR5K_INIT_CARR_SENSE_EN << 26) | (AR5K_INIT_EIFS << 12) | \
242 (AR5K_INIT_PROG_IFS) \
243)

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_INIT_PROTO_TIME_CNTRL_TURBO

#define AR5K_INIT_PROTO_TIME_CNTRL_TURBO
Value:
( \
)
#define AR5K_INIT_PROG_IFS_TURBO
Definition ath5k.h:221
#define AR5K_INIT_EIFS_TURBO
Definition ath5k.h:223

Definition at line 244 of file ath5k.h.

244#define AR5K_INIT_PROTO_TIME_CNTRL_TURBO ( \
245 (AR5K_INIT_CARR_SENSE_EN << 26) | (AR5K_INIT_EIFS_TURBO << 12) | \
246 (AR5K_INIT_PROG_IFS_TURBO) \
247)

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TXQ_USEDEFAULT

#define AR5K_TXQ_USEDEFAULT   ((u32) -1)

Definition at line 250 of file ath5k.h.

Referenced by ath5k_txq_setup().

◆ AR5K_SREV_UNKNOWN

#define AR5K_SREV_UNKNOWN   0xffff

Definition at line 288 of file ath5k.h.

◆ AR5K_SREV_AR5210

#define AR5K_SREV_AR5210   0x00 /* Crete */

Definition at line 290 of file ath5k.h.

◆ AR5K_SREV_AR5311

#define AR5K_SREV_AR5311   0x10 /* Maui 1 */

Definition at line 291 of file ath5k.h.

◆ AR5K_SREV_AR5311A

#define AR5K_SREV_AR5311A   0x20 /* Maui 2 */

Definition at line 292 of file ath5k.h.

◆ AR5K_SREV_AR5311B

#define AR5K_SREV_AR5311B   0x30 /* Spirit */

Definition at line 293 of file ath5k.h.

◆ AR5K_SREV_AR5211

#define AR5K_SREV_AR5211   0x40 /* Oahu */

◆ AR5K_SREV_AR5212

#define AR5K_SREV_AR5212   0x50 /* Venice */

Definition at line 295 of file ath5k.h.

◆ AR5K_SREV_AR5213

#define AR5K_SREV_AR5213   0x55 /* ??? */

Definition at line 296 of file ath5k.h.

◆ AR5K_SREV_AR5213A

#define AR5K_SREV_AR5213A   0x59 /* Hainan */

Definition at line 297 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_AR2413

#define AR5K_SREV_AR2413   0x78 /* Griffin lite */

Definition at line 298 of file ath5k.h.

Referenced by ath5k_hw_reset().

◆ AR5K_SREV_AR2414

#define AR5K_SREV_AR2414   0x70 /* Griffin */

Definition at line 299 of file ath5k.h.

Referenced by ath5k_hw_attach(), and ath5k_hw_stop_tx_dma().

◆ AR5K_SREV_AR5424

#define AR5K_SREV_AR5424   0x90 /* Condor */

Definition at line 300 of file ath5k.h.

Referenced by ath5k_hw_rfregs_init().

◆ AR5K_SREV_AR5413

#define AR5K_SREV_AR5413   0xa4 /* Eagle lite */

Definition at line 301 of file ath5k.h.

Referenced by ath5k_hw_rfregs_init().

◆ AR5K_SREV_AR5414

#define AR5K_SREV_AR5414   0xa0 /* Eagle */

Definition at line 302 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_AR2415

#define AR5K_SREV_AR2415   0xb0 /* Talon */

Definition at line 303 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_AR5416

#define AR5K_SREV_AR5416   0xc0 /* PCI-E */

Definition at line 304 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_AR5418

#define AR5K_SREV_AR5418   0xca /* PCI-E */

Definition at line 305 of file ath5k.h.

◆ AR5K_SREV_AR2425

#define AR5K_SREV_AR2425   0xe0 /* Swan */

Definition at line 306 of file ath5k.h.

Referenced by ath5k_eeprom_init_header(), ath5k_eeprom_is_hb63(), and ath5k_hw_attach().

◆ AR5K_SREV_AR2417

#define AR5K_SREV_AR2417   0xf0 /* Nala */

◆ AR5K_SREV_RAD_5110

#define AR5K_SREV_RAD_5110   0x00

Definition at line 309 of file ath5k.h.

◆ AR5K_SREV_RAD_5111

#define AR5K_SREV_RAD_5111   0x10

Definition at line 310 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_RAD_5111A

#define AR5K_SREV_RAD_5111A   0x15

Definition at line 311 of file ath5k.h.

◆ AR5K_SREV_RAD_2111

#define AR5K_SREV_RAD_2111   0x20

Definition at line 312 of file ath5k.h.

◆ AR5K_SREV_RAD_5112

#define AR5K_SREV_RAD_5112   0x30

Definition at line 313 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_RAD_5112A

#define AR5K_SREV_RAD_5112A   0x35

◆ AR5K_SREV_RAD_5112B

#define AR5K_SREV_RAD_5112B   0x36

Definition at line 315 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_RAD_2112

#define AR5K_SREV_RAD_2112   0x40

Definition at line 316 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_RAD_2112A

#define AR5K_SREV_RAD_2112A   0x45

Definition at line 317 of file ath5k.h.

◆ AR5K_SREV_RAD_2112B

#define AR5K_SREV_RAD_2112B   0x46

Definition at line 318 of file ath5k.h.

◆ AR5K_SREV_RAD_2413

#define AR5K_SREV_RAD_2413   0x50

Definition at line 319 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_RAD_5413

#define AR5K_SREV_RAD_5413   0x60

Definition at line 320 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_RAD_2316

#define AR5K_SREV_RAD_2316   0x70 /* Cobra SoC */

Definition at line 321 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_RAD_2317

#define AR5K_SREV_RAD_2317   0x80

Definition at line 322 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_RAD_5424

#define AR5K_SREV_RAD_5424   0xa0 /* Mostly same as 5413 */

Definition at line 323 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_RAD_2425

#define AR5K_SREV_RAD_2425   0xa2

Definition at line 324 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_RAD_5133

#define AR5K_SREV_RAD_5133   0xc0

Definition at line 325 of file ath5k.h.

◆ AR5K_SREV_PHY_5211

#define AR5K_SREV_PHY_5211   0x30

Definition at line 327 of file ath5k.h.

◆ AR5K_SREV_PHY_5212

#define AR5K_SREV_PHY_5212   0x41

Definition at line 328 of file ath5k.h.

◆ AR5K_SREV_PHY_5212A

#define AR5K_SREV_PHY_5212A   0x42

◆ AR5K_SREV_PHY_5212B

#define AR5K_SREV_PHY_5212B   0x43

Definition at line 330 of file ath5k.h.

Referenced by ath5k_hw_attach(), and ath5k_hw_tweak_initval_settings().

◆ AR5K_SREV_PHY_2413

#define AR5K_SREV_PHY_2413   0x45

Definition at line 331 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_PHY_5413

#define AR5K_SREV_PHY_5413   0x61

Definition at line 332 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ AR5K_SREV_PHY_2425

#define AR5K_SREV_PHY_2425   0x70

Definition at line 333 of file ath5k.h.

Referenced by ath5k_hw_attach().

◆ MODULATION_XR

#define MODULATION_XR   0x00000200

Definition at line 351 of file ath5k.h.

◆ MODULATION_TURBO

#define MODULATION_TURBO   0x00000080

Definition at line 391 of file ath5k.h.

◆ AR5K_TXSTAT_ALTRATE

#define AR5K_TXSTAT_ALTRATE   0x80

Definition at line 432 of file ath5k.h.

◆ AR5K_TXERR_XRETRY

#define AR5K_TXERR_XRETRY   0x01

Definition at line 433 of file ath5k.h.

Referenced by ath5k_hw_proc_2word_tx_status(), and ath5k_hw_proc_4word_tx_status().

◆ AR5K_TXERR_FILT

#define AR5K_TXERR_FILT   0x02

Definition at line 434 of file ath5k.h.

Referenced by ath5k_hw_proc_2word_tx_status(), and ath5k_hw_proc_4word_tx_status().

◆ AR5K_TXERR_FIFO

#define AR5K_TXERR_FIFO   0x04

Definition at line 435 of file ath5k.h.

Referenced by ath5k_hw_proc_2word_tx_status(), and ath5k_hw_proc_4word_tx_status().

◆ AR5K_TXQ_FLAG_TXOKINT_ENABLE

#define AR5K_TXQ_FLAG_TXOKINT_ENABLE   0x0001 /* Enable TXOK interrupt */

Definition at line 490 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TXQ_FLAG_TXERRINT_ENABLE

#define AR5K_TXQ_FLAG_TXERRINT_ENABLE   0x0002 /* Enable TXERR interrupt */

Definition at line 491 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TXQ_FLAG_TXEOLINT_ENABLE

#define AR5K_TXQ_FLAG_TXEOLINT_ENABLE   0x0004 /* Enable TXEOL interrupt -not used- */

Definition at line 492 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue(), and ath5k_txq_setup().

◆ AR5K_TXQ_FLAG_TXDESCINT_ENABLE

#define AR5K_TXQ_FLAG_TXDESCINT_ENABLE   0x0008 /* Enable TXDESC interrupt -not used- */

Definition at line 493 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue(), and ath5k_txq_setup().

◆ AR5K_TXQ_FLAG_TXURNINT_ENABLE

#define AR5K_TXQ_FLAG_TXURNINT_ENABLE   0x0010 /* Enable TXURN interrupt */

Definition at line 494 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TXQ_FLAG_CBRORNINT_ENABLE

#define AR5K_TXQ_FLAG_CBRORNINT_ENABLE   0x0020 /* Enable CBRORN interrupt */

Definition at line 495 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TXQ_FLAG_CBRURNINT_ENABLE

#define AR5K_TXQ_FLAG_CBRURNINT_ENABLE   0x0040 /* Enable CBRURN interrupt */

Definition at line 496 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TXQ_FLAG_QTRIGINT_ENABLE

#define AR5K_TXQ_FLAG_QTRIGINT_ENABLE   0x0080 /* Enable QTRIG interrupt */

Definition at line 497 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TXQ_FLAG_TXNOFRMINT_ENABLE

#define AR5K_TXQ_FLAG_TXNOFRMINT_ENABLE   0x0100 /* Enable TXNOFRM interrupt */

Definition at line 498 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TXQ_FLAG_BACKOFF_DISABLE

#define AR5K_TXQ_FLAG_BACKOFF_DISABLE   0x0200 /* Disable random post-backoff */

Definition at line 499 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE

#define AR5K_TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE   0x0300 /* Enable ready time expiry policy (?)*/

Definition at line 500 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TXQ_FLAG_FRAG_BURST_BACKOFF_ENABLE

#define AR5K_TXQ_FLAG_FRAG_BURST_BACKOFF_ENABLE   0x0800 /* Enable backoff while bursting */

Definition at line 501 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ AR5K_TXQ_FLAG_POST_FR_BKOFF_DIS

#define AR5K_TXQ_FLAG_POST_FR_BKOFF_DIS   0x1000 /* Disable backoff while bursting */

Definition at line 502 of file ath5k.h.

Referenced by ath5k_hw_set_tx_queueprops().

◆ AR5K_TXQ_FLAG_COMPRESSION_ENABLE

#define AR5K_TXQ_FLAG_COMPRESSION_ENABLE   0x2000 /* Enable hw compression -not implemented-*/

Definition at line 503 of file ath5k.h.

◆ AR5K_TXPOWER_OFDM

#define AR5K_TXPOWER_OFDM ( _r,
_v )
Value:
( \
((0 & 1) << ((_v) + 6)) | \
(((ah->ah_txpower.txp_rates_power_table[(_r)]) & 0x3f) << (_v)) \
)

Definition at line 538 of file ath5k.h.

538#define AR5K_TXPOWER_OFDM(_r, _v) ( \
539 ((0 & 1) << ((_v) + 6)) | \
540 (((ah->ah_txpower.txp_rates_power_table[(_r)]) & 0x3f) << (_v)) \
541)

Referenced by ath5k_hw_txpower().

◆ AR5K_TXPOWER_CCK

#define AR5K_TXPOWER_CCK ( _r,
_v )
Value:
( \
(ah->ah_txpower.txp_rates_power_table[(_r)] & 0x3f) << (_v) \
)

Definition at line 543 of file ath5k.h.

543#define AR5K_TXPOWER_CCK(_r, _v) ( \
544 (ah->ah_txpower.txp_rates_power_table[(_r)] & 0x3f) << (_v) \
545)

Referenced by ath5k_hw_txpower().

◆ AR5K_RXERR_CRC

#define AR5K_RXERR_CRC   0x01

◆ AR5K_RXERR_PHY

#define AR5K_RXERR_PHY   0x02

◆ AR5K_RXERR_FIFO

#define AR5K_RXERR_FIFO   0x04

Definition at line 583 of file ath5k.h.

Referenced by ath5k_hw_proc_5210_rx_status().

◆ AR5K_RXERR_DECRYPT

#define AR5K_RXERR_DECRYPT   0x08

◆ AR5K_RXERR_MIC

#define AR5K_RXERR_MIC   0x10

Definition at line 585 of file ath5k.h.

Referenced by ath5k_hw_proc_5212_rx_status().

◆ AR5K_RXKEYIX_INVALID

#define AR5K_RXKEYIX_INVALID   ((u8) - 1)

◆ AR5K_TXKEYIX_INVALID

#define AR5K_TXKEYIX_INVALID   ((u32) - 1)

Definition at line 587 of file ath5k.h.

Referenced by ath5k_txbuf_setup().

◆ TSF_TO_TU

#define TSF_TO_TU ( _tsf)
Value:
(u32)((_tsf) >> 10)
#define u32
Definition vga.h:21

Definition at line 597 of file ath5k.h.

◆ AR5K_SLOT_TIME_9

#define AR5K_SLOT_TIME_9   396

Definition at line 625 of file ath5k.h.

◆ AR5K_SLOT_TIME_20

#define AR5K_SLOT_TIME_20   880

Definition at line 626 of file ath5k.h.

◆ AR5K_SLOT_TIME_MAX

#define AR5K_SLOT_TIME_MAX   0xffff

Definition at line 627 of file ath5k.h.

Referenced by ath5k_hw_set_slot_time().

◆ CHANNEL_CW_INT

#define CHANNEL_CW_INT   0x0008 /* Contention Window interference detected */

Definition at line 630 of file ath5k.h.

Referenced by ath9k_hw_getnf(), ath9k_hw_reset(), and ath9k_init_nfcal_hist_buffer().

◆ CHANNEL_TURBO

#define CHANNEL_TURBO   0x0010 /* Turbo Channel */

◆ CHANNEL_CCK

#define CHANNEL_CCK   0x0020 /* CCK channel */

◆ CHANNEL_OFDM

◆ CHANNEL_2GHZ

◆ CHANNEL_5GHZ

◆ CHANNEL_PASSIVE

#define CHANNEL_PASSIVE   0x0200 /* Only passive scan allowed */

Definition at line 636 of file ath5k.h.

◆ CHANNEL_DYN

#define CHANNEL_DYN   0x0400 /* Dynamic CCK-OFDM channel (for g operation) */

Definition at line 637 of file ath5k.h.

◆ CHANNEL_XR

#define CHANNEL_XR   0x0800 /* XR channel */

Definition at line 638 of file ath5k.h.

Referenced by ath5k_get_max_ctl_power(), and ath5k_hw_reset().

◆ CHANNEL_A

◆ CHANNEL_B

◆ CHANNEL_G

◆ CHANNEL_T

#define CHANNEL_T   (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_TURBO)

Definition at line 643 of file ath5k.h.

Referenced by ath5k_get_max_ctl_power(), ath5k_hw_channel(), and ath5k_hw_reset().

◆ CHANNEL_TG

#define CHANNEL_TG   (CHANNEL_2GHZ|CHANNEL_OFDM|CHANNEL_TURBO)

Definition at line 644 of file ath5k.h.

Referenced by ath5k_get_max_ctl_power(), and ath5k_hw_reset().

◆ CHANNEL_108A

#define CHANNEL_108A   CHANNEL_T

Definition at line 645 of file ath5k.h.

◆ CHANNEL_108G

#define CHANNEL_108G   CHANNEL_TG

Definition at line 646 of file ath5k.h.

◆ CHANNEL_X

#define CHANNEL_X   (CHANNEL_5GHZ|CHANNEL_OFDM|CHANNEL_XR)

Definition at line 647 of file ath5k.h.

◆ CHANNEL_ALL

#define CHANNEL_ALL
Value:
#define CHANNEL_CCK
Definition ath5k.h:632
#define CHANNEL_5GHZ
Definition ath5k.h:635
#define CHANNEL_OFDM
Definition ath5k.h:633
#define CHANNEL_TURBO
Definition ath5k.h:631
#define CHANNEL_2GHZ
Definition ath5k.h:634

Definition at line 649 of file ath5k.h.

649#define CHANNEL_ALL (CHANNEL_OFDM|CHANNEL_CCK|CHANNEL_2GHZ|CHANNEL_5GHZ| \
650 CHANNEL_TURBO)

Referenced by ath9k_hw_reset().

◆ CHANNEL_ALL_NOTURBO

#define CHANNEL_ALL_NOTURBO   (CHANNEL_ALL & ~CHANNEL_TURBO)

Definition at line 652 of file ath5k.h.

◆ CHANNEL_MODES

#define CHANNEL_MODES   CHANNEL_ALL

Definition at line 653 of file ath5k.h.

Referenced by ath5k_get_max_ctl_power(), and ath5k_hw_reset().

◆ IS_CHAN_XR

#define IS_CHAN_XR ( _c)
Value:
((_c->hw_value & CHANNEL_XR) != 0)
#define CHANNEL_XR
Definition ath5k.h:638

Definition at line 659 of file ath5k.h.

Referenced by ath5k_hw_reset_tx_queue().

◆ IS_CHAN_B

◆ AR5K_MAX_RATES

#define AR5K_MAX_RATES   32

Seems the ar5xxx harware supports up to 32 rates, indexed by 1-32.

The rate code is used to get the RX rate or set the TX rate on the hardware descriptors. It is also used for internal modulation control and settings.

This is the hardware rate map we are aware of:

rate_code 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 rate_kbps 3000 1000 ? ? ? 2000 500 48000

rate_code 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F 0x10 rate_kbps 24000 12000 6000 54000 36000 18000 9000 ?

rate_code 17 18 19 20 21 22 23 24 rate_kbps ? ? ? ? ? ? ? 11000

rate_code 25 26 27 28 29 30 31 32 rate_kbps 5500 2000 1000 11000S 5500S 2000S ? ?

"S" indicates CCK rates with short preamble.

AR5211 has different rate codes for CCK (802.11B) rates. It only uses the lowest 4 bits, so they are the same as below with a 0xF mask. (0xB, 0xA, 0x9 and 0x8 for 1M, 2M, 5.5M and 11M). We handle this in ath5k_setup_bands().

Definition at line 705 of file ath5k.h.

◆ ATH5K_RATE_CODE_1M

#define ATH5K_RATE_CODE_1M   0x1B

Definition at line 708 of file ath5k.h.

Referenced by ath5k_bitrate_to_hw_rix().

◆ ATH5K_RATE_CODE_2M

#define ATH5K_RATE_CODE_2M   0x1A

Definition at line 709 of file ath5k.h.

◆ ATH5K_RATE_CODE_5_5M

#define ATH5K_RATE_CODE_5_5M   0x19

Definition at line 710 of file ath5k.h.

◆ ATH5K_RATE_CODE_11M

#define ATH5K_RATE_CODE_11M   0x18

Definition at line 711 of file ath5k.h.

◆ ATH5K_RATE_CODE_6M

#define ATH5K_RATE_CODE_6M   0x0B

Definition at line 713 of file ath5k.h.

◆ ATH5K_RATE_CODE_9M

#define ATH5K_RATE_CODE_9M   0x0F

Definition at line 714 of file ath5k.h.

◆ ATH5K_RATE_CODE_12M

#define ATH5K_RATE_CODE_12M   0x0A

Definition at line 715 of file ath5k.h.

◆ ATH5K_RATE_CODE_18M

#define ATH5K_RATE_CODE_18M   0x0E

Definition at line 716 of file ath5k.h.

◆ ATH5K_RATE_CODE_24M

#define ATH5K_RATE_CODE_24M   0x09

Definition at line 717 of file ath5k.h.

◆ ATH5K_RATE_CODE_36M

#define ATH5K_RATE_CODE_36M   0x0D

Definition at line 718 of file ath5k.h.

◆ ATH5K_RATE_CODE_48M

#define ATH5K_RATE_CODE_48M   0x08

Definition at line 719 of file ath5k.h.

◆ ATH5K_RATE_CODE_54M

#define ATH5K_RATE_CODE_54M   0x0C

Definition at line 720 of file ath5k.h.

◆ ATH5K_RATE_CODE_XR_500K

#define ATH5K_RATE_CODE_XR_500K   0x07

Definition at line 722 of file ath5k.h.

◆ ATH5K_RATE_CODE_XR_1M

#define ATH5K_RATE_CODE_XR_1M   0x02

Definition at line 723 of file ath5k.h.

◆ ATH5K_RATE_CODE_XR_2M

#define ATH5K_RATE_CODE_XR_2M   0x06

Definition at line 724 of file ath5k.h.

◆ ATH5K_RATE_CODE_XR_3M

#define ATH5K_RATE_CODE_XR_3M   0x01

Definition at line 725 of file ath5k.h.

◆ AR5K_SET_SHORT_PREAMBLE

#define AR5K_SET_SHORT_PREAMBLE   0x04

Definition at line 728 of file ath5k.h.

Referenced by ath5k_hw_write_rate_duration().

◆ AR5K_KEYCACHE_SIZE

#define AR5K_KEYCACHE_SIZE   8

Definition at line 734 of file ath5k.h.

Referenced by ath5k_hw_reset_key().

◆ AR5K_RSSI_EP_MULTIPLIER

#define AR5K_RSSI_EP_MULTIPLIER   (1<<7)

Definition at line 743 of file ath5k.h.

◆ AR5K_ASSERT_ENTRY

#define AR5K_ASSERT_ENTRY ( _e,
_s )
Value:
do { \
if (_e >= _s) \
return 0; \
} while (0)

Definition at line 745 of file ath5k.h.

745#define AR5K_ASSERT_ENTRY(_e, _s) do { \
746 if (_e >= _s) \
747 return 0; \
748} while (0)

◆ AR5K_SOFTLED_PIN

#define AR5K_SOFTLED_PIN   0

Definition at line 877 of file ath5k.h.

◆ AR5K_SOFTLED_ON

#define AR5K_SOFTLED_ON   0

Definition at line 878 of file ath5k.h.

◆ AR5K_SOFTLED_OFF

#define AR5K_SOFTLED_OFF   1

Definition at line 879 of file ath5k.h.

◆ AR5K_MAX_GPIO

#define AR5K_MAX_GPIO   10

Definition at line 951 of file ath5k.h.

◆ AR5K_MAX_RF_BANKS

#define AR5K_MAX_RF_BANKS   8

Definition at line 952 of file ath5k.h.

Referenced by ath5k_hw_rfregs_init().

◆ ah_regdomain

#define ah_regdomain   ah_capabilities.cap_regdomain.reg_current

Definition at line 983 of file ath5k.h.

◆ ah_regdomain_hw

#define ah_regdomain_hw   ah_capabilities.cap_regdomain.reg_hw

Definition at line 984 of file ath5k.h.

◆ ah_modes

#define ah_modes   ah_capabilities.cap_mode

Definition at line 985 of file ath5k.h.

◆ ah_ee_version

#define ah_ee_version   ah_capabilities.cap_eeprom.ee_version

Definition at line 986 of file ath5k.h.

Enumeration Type Documentation

◆ ath5k_version

Enumerator
AR5K_AR5210 
AR5K_AR5211 
AR5K_AR5212 

Definition at line 255 of file ath5k.h.

255 {
256 AR5K_AR5210 = 0,
257 AR5K_AR5211 = 1,
258 AR5K_AR5212 = 2,
259};
@ AR5K_AR5210
Definition ath5k.h:256
@ AR5K_AR5212
Definition ath5k.h:258
@ AR5K_AR5211
Definition ath5k.h:257

◆ ath5k_radio

Enumerator
AR5K_RF5110 
AR5K_RF5111 
AR5K_RF5112 
AR5K_RF2413 
AR5K_RF5413 
AR5K_RF2316 
AR5K_RF2317 
AR5K_RF2425 

Definition at line 262 of file ath5k.h.

262 {
263 AR5K_RF5110 = 0,
264 AR5K_RF5111 = 1,
265 AR5K_RF5112 = 2,
266 AR5K_RF2413 = 3,
267 AR5K_RF5413 = 4,
268 AR5K_RF2316 = 5,
269 AR5K_RF2317 = 6,
270 AR5K_RF2425 = 7,
271};
@ AR5K_RF2425
Definition ath5k.h:270
@ AR5K_RF5111
Definition ath5k.h:264
@ AR5K_RF5112
Definition ath5k.h:265
@ AR5K_RF5110
Definition ath5k.h:263
@ AR5K_RF2316
Definition ath5k.h:268
@ AR5K_RF5413
Definition ath5k.h:267
@ AR5K_RF2317
Definition ath5k.h:269
@ AR5K_RF2413
Definition ath5k.h:266

◆ ath5k_srev_type

Enumerator
AR5K_VERSION_MAC 
AR5K_VERSION_RAD 

Definition at line 277 of file ath5k.h.

277 {
280};
@ AR5K_VERSION_MAC
Definition ath5k.h:278
@ AR5K_VERSION_RAD
Definition ath5k.h:279

◆ ath5k_driver_mode

Enumerator
AR5K_MODE_11A 
AR5K_MODE_11A_TURBO 
AR5K_MODE_11B 
AR5K_MODE_11G 
AR5K_MODE_11G_TURBO 
AR5K_MODE_XR 

Definition at line 393 of file ath5k.h.

393 {
394 AR5K_MODE_11A = 0,
396 AR5K_MODE_11B = 2,
397 AR5K_MODE_11G = 3,
399 AR5K_MODE_XR = 5,
400};
@ AR5K_MODE_11G_TURBO
Definition ath5k.h:398
@ AR5K_MODE_11A_TURBO
Definition ath5k.h:395
@ AR5K_MODE_XR
Definition ath5k.h:399
@ AR5K_MODE_11B
Definition ath5k.h:396
@ AR5K_MODE_11A
Definition ath5k.h:394
@ AR5K_MODE_11G
Definition ath5k.h:397

◆ anonymous enum

anonymous enum
Enumerator
AR5K_MODE_BIT_11A 
AR5K_MODE_BIT_11A_TURBO 
AR5K_MODE_BIT_11B 
AR5K_MODE_BIT_11G 
AR5K_MODE_BIT_11G_TURBO 
AR5K_MODE_BIT_XR 

Definition at line 402 of file ath5k.h.

402 {
409};
@ AR5K_MODE_BIT_XR
Definition ath5k.h:408
@ AR5K_MODE_BIT_11A_TURBO
Definition ath5k.h:404
@ AR5K_MODE_BIT_11B
Definition ath5k.h:405
@ AR5K_MODE_BIT_11G_TURBO
Definition ath5k.h:407
@ AR5K_MODE_BIT_11G
Definition ath5k.h:406
@ AR5K_MODE_BIT_11A
Definition ath5k.h:403

◆ ath5k_tx_queue

enum ath5k_tx_queue - Queue types used to classify tx queues.

@AR5K_TX_QUEUE_INACTIVE: q is unused – see ath5k_hw_release_tx_queue @AR5K_TX_QUEUE_DATA: A normal data queue @AR5K_TX_QUEUE_XR_DATA: An XR-data queue @AR5K_TX_QUEUE_BEACON: The beacon queue @AR5K_TX_QUEUE_CAB: The after-beacon queue @AR5K_TX_QUEUE_UAPSD: Unscheduled Automatic Power Save Delivery queue

Enumerator
AR5K_TX_QUEUE_INACTIVE 
AR5K_TX_QUEUE_DATA 
AR5K_TX_QUEUE_XR_DATA 
AR5K_TX_QUEUE_BEACON 
AR5K_TX_QUEUE_CAB 
AR5K_TX_QUEUE_UAPSD 

Definition at line 446 of file ath5k.h.

446 {
453};
@ AR5K_TX_QUEUE_CAB
Definition ath5k.h:451
@ AR5K_TX_QUEUE_INACTIVE
Definition ath5k.h:447
@ AR5K_TX_QUEUE_XR_DATA
Definition ath5k.h:449
@ AR5K_TX_QUEUE_DATA
Definition ath5k.h:448
@ AR5K_TX_QUEUE_BEACON
Definition ath5k.h:450
@ AR5K_TX_QUEUE_UAPSD
Definition ath5k.h:452

◆ ath5k_tx_queue_subtype

Enumerator
AR5K_WME_AC_BK 
AR5K_WME_AC_BE 
AR5K_WME_AC_VI 
AR5K_WME_AC_VO 

Definition at line 462 of file ath5k.h.

462 {
463 AR5K_WME_AC_BK = 0, /*Background traffic*/
464 AR5K_WME_AC_BE, /*Best-effort (normal) traffic)*/
465 AR5K_WME_AC_VI, /*Video traffic*/
466 AR5K_WME_AC_VO, /*Voice traffic*/
467};
@ AR5K_WME_AC_VO
Definition ath5k.h:466
@ AR5K_WME_AC_BK
Definition ath5k.h:463
@ AR5K_WME_AC_VI
Definition ath5k.h:465
@ AR5K_WME_AC_BE
Definition ath5k.h:464

◆ ath5k_tx_queue_id

Enumerator
AR5K_TX_QUEUE_ID_NOQCU_DATA 
AR5K_TX_QUEUE_ID_NOQCU_BEACON 
AR5K_TX_QUEUE_ID_DATA_MIN 
AR5K_TX_QUEUE_ID_DATA_MAX 
AR5K_TX_QUEUE_ID_DATA_SVP 
AR5K_TX_QUEUE_ID_CAB 
AR5K_TX_QUEUE_ID_BEACON 
AR5K_TX_QUEUE_ID_UAPSD 
AR5K_TX_QUEUE_ID_XR_DATA 

Definition at line 475 of file ath5k.h.

475 {
478 AR5K_TX_QUEUE_ID_DATA_MIN = 0, /*IEEE80211_TX_QUEUE_DATA0*/
479 AR5K_TX_QUEUE_ID_DATA_MAX = 4, /*IEEE80211_TX_QUEUE_DATA4*/
480 AR5K_TX_QUEUE_ID_DATA_SVP = 5, /*IEEE80211_TX_QUEUE_SVP - Spectralink Voice Protocol*/
481 AR5K_TX_QUEUE_ID_CAB = 6, /*IEEE80211_TX_QUEUE_AFTER_BEACON*/
482 AR5K_TX_QUEUE_ID_BEACON = 7, /*IEEE80211_TX_QUEUE_BEACON*/
485};
@ AR5K_TX_QUEUE_ID_DATA_MIN
Definition ath5k.h:478
@ AR5K_TX_QUEUE_ID_XR_DATA
Definition ath5k.h:484
@ AR5K_TX_QUEUE_ID_UAPSD
Definition ath5k.h:483
@ AR5K_TX_QUEUE_ID_NOQCU_DATA
Definition ath5k.h:476
@ AR5K_TX_QUEUE_ID_DATA_MAX
Definition ath5k.h:479
@ AR5K_TX_QUEUE_ID_NOQCU_BEACON
Definition ath5k.h:477
@ AR5K_TX_QUEUE_ID_DATA_SVP
Definition ath5k.h:480
@ AR5K_TX_QUEUE_ID_BEACON
Definition ath5k.h:482
@ AR5K_TX_QUEUE_ID_CAB
Definition ath5k.h:481

◆ ath5k_pkt_type

Enumerator
AR5K_PKT_TYPE_NORMAL 
AR5K_PKT_TYPE_ATIM 
AR5K_PKT_TYPE_PSPOLL 
AR5K_PKT_TYPE_BEACON 
AR5K_PKT_TYPE_PROBE_RESP 
AR5K_PKT_TYPE_PIFS 

Definition at line 526 of file ath5k.h.

526 {
533};
@ AR5K_PKT_TYPE_PSPOLL
Definition ath5k.h:529
@ AR5K_PKT_TYPE_NORMAL
Definition ath5k.h:527
@ AR5K_PKT_TYPE_BEACON
Definition ath5k.h:530
@ AR5K_PKT_TYPE_PROBE_RESP
Definition ath5k.h:531
@ AR5K_PKT_TYPE_PIFS
Definition ath5k.h:532
@ AR5K_PKT_TYPE_ATIM
Definition ath5k.h:528

◆ ath5k_dmasize

Enumerator
AR5K_DMASIZE_4B 
AR5K_DMASIZE_8B 
AR5K_DMASIZE_16B 
AR5K_DMASIZE_32B 
AR5K_DMASIZE_64B 
AR5K_DMASIZE_128B 
AR5K_DMASIZE_256B 
AR5K_DMASIZE_512B 

Definition at line 550 of file ath5k.h.

550 {
551 AR5K_DMASIZE_4B = 0,
559};
@ AR5K_DMASIZE_8B
Definition ath5k.h:552
@ AR5K_DMASIZE_64B
Definition ath5k.h:555
@ AR5K_DMASIZE_32B
Definition ath5k.h:554
@ AR5K_DMASIZE_128B
Definition ath5k.h:556
@ AR5K_DMASIZE_16B
Definition ath5k.h:553
@ AR5K_DMASIZE_4B
Definition ath5k.h:551
@ AR5K_DMASIZE_256B
Definition ath5k.h:557
@ AR5K_DMASIZE_512B
Definition ath5k.h:558

◆ ath5k_rfgain

Enumerator
AR5K_RFGAIN_INACTIVE 
AR5K_RFGAIN_ACTIVE 
AR5K_RFGAIN_READ_REQUESTED 
AR5K_RFGAIN_NEED_CHANGE 

Definition at line 604 of file ath5k.h.

604 {
609};
@ AR5K_RFGAIN_ACTIVE
Definition ath5k.h:606
@ AR5K_RFGAIN_INACTIVE
Definition ath5k.h:605
@ AR5K_RFGAIN_NEED_CHANGE
Definition ath5k.h:608
@ AR5K_RFGAIN_READ_REQUESTED
Definition ath5k.h:607

◆ ath5k_int

enum ath5k_int

enum ath5k_int - Hardware interrupt masks helpers

@AR5K_INT_RX: mask to identify received frame interrupts, of type AR5K_ISR_RXOK or AR5K_ISR_RXERR @AR5K_INT_RXDESC: Request RX descriptor/Read RX descriptor (?) @AR5K_INT_RXNOFRM: No frame received (?) @AR5K_INT_RXEOL: received End Of List for VEOL (Virtual End Of List). The Queue Control Unit (QCU) signals an EOL interrupt only if a descriptor's LinkPtr is NULL. For more details, refer to: http://www.freepatentsonline.com/20030225739.html @AR5K_INT_RXORN: Indicates we got RX overrun (eg. no more descriptors). Note that Rx overrun is not always fatal, on some chips we can continue operation without reseting the card, that's why int_fatal is not common for all chips. @AR5K_INT_TX: mask to identify received frame interrupts, of type AR5K_ISR_TXOK or AR5K_ISR_TXERR @AR5K_INT_TXDESC: Request TX descriptor/Read TX status descriptor (?) @AR5K_INT_TXURN: received when we should increase the TX trigger threshold We currently do increments on interrupt by (AR5K_TUNE_MAX_TX_FIFO_THRES - current_trigger_level) / 2 @AR5K_INT_MIB: Indicates the Management Information Base counters should be checked. We should do this with ath5k_hw_update_mib_counters() but it seems we should also then do some noise immunity work. @AR5K_INT_RXPHY: RX PHY Error @AR5K_INT_RXKCM: RX Key cache miss @AR5K_INT_SWBA: SoftWare Beacon Alert - indicates its time to send a beacon that must be handled in software. The alternative is if you have VEOL support, in that case you let the hardware deal with things. @AR5K_INT_BMISS: If in STA mode this indicates we have stopped seeing beacons from the AP have associated with, we should probably try to reassociate. When in IBSS mode this might mean we have not received any beacons from any local stations. Note that every station in an IBSS schedules to send beacons at the Target Beacon Transmission Time (TBTT) with a random backoff. @AR5K_INT_BNR: Beacon Not Ready interrupt - ?? @AR5K_INT_GPIO: GPIO interrupt is used for RF Kill, disabled for now until properly handled @AR5K_INT_FATAL: Fatal errors were encountered, typically caused by DMA errors. These types of errors we can enable seem to be of type AR5K_SIMR2_MCABT, AR5K_SIMR2_SSERR and AR5K_SIMR2_DPERR. @AR5K_INT_GLOBAL: Used to clear and set the IER @AR5K_INT_NOCARD: signals the card has been removed @AR5K_INT_COMMON: common interrupts shared amogst MACs with the same bit value

These are mapped to take advantage of some common bits between the MACs, to be able to set intr properties easier. Some of them are not used yet inside hw.c. Most map to the respective hw interrupt value as they are common amogst different MACs.

Enumerator
AR5K_INT_RXOK 
AR5K_INT_RXDESC 
AR5K_INT_RXERR 
AR5K_INT_RXNOFRM 
AR5K_INT_RXEOL 
AR5K_INT_RXORN 
AR5K_INT_TXOK 
AR5K_INT_TXDESC 
AR5K_INT_TXERR 
AR5K_INT_TXNOFRM 
AR5K_INT_TXEOL 
AR5K_INT_TXURN 
AR5K_INT_MIB 
AR5K_INT_SWI 
AR5K_INT_RXPHY 
AR5K_INT_RXKCM 
AR5K_INT_SWBA 
AR5K_INT_BRSSI 
AR5K_INT_BMISS 
AR5K_INT_FATAL 
AR5K_INT_BNR 
AR5K_INT_TIM 
AR5K_INT_DTIM 
AR5K_INT_DTIM_SYNC 
AR5K_INT_GPIO 
AR5K_INT_BCN_TIMEOUT 
AR5K_INT_CAB_TIMEOUT 
AR5K_INT_RX_DOPPLER 
AR5K_INT_QCBRORN 
AR5K_INT_QCBRURN 
AR5K_INT_QTRIG 
AR5K_INT_GLOBAL 
AR5K_INT_COMMON 
AR5K_INT_NOCARD 

Definition at line 806 of file ath5k.h.

806 {
807 AR5K_INT_RXOK = 0x00000001,
808 AR5K_INT_RXDESC = 0x00000002,
809 AR5K_INT_RXERR = 0x00000004,
810 AR5K_INT_RXNOFRM = 0x00000008,
811 AR5K_INT_RXEOL = 0x00000010,
812 AR5K_INT_RXORN = 0x00000020,
813 AR5K_INT_TXOK = 0x00000040,
814 AR5K_INT_TXDESC = 0x00000080,
815 AR5K_INT_TXERR = 0x00000100,
816 AR5K_INT_TXNOFRM = 0x00000200,
817 AR5K_INT_TXEOL = 0x00000400,
818 AR5K_INT_TXURN = 0x00000800,
819 AR5K_INT_MIB = 0x00001000,
820 AR5K_INT_SWI = 0x00002000,
821 AR5K_INT_RXPHY = 0x00004000,
822 AR5K_INT_RXKCM = 0x00008000,
823 AR5K_INT_SWBA = 0x00010000,
824 AR5K_INT_BRSSI = 0x00020000,
825 AR5K_INT_BMISS = 0x00040000,
826 AR5K_INT_FATAL = 0x00080000, /* Non common */
827 AR5K_INT_BNR = 0x00100000, /* Non common */
828 AR5K_INT_TIM = 0x00200000, /* Non common */
829 AR5K_INT_DTIM = 0x00400000, /* Non common */
830 AR5K_INT_DTIM_SYNC = 0x00800000, /* Non common */
831 AR5K_INT_GPIO = 0x01000000,
832 AR5K_INT_BCN_TIMEOUT = 0x02000000, /* Non common */
833 AR5K_INT_CAB_TIMEOUT = 0x04000000, /* Non common */
834 AR5K_INT_RX_DOPPLER = 0x08000000, /* Non common */
835 AR5K_INT_QCBRORN = 0x10000000, /* Non common */
836 AR5K_INT_QCBRURN = 0x20000000, /* Non common */
837 AR5K_INT_QTRIG = 0x40000000, /* Non common */
838 AR5K_INT_GLOBAL = 0x80000000,
839
861
862 AR5K_INT_NOCARD = 0xffffffff
863};
@ AR5K_INT_RXNOFRM
Definition ath5k.h:810
@ AR5K_INT_MIB
Definition ath5k.h:819
@ AR5K_INT_CAB_TIMEOUT
Definition ath5k.h:833
@ AR5K_INT_SWI
Definition ath5k.h:820
@ AR5K_INT_TIM
Definition ath5k.h:828
@ AR5K_INT_BCN_TIMEOUT
Definition ath5k.h:832
@ AR5K_INT_FATAL
Definition ath5k.h:826
@ AR5K_INT_RXDESC
Definition ath5k.h:808
@ AR5K_INT_QCBRORN
Definition ath5k.h:835
@ AR5K_INT_TXDESC
Definition ath5k.h:814
@ AR5K_INT_GLOBAL
Definition ath5k.h:838
@ AR5K_INT_TXERR
Definition ath5k.h:815
@ AR5K_INT_RXORN
Definition ath5k.h:812
@ AR5K_INT_SWBA
Definition ath5k.h:823
@ AR5K_INT_BMISS
Definition ath5k.h:825
@ AR5K_INT_BNR
Definition ath5k.h:827
@ AR5K_INT_RXPHY
Definition ath5k.h:821
@ AR5K_INT_QTRIG
Definition ath5k.h:837
@ AR5K_INT_BRSSI
Definition ath5k.h:824
@ AR5K_INT_TXEOL
Definition ath5k.h:817
@ AR5K_INT_RXOK
Definition ath5k.h:807
@ AR5K_INT_TXOK
Definition ath5k.h:813
@ AR5K_INT_RX_DOPPLER
Definition ath5k.h:834
@ AR5K_INT_DTIM_SYNC
Definition ath5k.h:830
@ AR5K_INT_NOCARD
Definition ath5k.h:862
@ AR5K_INT_RXERR
Definition ath5k.h:809
@ AR5K_INT_GPIO
Definition ath5k.h:831
@ AR5K_INT_TXURN
Definition ath5k.h:818
@ AR5K_INT_TXNOFRM
Definition ath5k.h:816
@ AR5K_INT_RXKCM
Definition ath5k.h:822
@ AR5K_INT_COMMON
Definition ath5k.h:840
@ AR5K_INT_DTIM
Definition ath5k.h:829
@ AR5K_INT_QCBRURN
Definition ath5k.h:836
@ AR5K_INT_RXEOL
Definition ath5k.h:811

◆ ath5k_power_mode

Enumerator
AR5K_PM_UNDEFINED 
AR5K_PM_AUTO 
AR5K_PM_AWAKE 
AR5K_PM_FULL_SLEEP 
AR5K_PM_NETWORK_SLEEP 

Definition at line 868 of file ath5k.h.

868 {
874};
@ AR5K_PM_FULL_SLEEP
Definition ath5k.h:872
@ AR5K_PM_AWAKE
Definition ath5k.h:871
@ AR5K_PM_UNDEFINED
Definition ath5k.h:869
@ AR5K_PM_NETWORK_SLEEP
Definition ath5k.h:873
@ AR5K_PM_AUTO
Definition ath5k.h:870

◆ ath5k_capability_type

Enumerator
AR5K_CAP_REG_DMN 
AR5K_CAP_TKIP_MIC 
AR5K_CAP_TKIP_SPLIT 
AR5K_CAP_PHYCOUNTERS 
AR5K_CAP_DIVERSITY 
AR5K_CAP_NUM_TXQUEUES 
AR5K_CAP_VEOL 
AR5K_CAP_COMPRESSION 
AR5K_CAP_BURST 
AR5K_CAP_FASTFRAME 
AR5K_CAP_TXPOW 
AR5K_CAP_TPC 
AR5K_CAP_BSSIDMASK 
AR5K_CAP_MCAST_KEYSRCH 
AR5K_CAP_TSF_ADJUST 
AR5K_CAP_XR 
AR5K_CAP_WME_TKIPMIC 
AR5K_CAP_CHAN_HALFRATE 
AR5K_CAP_CHAN_QUARTERRATE 
AR5K_CAP_RFSILENT 

Definition at line 887 of file ath5k.h.

887 {
888 AR5K_CAP_REG_DMN = 0, /* Used to get current reg. domain id */
889 AR5K_CAP_TKIP_MIC = 2, /* Can handle TKIP MIC in hardware */
890 AR5K_CAP_TKIP_SPLIT = 3, /* TKIP uses split keys */
891 AR5K_CAP_PHYCOUNTERS = 4, /* PHY error counters */
892 AR5K_CAP_DIVERSITY = 5, /* Supports fast diversity */
893 AR5K_CAP_NUM_TXQUEUES = 6, /* Used to get max number of hw txqueues */
894 AR5K_CAP_VEOL = 7, /* Supports virtual EOL */
895 AR5K_CAP_COMPRESSION = 8, /* Supports compression */
896 AR5K_CAP_BURST = 9, /* Supports packet bursting */
897 AR5K_CAP_FASTFRAME = 10, /* Supports fast frames */
898 AR5K_CAP_TXPOW = 11, /* Used to get global tx power limit */
899 AR5K_CAP_TPC = 12, /* Can do per-packet tx power control (needed for 802.11a) */
900 AR5K_CAP_BSSIDMASK = 13, /* Supports bssid mask */
901 AR5K_CAP_MCAST_KEYSRCH = 14, /* Supports multicast key search */
902 AR5K_CAP_TSF_ADJUST = 15, /* Supports beacon tsf adjust */
903 AR5K_CAP_XR = 16, /* Supports XR mode */
904 AR5K_CAP_WME_TKIPMIC = 17, /* Supports TKIP MIC when using WMM */
905 AR5K_CAP_CHAN_HALFRATE = 18, /* Supports half rate channels */
906 AR5K_CAP_CHAN_QUARTERRATE = 19, /* Supports quarter rate channels */
907 AR5K_CAP_RFSILENT = 20, /* Supports RFsilent */
908};
@ AR5K_CAP_TKIP_MIC
Definition ath5k.h:889
@ AR5K_CAP_RFSILENT
Definition ath5k.h:907
@ AR5K_CAP_TSF_ADJUST
Definition ath5k.h:902
@ AR5K_CAP_XR
Definition ath5k.h:903
@ AR5K_CAP_NUM_TXQUEUES
Definition ath5k.h:893
@ AR5K_CAP_PHYCOUNTERS
Definition ath5k.h:891
@ AR5K_CAP_TKIP_SPLIT
Definition ath5k.h:890
@ AR5K_CAP_CHAN_HALFRATE
Definition ath5k.h:905
@ AR5K_CAP_BURST
Definition ath5k.h:896
@ AR5K_CAP_VEOL
Definition ath5k.h:894
@ AR5K_CAP_WME_TKIPMIC
Definition ath5k.h:904
@ AR5K_CAP_DIVERSITY
Definition ath5k.h:892
@ AR5K_CAP_CHAN_QUARTERRATE
Definition ath5k.h:906
@ AR5K_CAP_BSSIDMASK
Definition ath5k.h:900
@ AR5K_CAP_TXPOW
Definition ath5k.h:898
@ AR5K_CAP_REG_DMN
Definition ath5k.h:888
@ AR5K_CAP_MCAST_KEYSRCH
Definition ath5k.h:901
@ AR5K_CAP_FASTFRAME
Definition ath5k.h:897
@ AR5K_CAP_COMPRESSION
Definition ath5k.h:895
@ AR5K_CAP_TPC
Definition ath5k.h:899

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( MIT )

◆ FILE_SECBOOT()

FILE_SECBOOT ( FORBIDDEN )

◆ ath5k_bitrate_to_hw_rix()

int ath5k_bitrate_to_hw_rix ( int bitrate)
extern

Definition at line 719 of file ath5k.c.

720{
721 int i;
722
723 for (i = 0; i < ATH5K_NR_RATES; i++) {
724 if (ath5k_rates[i].bitrate == bitrate)
725 return ath5k_rates[i].hw_code;
726 }
727
728 DBG("ath5k: invalid bitrate %d\n", bitrate);
729 return ATH5K_RATE_CODE_1M; /* use lowest rate */
730}
#define ATH5K_NR_RATES
Definition ath5k.c:116
static const struct @243101324066276276010153053027305146200053303005 ath5k_rates[]
u16 bitrate
Definition ath5k.c:94
#define ATH5K_RATE_CODE_1M
Definition ath5k.h:708
#define DBG(...)
Print a debugging message.
Definition compiler.h:498

References ATH5K_NR_RATES, ATH5K_RATE_CODE_1M, ath5k_rates, bitrate, and DBG.

Referenced by ath5k_hw_write_rate_duration().

◆ ath5k_hw_attach()

int ath5k_hw_attach ( struct ath5k_softc * sc,
u8 mac_version,
struct ath5k_hw ** hw )
extern

ath5k_hw_attach - Check if hw is supported and init the needed structs

@sc: The &struct ath5k_softc we got from the driver's attach function @mac_version: The mac version id (check out ath5k.h) based on pci id @hw: Returned newly allocated hardware structure, on success

Check if the device is supported, perform a POST and initialize the needed structs. Returns -ENOMEM if we don't have memory for the needed structs, -ENODEV if the device is not supported or prints an error msg if something else went wrong.

Definition at line 113 of file ath5k_attach.c.

115{
116 struct ath5k_hw *ah;
117 struct pci_device *pdev = sc->pdev;
118 int ret;
119 u32 srev;
120
121 ah = zalloc(sizeof(struct ath5k_hw));
122 if (ah == NULL) {
123 ret = -ENOMEM;
124 DBG("ath5k: out of memory\n");
125 goto err;
126 }
127
128 ah->ah_sc = sc;
129 ah->ah_iobase = sc->iobase;
130
131 /*
132 * HW information
133 */
134 ah->ah_turbo = 0;
135 ah->ah_txpower.txp_tpc = 0;
136 ah->ah_imr = 0;
137 ah->ah_atim_window = 0;
138 ah->ah_aifs = AR5K_TUNE_AIFS;
139 ah->ah_cw_min = AR5K_TUNE_CWMIN;
140 ah->ah_limit_tx_retries = AR5K_INIT_TX_RETRY;
141 ah->ah_software_retry = 0;
142 ah->ah_ant_diversity = AR5K_TUNE_ANT_DIVERSITY;
143
144 /*
145 * Set the mac version based on the pci id
146 */
147 ah->ah_version = mac_version;
148
149 /*Fill the ath5k_hw struct with the needed functions*/
151 if (ret)
152 goto err_free;
153
154 /* Bring device out of sleep and reset it's units */
156 if (ret)
157 goto err_free;
158
159 /* Get MAC, PHY and RADIO revisions */
161 ah->ah_mac_srev = srev;
162 ah->ah_mac_version = AR5K_REG_MS(srev, AR5K_SREV_VER);
163 ah->ah_mac_revision = AR5K_REG_MS(srev, AR5K_SREV_REV);
164 ah->ah_phy_revision = ath5k_hw_reg_read(ah, AR5K_PHY_CHIP_ID);
165 ah->ah_radio_5ghz_revision = ath5k_hw_radio_revision(ah, CHANNEL_5GHZ);
166 ah->ah_phy = AR5K_PHY(0);
167
168 /* Try to identify radio chip based on it's srev */
169 switch (ah->ah_radio_5ghz_revision & 0xf0) {
171 ah->ah_radio = AR5K_RF5111;
172 ah->ah_single_chip = 0;
173 ah->ah_radio_2ghz_revision = ath5k_hw_radio_revision(ah,
175 break;
178 ah->ah_radio = AR5K_RF5112;
179 ah->ah_single_chip = 0;
180 ah->ah_radio_2ghz_revision = ath5k_hw_radio_revision(ah,
182 break;
184 ah->ah_radio = AR5K_RF2413;
185 ah->ah_single_chip = 1;
186 break;
188 ah->ah_radio = AR5K_RF5413;
189 ah->ah_single_chip = 1;
190 break;
192 ah->ah_radio = AR5K_RF2316;
193 ah->ah_single_chip = 1;
194 break;
196 ah->ah_radio = AR5K_RF2317;
197 ah->ah_single_chip = 1;
198 break;
200 if (ah->ah_mac_version == AR5K_SREV_AR2425 ||
201 ah->ah_mac_version == AR5K_SREV_AR2417) {
202 ah->ah_radio = AR5K_RF2425;
203 } else {
204 ah->ah_radio = AR5K_RF5413;
205 }
206 ah->ah_single_chip = 1;
207 break;
208 default:
209 /* Identify radio based on mac/phy srev */
210 if (ah->ah_version == AR5K_AR5210) {
211 ah->ah_radio = AR5K_RF5110;
212 ah->ah_single_chip = 0;
213 } else if (ah->ah_version == AR5K_AR5211) {
214 ah->ah_radio = AR5K_RF5111;
215 ah->ah_single_chip = 0;
216 ah->ah_radio_2ghz_revision = ath5k_hw_radio_revision(ah,
218 } else if (ah->ah_mac_version == (AR5K_SREV_AR2425 >> 4) ||
219 ah->ah_mac_version == (AR5K_SREV_AR2417 >> 4) ||
220 ah->ah_phy_revision == AR5K_SREV_PHY_2425) {
221 ah->ah_radio = AR5K_RF2425;
222 ah->ah_single_chip = 1;
223 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_2425;
224 } else if (srev == AR5K_SREV_AR5213A &&
225 ah->ah_phy_revision == AR5K_SREV_PHY_5212B) {
226 ah->ah_radio = AR5K_RF5112;
227 ah->ah_single_chip = 0;
228 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_5112B;
229 } else if (ah->ah_mac_version == (AR5K_SREV_AR2415 >> 4)) {
230 ah->ah_radio = AR5K_RF2316;
231 ah->ah_single_chip = 1;
232 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_2316;
233 } else if (ah->ah_mac_version == (AR5K_SREV_AR5414 >> 4) ||
234 ah->ah_phy_revision == AR5K_SREV_PHY_5413) {
235 ah->ah_radio = AR5K_RF5413;
236 ah->ah_single_chip = 1;
237 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_5413;
238 } else if (ah->ah_mac_version == (AR5K_SREV_AR2414 >> 4) ||
239 ah->ah_phy_revision == AR5K_SREV_PHY_2413) {
240 ah->ah_radio = AR5K_RF2413;
241 ah->ah_single_chip = 1;
242 ah->ah_radio_5ghz_revision = AR5K_SREV_RAD_2413;
243 } else {
244 DBG("ath5k: Couldn't identify radio revision.\n");
245 ret = -ENOTSUP;
246 goto err_free;
247 }
248 }
249
250 /* Return on unsuported chips (unsupported eeprom etc) */
251 if ((srev >= AR5K_SREV_AR5416) &&
252 (srev < AR5K_SREV_AR2425)) {
253 DBG("ath5k: Device not yet supported.\n");
254 ret = -ENOTSUP;
255 goto err_free;
256 }
257
258 /*
259 * Write PCI-E power save settings
260 */
261 if ((ah->ah_version == AR5K_AR5212) &&
265 /* Shut off RX when elecidle is asserted */
268 /* TODO: EEPROM work */
270 /* Shut off PLL and CLKREQ active in L1 */
272 /* Preserce other settings */
276 /* Reset SERDES to load new settings */
278 mdelay(1);
279 }
280
281 /*
282 * POST
283 */
284 ret = ath5k_hw_post(ah);
285 if (ret)
286 goto err_free;
287
288 /* Enable pci core retry fix on Hainan (5213A) and later chips */
289 if (srev >= AR5K_SREV_AR5213A)
291
292 /*
293 * Get card capabilities, calibration values etc
294 * TODO: EEPROM work
295 */
296 ret = ath5k_eeprom_init(ah);
297 if (ret) {
298 DBG("ath5k: unable to init EEPROM\n");
299 goto err_free;
300 }
301
302 /* Get misc capabilities */
304 if (ret) {
305 DBG("ath5k: unable to get device capabilities: 0x%04x\n",
306 sc->pdev->device);
307 goto err_free;
308 }
309
310 if (srev >= AR5K_SREV_AR2414) {
311 ah->ah_combined_mic = 1;
314 }
315
316 /* Set BSSID to bcast address: ff:ff:ff:ff:ff:ff for now */
317 memset(ah->ah_bssid, 0xff, ETH_ALEN);
318 ath5k_hw_set_associd(ah, ah->ah_bssid, 0);
320
322
323 *hw = ah;
324 return 0;
325err_free:
326 free(ah);
327err:
328 return ret;
329}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
#define AR5K_SREV
Definition reg.h:954
#define AR5K_PHY_CHIP_ID
Definition reg.h:1922
#define AR5K_PCIE_SERDES
Definition reg.h:1009
#define AR5K_SREV_REV
Definition reg.h:955
#define AR5K_MISC_MODE
Definition reg.h:1740
#define AR5K_PCIE_SERDES_RESET
Definition reg.h:1010
#define AR5K_MISC_MODE_COMBINED_MIC
Definition reg.h:1743
#define AR5K_PCICFG
Definition reg.h:877
#define AR5K_PHY(_n)
Definition reg.h:1856
#define AR5K_SREV_VER
Definition reg.h:957
#define AR5K_PCICFG_RETRY_FIX
Definition reg.h:895
#define AR5K_SREV_RAD_5112B
Definition ath5k.h:315
int ath5k_hw_init_desc_functions(struct ath5k_hw *ah)
Definition ath5k_desc.c:523
#define AR5K_SREV_AR2414
Definition ath5k.h:299
#define AR5K_TUNE_ANT_DIVERSITY
Definition ath5k.h:196
#define AR5K_SREV_RAD_5112
Definition ath5k.h:313
#define AR5K_SREV_RAD_2112
Definition ath5k.h:316
int ath5k_hw_set_opmode(struct ath5k_hw *ah)
ath5k_hw_set_opmode - Set PCU operating mode
Definition ath5k_pcu.c:49
#define AR5K_SREV_RAD_2317
Definition ath5k.h:322
#define AR5K_SREV_AR2415
Definition ath5k.h:303
#define AR5K_REG_ENABLE_BITS(ah, _reg, _flags)
Definition ath5k.h:106
#define AR5K_SREV_RAD_2425
Definition ath5k.h:324
#define AR5K_SREV_AR5213A
Definition ath5k.h:297
#define AR5K_TUNE_AIFS
Definition ath5k.h:183
#define AR5K_REG_MS(_val, _flags)
Definition ath5k.h:90
#define AR5K_SREV_AR2417
Definition ath5k.h:307
#define AR5K_SREV_AR2425
Definition ath5k.h:306
int ath5k_hw_set_capabilities(struct ath5k_hw *ah)
Definition ath5k_caps.c:37
#define AR5K_SREV_PHY_2413
Definition ath5k.h:331
#define AR5K_SREV_AR5414
Definition ath5k.h:302
#define AR5K_SREV_RAD_5413
Definition ath5k.h:320
int ath5k_eeprom_init(struct ath5k_hw *ah)
int ath5k_hw_rfgain_opt_init(struct ath5k_hw *ah)
Definition ath5k_phy.c:159
#define AR5K_INIT_TX_RETRY
Definition ath5k.h:230
#define AR5K_SREV_AR5416
Definition ath5k.h:304
#define AR5K_SREV_PHY_5212B
Definition ath5k.h:330
#define AR5K_SREV_RAD_2413
Definition ath5k.h:319
u16 ath5k_hw_radio_revision(struct ath5k_hw *ah, unsigned int chan)
Definition ath5k_phy.c:1373
#define AR5K_SREV_RAD_5424
Definition ath5k.h:323
#define AR5K_SREV_PHY_5413
Definition ath5k.h:332
#define AR5K_SREV_RAD_5111
Definition ath5k.h:310
#define AR5K_SREV_RAD_2316
Definition ath5k.h:321
#define AR5K_TUNE_CWMIN
Definition ath5k.h:186
int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, int initial)
#define AR5K_SREV_PHY_2425
Definition ath5k.h:333
void ath5k_hw_set_associd(struct ath5k_hw *ah, const u8 *bssid, u16 assoc_id)
ath5k_hw_set_associd - Set BSSID for association
Definition ath5k_pcu.c:229
static int ath5k_hw_post(struct ath5k_hw *ah)
ath5k_hw_post - Power On Self Test helper function
#define ENOMEM
Not enough space.
Definition errno.h:535
#define ENOTSUP
Operation not supported.
Definition errno.h:590
#define ETH_ALEN
Definition if_ether.h:9
void * memset(void *dest, int character, size_t len) __nonnull
void * zalloc(size_t size)
Allocate cleared memory.
Definition malloc.c:662
#define PCI_CAP_ID_EXP
PCI Express.
Definition pci.h:98
int pci_find_capability(struct pci_device *pci, int cap)
Look for a PCI capability.
Definition pciextra.c:39
static void(* free)(struct refcnt *refcnt))
Definition refcnt.h:55
ath5k_hw_get_isr - Get interrupt status
Definition ath5k.h:955
struct pci_device * pdev
Definition base.h:90
void * iobase
Definition base.h:91
Definition hw.c:16
A PCI device.
Definition pci.h:211
uint16_t device
Device ID.
Definition pci.h:230
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
Definition timer.c:79

References ah, AR5K_AR5210, AR5K_AR5211, AR5K_AR5212, AR5K_INIT_TX_RETRY, AR5K_MISC_MODE, AR5K_MISC_MODE_COMBINED_MIC, AR5K_PCICFG, AR5K_PCICFG_RETRY_FIX, AR5K_PCIE_SERDES, AR5K_PCIE_SERDES_RESET, AR5K_PHY, AR5K_PHY_CHIP_ID, AR5K_REG_ENABLE_BITS, AR5K_REG_MS, AR5K_RF2316, AR5K_RF2317, AR5K_RF2413, AR5K_RF2425, AR5K_RF5110, AR5K_RF5111, AR5K_RF5112, AR5K_RF5413, AR5K_SREV, AR5K_SREV_AR2414, AR5K_SREV_AR2415, AR5K_SREV_AR2417, AR5K_SREV_AR2425, AR5K_SREV_AR5213A, AR5K_SREV_AR5414, AR5K_SREV_AR5416, AR5K_SREV_PHY_2413, AR5K_SREV_PHY_2425, AR5K_SREV_PHY_5212B, AR5K_SREV_PHY_5413, AR5K_SREV_RAD_2112, AR5K_SREV_RAD_2316, AR5K_SREV_RAD_2317, AR5K_SREV_RAD_2413, AR5K_SREV_RAD_2425, AR5K_SREV_RAD_5111, AR5K_SREV_RAD_5112, AR5K_SREV_RAD_5112B, AR5K_SREV_RAD_5413, AR5K_SREV_RAD_5424, AR5K_SREV_REV, AR5K_SREV_VER, AR5K_TUNE_AIFS, AR5K_TUNE_ANT_DIVERSITY, AR5K_TUNE_CWMIN, ath5k_eeprom_init(), ath5k_hw_init_desc_functions(), ath5k_hw_nic_wakeup(), ath5k_hw_post(), ath5k_hw_radio_revision(), ath5k_hw_reg_read(), ath5k_hw_reg_write(), ath5k_hw_rfgain_opt_init(), ath5k_hw_set_associd(), ath5k_hw_set_capabilities(), ath5k_hw_set_opmode(), CHANNEL_2GHZ, CHANNEL_5GHZ, CHANNEL_B, DBG, pci_device::device, ENOMEM, ENOTSUP, ETH_ALEN, free, ath5k_softc::iobase, mdelay(), memset(), NULL, PCI_CAP_ID_EXP, pci_find_capability(), ath5k_softc::pdev, u32, u8, and zalloc().

Referenced by ath5k_probe().

◆ ath5k_hw_detach()

void ath5k_hw_detach ( struct ath5k_hw * ah)
extern

ath5k_hw_detach - Free the ath5k_hw struct

@ah: The &struct ath5k_hw

Definition at line 336 of file ath5k_attach.c.

337{
338 free(ah->ah_rf_banks);
340 free(ah);
341}
void ath5k_eeprom_detach(struct ath5k_hw *ah)

References ah, ath5k_eeprom_detach(), and free.

Referenced by ath5k_probe(), and ath5k_remove().

◆ ath5k_init_leds()

int ath5k_init_leds ( struct ath5k_softc * sc)
extern

◆ ath5k_led_enable()

void ath5k_led_enable ( struct ath5k_softc * sc)
extern

◆ ath5k_led_off()

void ath5k_led_off ( struct ath5k_softc * sc)
extern

◆ ath5k_unregister_leds()

void ath5k_unregister_leds ( struct ath5k_softc * sc)
extern

References ah, channel, and flags.

◆ ath5k_hw_nic_wakeup()

int ath5k_hw_nic_wakeup ( struct ath5k_hw * ah,
int flags,
int initial )
extern

Definition at line 283 of file ath5k_reset.c.

284{
285 struct pci_device *pdev = ah->ah_sc->pdev;
286 u32 turbo, mode, clock, bus_flags;
287 int ret;
288
289 turbo = 0;
290 mode = 0;
291 clock = 0;
292
293 /* Wakeup the device */
294 ret = ath5k_hw_wake(ah);
295 if (ret) {
296 DBG("ath5k: failed to wake up the MAC chip\n");
297 return ret;
298 }
299
300 if (ah->ah_version != AR5K_AR5210) {
301 /*
302 * Get channel mode flags
303 */
304
305 if (ah->ah_radio >= AR5K_RF5112) {
307 clock = AR5K_PHY_PLL_RF5112;
308 } else {
310 clock = AR5K_PHY_PLL_RF5111; /*Zero*/
311 }
312
313 if (flags & CHANNEL_2GHZ) {
315 clock |= AR5K_PHY_PLL_44MHZ;
316
317 if (flags & CHANNEL_CCK) {
319 } else if (flags & CHANNEL_OFDM) {
320 /* XXX Dynamic OFDM/CCK is not supported by the
321 * AR5211 so we set MOD_OFDM for plain g (no
322 * CCK headers) operation. We need to test
323 * this, 5211 might support ofdm-only g after
324 * all, there are also initial register values
325 * in the code for g mode (see initvals.c). */
326 if (ah->ah_version == AR5K_AR5211)
328 else
330 } else {
331 DBG("ath5k: invalid radio modulation mode\n");
332 return -EINVAL;
333 }
334 } else if (flags & CHANNEL_5GHZ) {
336
337 if (ah->ah_radio == AR5K_RF5413)
339 else
340 clock |= AR5K_PHY_PLL_40MHZ;
341
342 if (flags & CHANNEL_OFDM)
344 else {
345 DBG("ath5k: invalid radio modulation mode\n");
346 return -EINVAL;
347 }
348 } else {
349 DBG("ath5k: invalid radio frequency mode\n");
350 return -EINVAL;
351 }
352
353 if (flags & CHANNEL_TURBO)
355 } else { /* Reset the device */
356
357 /* ...enable Atheros turbo mode if requested */
358 if (flags & CHANNEL_TURBO)
361 }
362
363 /* reseting PCI on PCI-E cards results card to hang
364 * and always return 0xffff... so we ingore that flag
365 * for PCI-E cards */
367 bus_flags = 0;
368 else
369 bus_flags = AR5K_RESET_CTL_PCI;
370
371 /* Reset chipset */
372 if (ah->ah_version == AR5K_AR5210) {
376 mdelay(2);
377 } else {
379 AR5K_RESET_CTL_BASEBAND | bus_flags);
380 }
381 if (ret) {
382 DBG("ath5k: failed to reset the MAC chip\n");
383 return -EIO;
384 }
385
386 /* ...wakeup again!*/
387 ret = ath5k_hw_wake(ah);
388 if (ret) {
389 DBG("ath5k: failed to resume the MAC chip\n");
390 return ret;
391 }
392
393 /* ...final warm reset */
394 if (ath5k_hw_nic_reset(ah, 0)) {
395 DBG("ath5k: failed to warm reset the MAC chip\n");
396 return -EIO;
397 }
398
399 if (ah->ah_version != AR5K_AR5210) {
400
401 /* ...update PLL if needed */
402 if (ath5k_hw_reg_read(ah, AR5K_PHY_PLL) != clock) {
404 udelay(300);
405 }
406
407 /* ...set the PHY operating mode */
410 }
411
412 return 0;
413}
#define AR5K_PHY_TURBO_SHORT
Definition reg.h:1893
#define AR5K_PHY_TURBO
Definition reg.h:1891
#define AR5K_PHY_MODE
Definition reg.h:2487
#define AR5K_PHY_PLL_44MHZ
Definition reg.h:2103
#define AR5K_PHY_MODE_FREQ_2GHZ
Definition reg.h:2493
#define AR5K_RESET_CTL_BASEBAND
Definition reg.h:840
#define AR5K_PHY_MODE_MOD_CCK
Definition reg.h:2490
#define AR5K_RESET_CTL_DMA
Definition reg.h:839
#define AR5K_RESET_CTL_PCI
Definition reg.h:843
#define AR5K_PHY_PLL_40MHZ_5413
Definition reg.h:2097
#define AR5K_RESET_CTL_PCU
Definition reg.h:838
#define AR5K_PHY_PLL_RF5112
Definition reg.h:2107
#define AR5K_PHY_MODE_RAD_RF5112
Definition reg.h:2497
#define AR5K_PHY_PLL
Definition reg.h:2092
#define AR5K_RESET_CTL_MAC
Definition reg.h:841
#define AR5K_PHY_PLL_RF5111
Definition reg.h:2106
#define AR5K_PHY_MODE_MOD_OFDM
Definition reg.h:2489
#define AR5K_PHY_PLL_40MHZ
Definition reg.h:2098
#define AR5K_PHY_TURBO_MODE
Definition reg.h:1892
#define AR5K_PHY_MODE_RAD_RF5111
Definition reg.h:2496
#define AR5K_PHY_MODE_MOD_DYN
Definition reg.h:2494
#define AR5K_RESET_CTL_PHY
Definition reg.h:842
#define AR5K_PHY_MODE_FREQ_5GHZ
Definition reg.h:2492
int ath5k_hw_wake(struct ath5k_hw *ah)
static int ath5k_hw_nic_reset(struct ath5k_hw *ah, u32 val)
uint8_t flags
Flags.
Definition ena.h:7
uint16_t mode
Acceleration mode.
Definition ena.h:15
#define EINVAL
Invalid argument.
Definition errno.h:429
#define EIO
Input/output error.
Definition errno.h:434
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition timer.c:61

References __unused, ah, AR5K_AR5210, AR5K_AR5211, AR5K_PHY_MODE, AR5K_PHY_MODE_FREQ_2GHZ, AR5K_PHY_MODE_FREQ_5GHZ, AR5K_PHY_MODE_MOD_CCK, AR5K_PHY_MODE_MOD_DYN, AR5K_PHY_MODE_MOD_OFDM, AR5K_PHY_MODE_RAD_RF5111, AR5K_PHY_MODE_RAD_RF5112, AR5K_PHY_PLL, AR5K_PHY_PLL_40MHZ, AR5K_PHY_PLL_40MHZ_5413, AR5K_PHY_PLL_44MHZ, AR5K_PHY_PLL_RF5111, AR5K_PHY_PLL_RF5112, AR5K_PHY_TURBO, AR5K_PHY_TURBO_MODE, AR5K_PHY_TURBO_SHORT, AR5K_RESET_CTL_BASEBAND, AR5K_RESET_CTL_DMA, AR5K_RESET_CTL_MAC, AR5K_RESET_CTL_PCI, AR5K_RESET_CTL_PCU, AR5K_RESET_CTL_PHY, AR5K_RF5112, AR5K_RF5413, ath5k_hw_nic_reset(), ath5k_hw_reg_read(), ath5k_hw_reg_write(), ath5k_hw_wake(), CHANNEL_2GHZ, CHANNEL_5GHZ, CHANNEL_CCK, CHANNEL_OFDM, CHANNEL_TURBO, DBG, EINVAL, EIO, flags, mdelay(), mode, PCI_CAP_ID_EXP, pci_find_capability(), u32, and udelay().

Referenced by ath5k_hw_attach(), and ath5k_hw_reset().

◆ ath5k_hw_reset()

int ath5k_hw_reset ( struct ath5k_hw * ah,
struct net80211_channel * channel,
int change_channel )
extern

Definition at line 691 of file ath5k_reset.c.

693{
694 u32 s_seq[10], s_ant, s_led[3], staid1_flags;
695 u32 phy_tst1;
696 u8 mode, freq, ee_mode, ant[2];
697 int i, ret;
698
699 s_ant = 0;
700 ee_mode = 0;
701 staid1_flags = 0;
702 freq = 0;
703 mode = 0;
704
705 /*
706 * Save some registers before a reset
707 */
708 /*DCU/Antenna selection not available on 5210*/
709 if (ah->ah_version != AR5K_AR5210) {
710
711 switch (channel->hw_value & CHANNEL_MODES) {
712 case CHANNEL_A:
715 ee_mode = AR5K_EEPROM_MODE_11A;
716 break;
717 case CHANNEL_G:
720 ee_mode = AR5K_EEPROM_MODE_11G;
721 break;
722 case CHANNEL_B:
725 ee_mode = AR5K_EEPROM_MODE_11B;
726 break;
727 case CHANNEL_T:
730 ee_mode = AR5K_EEPROM_MODE_11A;
731 break;
732 case CHANNEL_TG:
733 if (ah->ah_version == AR5K_AR5211) {
734 DBG("ath5k: TurboG not available on 5211\n");
735 return -EINVAL;
736 }
739 ee_mode = AR5K_EEPROM_MODE_11G;
740 break;
741 case CHANNEL_XR:
742 if (ah->ah_version == AR5K_AR5211) {
743 DBG("ath5k: XR mode not available on 5211\n");
744 return -EINVAL;
745 }
748 ee_mode = AR5K_EEPROM_MODE_11A;
749 break;
750 default:
751 DBG("ath5k: invalid channel (%d MHz)\n",
752 channel->center_freq);
753 return -EINVAL;
754 }
755
756 if (change_channel) {
757 /*
758 * Save frame sequence count
759 * For revs. after Oahu, only save
760 * seq num for DCU 0 (Global seq num)
761 */
762 if (ah->ah_mac_srev < AR5K_SREV_AR5211) {
763
764 for (i = 0; i < 10; i++)
765 s_seq[i] = ath5k_hw_reg_read(ah,
767
768 } else {
769 s_seq[0] = ath5k_hw_reg_read(ah,
771 }
772 }
773
774 /* Save default antenna */
776
777 if (ah->ah_version == AR5K_AR5212) {
778 /* Since we are going to write rf buffer
779 * check if we have any pending gain_F
780 * optimization settings */
781 if (change_channel && ah->ah_rf_banks != NULL)
783 }
784 }
785
786 /*GPIOs*/
787 s_led[0] = ath5k_hw_reg_read(ah, AR5K_PCICFG) &
789 s_led[1] = ath5k_hw_reg_read(ah, AR5K_GPIOCR);
790 s_led[2] = ath5k_hw_reg_read(ah, AR5K_GPIODO);
791
792 /* AR5K_STA_ID1 flags, only preserve antenna
793 * settings and ack/cts rate mode */
794 staid1_flags = ath5k_hw_reg_read(ah, AR5K_STA_ID1) &
801
802 /* Wakeup the device */
803 ret = ath5k_hw_nic_wakeup(ah, channel->hw_value, 0);
804 if (ret)
805 return ret;
806
807 /* PHY access enable */
808 if (ah->ah_mac_srev >= AR5K_SREV_AR5211)
810 else
812 AR5K_PHY(0));
813
814 /* Write initial settings */
815 ret = ath5k_hw_write_initvals(ah, mode, change_channel);
816 if (ret)
817 return ret;
818
819 /*
820 * 5211/5212 Specific
821 */
822 if (ah->ah_version != AR5K_AR5210) {
823
824 /*
825 * Write initial RF gain settings
826 * This should work for both 5111/5112
827 */
828 ret = ath5k_hw_rfgain_init(ah, freq);
829 if (ret)
830 return ret;
831
832 mdelay(1);
833
834 /*
835 * Tweak initval settings for revised
836 * chipsets and add some more config
837 * bits
838 */
840
841 /*
842 * Set TX power (FIXME)
843 */
844 ret = ath5k_hw_txpower(ah, channel, ee_mode,
846 if (ret)
847 return ret;
848
849 /* Write rate duration table only on AR5212 */
850 if (ah->ah_version == AR5K_AR5212)
852
853 /*
854 * Write RF buffer
855 */
857 if (ret)
858 return ret;
859
860
861 /* Write OFDM timings on 5212*/
862 if (ah->ah_version == AR5K_AR5212 &&
863 channel->hw_value & CHANNEL_OFDM) {
865 if (ret)
866 return ret;
867 }
868
869 /*Enable/disable 802.11b mode on 5111
870 (enable 2111 frequency converter + CCK)*/
871 if (ah->ah_radio == AR5K_RF5111) {
872 if (mode == AR5K_MODE_11B)
875 else
878 }
879
880 /*
881 * In case a fixed antenna was set as default
882 * write the same settings on both AR5K_PHY_ANT_SWITCH_TABLE
883 * registers.
884 */
885 if (s_ant != 0) {
886 if (s_ant == AR5K_ANT_FIXED_A) /* 1 - Main */
887 ant[0] = ant[1] = AR5K_ANT_FIXED_A;
888 else /* 2 - Aux */
889 ant[0] = ant[1] = AR5K_ANT_FIXED_B;
890 } else {
891 ant[0] = AR5K_ANT_FIXED_A;
892 ant[1] = AR5K_ANT_FIXED_B;
893 }
894
895 /* Commit values from EEPROM */
897
898 } else {
899 /*
900 * For 5210 we do all initialization using
901 * initvals, so we don't have to modify
902 * any settings (5210 also only supports
903 * a/aturbo modes)
904 */
905 mdelay(1);
906 /* Disable phy and wait */
908 mdelay(1);
909 }
910
911 /*
912 * Restore saved values
913 */
914
915 /*DCU/Antenna selection not available on 5210*/
916 if (ah->ah_version != AR5K_AR5210) {
917
918 if (change_channel) {
919 if (ah->ah_mac_srev < AR5K_SREV_AR5211) {
920 for (i = 0; i < 10; i++)
921 ath5k_hw_reg_write(ah, s_seq[i],
923 } else {
924 ath5k_hw_reg_write(ah, s_seq[0],
926 }
927 }
928
930 }
931
932 /* Ledstate */
934
935 /* Gpio settings */
938
939 /* Restore sta_id flags and preserve our mac address*/
940 ath5k_hw_reg_write(ah, AR5K_LOW_ID(ah->ah_sta_id),
942 ath5k_hw_reg_write(ah, staid1_flags | AR5K_HIGH_ID(ah->ah_sta_id),
944
945
946 /*
947 * Configure PCU
948 */
949
950 /* Restore bssid and bssid mask */
951 /* XXX: add ah->aid once mac80211 gives this to us */
952 ath5k_hw_set_associd(ah, ah->ah_bssid, 0);
953
954 /* Set PCU config */
956
957 /* Clear any pending interrupts
958 * PISR/SISR Not available on 5210 */
959 if (ah->ah_version != AR5K_AR5210)
960 ath5k_hw_reg_write(ah, 0xffffffff, AR5K_PISR);
961
962 /* Set RSSI/BRSSI thresholds
963 *
964 * Note: If we decide to set this value
965 * dynamicaly, have in mind that when AR5K_RSSI_THR
966 * register is read it might return 0x40 if we haven't
967 * wrote anything to it plus BMISS RSSI threshold is zeroed.
968 * So doing a save/restore procedure here isn't the right
969 * choice. Instead store it on ath5k_hw */
974
975 /* MIC QoS support */
976 if (ah->ah_mac_srev >= AR5K_SREV_AR2413) {
979 }
980
981 /* QoS NOACK Policy */
982 if (ah->ah_version == AR5K_AR5212) {
988 }
989
990
991 /*
992 * Configure PHY
993 */
994
995 /* Set channel on PHY */
997 if (ret)
998 return ret;
999
1000 /*
1001 * Enable the PHY and wait until completion
1002 * This includes BaseBand and Synthesizer
1003 * activation.
1004 */
1006
1007 /*
1008 * On 5211+ read activation -> rx delay
1009 * and use it.
1010 *
1011 * TODO: Half/quarter rate support
1012 */
1013 if (ah->ah_version != AR5K_AR5210) {
1014 u32 delay;
1017 delay = (channel->hw_value & CHANNEL_CCK) ?
1018 ((delay << 2) / 22) : (delay / 10);
1019
1020 udelay(100 + (2 * delay));
1021 } else {
1022 mdelay(1);
1023 }
1024
1025 /*
1026 * Perform ADC test to see if baseband is ready
1027 * Set tx hold and check adc test register
1028 */
1029 phy_tst1 = ath5k_hw_reg_read(ah, AR5K_PHY_TST1);
1031 for (i = 0; i <= 20; i++) {
1032 if (!(ath5k_hw_reg_read(ah, AR5K_PHY_ADC_TEST) & 0x10))
1033 break;
1034 udelay(200);
1035 }
1037
1038 /*
1039 * Start automatic gain control calibration
1040 *
1041 * During AGC calibration RX path is re-routed to
1042 * a power detector so we don't receive anything.
1043 *
1044 * This method is used to calibrate some static offsets
1045 * used together with on-the fly I/Q calibration (the
1046 * one performed via ath5k_hw_phy_calibrate), that doesn't
1047 * interrupt rx path.
1048 *
1049 * While rx path is re-routed to the power detector we also
1050 * start a noise floor calibration, to measure the
1051 * card's noise floor (the noise we measure when we are not
1052 * transmiting or receiving anything).
1053 *
1054 * If we are in a noisy environment AGC calibration may time
1055 * out and/or noise floor calibration might timeout.
1056 */
1059
1060 /* At the same time start I/Q calibration for QAM constellation
1061 * -no need for CCK- */
1062 ah->ah_calibration = 0;
1063 if (!(mode == AR5K_MODE_11B)) {
1064 ah->ah_calibration = 1;
1069 }
1070
1071 /* Wait for gain calibration to finish (we check for I/Q calibration
1072 * during ath5k_phy_calibrate) */
1073 if (ath5k_hw_register_timeout(ah, AR5K_PHY_AGCCTL,
1074 AR5K_PHY_AGCCTL_CAL, 0, 0)) {
1075 DBG("ath5k: gain calibration timeout (%d MHz)\n",
1076 channel->center_freq);
1077 }
1078
1079 /*
1080 * If we run NF calibration before AGC, it always times out.
1081 * Binary HAL starts NF and AGC calibration at the same time
1082 * and only waits for AGC to finish. Also if AGC or NF cal.
1083 * times out, reset doesn't fail on binary HAL. I believe
1084 * that's wrong because since rx path is routed to a detector,
1085 * if cal. doesn't finish we won't have RX. Sam's HAL for AR5210/5211
1086 * enables noise floor calibration after offset calibration and if noise
1087 * floor calibration fails, reset fails. I believe that's
1088 * a better approach, we just need to find a polling interval
1089 * that suits best, even if reset continues we need to make
1090 * sure that rx path is ready.
1091 */
1093
1094
1095 /*
1096 * Configure QCUs/DCUs
1097 */
1098
1099 /* TODO: HW Compression support for data queues */
1100 /* TODO: Burst prefetch for data queues */
1101
1102 /*
1103 * Reset queues and start beacon timers at the end of the reset routine
1104 * This also sets QCU mask on each DCU for 1:1 qcu to dcu mapping
1105 * Note: If we want we can assign multiple qcus on one dcu.
1106 */
1108 if (ret) {
1109 DBG("ath5k: failed to reset TX queue\n");
1110 return ret;
1111 }
1112
1113 /*
1114 * Configure DMA/Interrupts
1115 */
1116
1117 /*
1118 * Set Rx/Tx DMA Configuration
1119 *
1120 * Set standard DMA size (128). Note that
1121 * a DMA size of 512 causes rx overruns and tx errors
1122 * on pci-e cards (tested on 5424 but since rx overruns
1123 * also occur on 5416/5418 with madwifi we set 128
1124 * for all PCI-E cards to be safe).
1125 *
1126 * XXX: need to check 5210 for this
1127 * TODO: Check out tx triger level, it's always 64 on dumps but I
1128 * guess we can tweak it and see how it goes ;-)
1129 */
1130 if (ah->ah_version != AR5K_AR5210) {
1135 }
1136
1137 /* Pre-enable interrupts on 5211/5212*/
1138 if (ah->ah_version != AR5K_AR5210)
1139 ath5k_hw_set_imr(ah, ah->ah_imr);
1140
1141 /*
1142 * Setup RFKill interrupt if rfkill flag is set on eeprom.
1143 * TODO: Use gpio pin and polarity infos from eeprom
1144 * TODO: Handle this in ath5k_intr because it'll result
1145 * a nasty interrupt storm.
1146 */
1147#if 0
1148 if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header)) {
1150 ah->ah_gpio[0] = ath5k_hw_get_gpio(ah, 0);
1151 if (ah->ah_gpio[0] == 0)
1153 else
1155 }
1156#endif
1157
1158 /*
1159 * Disable beacons and reset the register
1160 */
1163
1164 return 0;
1165}
@ AR5K_ANT_FIXED_B
Definition eeprom.h:236
@ AR5K_ANT_FIXED_A
Definition eeprom.h:235
#define AR5K_EEPROM_HDR_RFKILL(_v)
Definition eeprom.h:75
#define AR5K_EEPROM_MODE_11A
Definition eeprom.h:64
#define AR5K_EEPROM_MODE_11B
Definition eeprom.h:65
#define AR5K_EEPROM_MODE_11G
Definition eeprom.h:66
#define AR5K_PHY_IQ_RUN
Definition reg.h:2192
#define AR5K_RSSI_THR
Definition reg.h:1177
#define AR5K_PHY_IQ
Definition reg.h:2185
#define AR5K_PHY_ADC_TEST
Definition reg.h:2418
#define AR5K_QOS_NOACK_BIT_OFFSET
Definition reg.h:1700
#define AR5K_PHY_AGCCTL_CAL
Definition reg.h:2024
#define AR5K_BEACON_RESET_TSF
Definition reg.h:1244
#define AR5K_STA_ID1_ACKCTS_6MB
Definition reg.h:1137
#define AR5K_MIC_QOS_CTL
Definition reg.h:1727
#define AR5K_QOS_NOACK_BYTE_OFFSET
Definition reg.h:1702
#define AR5K_PHY_IQ_CAL_NUM_LOG_MAX
Definition reg.h:2190
#define AR5K_PHY_ACT_ENABLE
Definition reg.h:1928
#define AR5K_BEACON_ENABLE
Definition reg.h:1243
#define AR5K_PHY_AGCCTL
Definition reg.h:2023
#define AR5K_STA_ID1_RTS_DEF_ANTENNA
Definition reg.h:1136
#define AR5K_RXCFG
Definition reg.h:198
#define AR5K_PHY_ACT
Definition reg.h:1927
#define AR5K_TXCFG_B_MODE
Definition reg.h:174
#define AR5K_BEACON
Definition reg.h:1237
#define AR5K_PISR
Definition reg.h:288
#define AR5K_TXCFG_SDMAMR
Definition reg.h:172
#define AR5K_GPIODO
Definition reg.h:943
#define AR5K_RSSI_THR_BMISS_S
Definition reg.h:1185
#define AR5K_RXCFG_SDMAMW
Definition reg.h:199
#define AR5K_STA_ID1_DEFAULT_ANTENNA
Definition reg.h:1134
#define AR5K_PHY_ACT_DISABLE
Definition reg.h:1929
#define AR5K_PHY_TST1
Definition reg.h:1901
#define AR5K_MIC_QOS_SEL
Definition reg.h:1734
#define AR5K_TXCFG
Definition reg.h:171
#define AR5K_STA_ID1
Definition reg.h:1123
#define AR5K_PHY_RX_DELAY
Definition reg.h:2173
#define AR5K_PCICFG_LEDSTATE
Definition reg.h:906
#define AR5K_STA_ID1_DESC_ANTENNA
Definition reg.h:1135
#define AR5K_GPIOCR
Definition reg.h:930
#define AR5K_STA_ID0
Definition reg.h:1117
#define AR5K_PHY_TST1_TXHOLD
Definition reg.h:1903
#define AR5K_QOS_NOACK_2BIT_VALUES
Definition reg.h:1698
#define AR5K_STA_ID1_SELFGEN_DEF_ANT
Definition reg.h:1139
#define AR5K_QOS_NOACK
Definition reg.h:1697
#define AR5K_QUEUE_DCU_SEQNUM(_q)
Definition reg.h:754
#define AR5K_PHY_SHIFT_5GHZ
Definition reg.h:1879
#define AR5K_PHY_RX_DELAY_M
Definition reg.h:2174
#define AR5K_STA_ID1_BASE_RATE_11B
Definition reg.h:1138
#define AR5K_DEFAULT_ANTENNA
Definition reg.h:1471
int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah)
Definition ath5k_qcu.c:98
#define CHANNEL_TG
Definition ath5k.h:644
#define AR5K_TUNE_BMISS_THRES
Definition ath5k.h:180
int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq)
Definition ath5k_phy.c:453
int ath5k_hw_write_initvals(struct ath5k_hw *ah, u8 mode, int change_channel)
u32 ath5k_hw_get_gpio(struct ath5k_hw *ah, u32 gpio)
Definition ath5k_gpio.c:65
#define AR5K_LOW_ID(_a)
Definition ath5k.h:154
#define CHANNEL_MODES
Definition ath5k.h:653
#define AR5K_REG_SM(_val, _flags)
Definition ath5k.h:86
#define AR5K_INI_RFGAIN_2GHZ
Definition ath5k.h:142
int ath5k_hw_set_gpio_input(struct ath5k_hw *ah, u32 gpio)
Definition ath5k_gpio.c:35
int ath5k_hw_noise_floor_calibration(struct ath5k_hw *ah, short freq)
ath5k_hw_noise_floor_calibration - perform PHY noise floor calibration
Definition ath5k_phy.c:1128
#define CHANNEL_G
Definition ath5k.h:642
#define CHANNEL_T
Definition ath5k.h:643
void ath5k_hw_set_gpio_intr(struct ath5k_hw *ah, unsigned int gpio, u32 interrupt_level)
Definition ath5k_gpio.c:99
int ath5k_hw_rfregs_init(struct ath5k_hw *ah, struct net80211_channel *channel, unsigned int mode)
Definition ath5k_phy.c:515
#define AR5K_REG_WRITE_BITS(ah, _reg, _flags, _val)
Definition ath5k.h:98
enum ath5k_int ath5k_hw_set_imr(struct ath5k_hw *ah, enum ath5k_int new_mask)
ath5k_hw_set_imr - Set interrupt mask
Definition ath5k_dma.c:549
#define AR5K_SREV_AR5211
Definition ath5k.h:294
#define AR5K_TUNE_RSSI_THRES
Definition ath5k.h:174
#define AR5K_INI_RFGAIN_5GHZ
Definition ath5k.h:141
#define AR5K_HIGH_ID(_a)
Definition ath5k.h:158
int ath5k_hw_channel(struct ath5k_hw *ah, struct net80211_channel *channel)
Definition ath5k_phy.c:1049
#define CHANNEL_A
Definition ath5k.h:640
int ath5k_hw_txpower(struct ath5k_hw *ah, struct net80211_channel *channel, u8 ee_mode, u8 txpower)
Definition ath5k_phy.c:2475
#define AR5K_REG_DISABLE_BITS(ah, _reg, _flags)
Definition ath5k.h:109
#define AR5K_TUNE_DEFAULT_TXPOWER
Definition ath5k.h:194
enum ath5k_rfgain ath5k_hw_gainf_calibrate(struct ath5k_hw *ah)
Definition ath5k_phy.c:390
#define AR5K_SREV_AR2413
Definition ath5k.h:298
static void ath5k_hw_tweak_initval_settings(struct ath5k_hw *ah, struct net80211_channel *channel)
static void ath5k_hw_commit_eeprom_settings(struct ath5k_hw *ah, struct net80211_channel *channel, u8 *ant, u8 ee_mode)
static int ath5k_hw_write_ofdm_timings(struct ath5k_hw *ah, struct net80211_channel *channel)
ath5k_hw_write_ofdm_timings - set OFDM timings on AR5212
Definition ath5k_reset.c:86
static void ath5k_hw_write_rate_duration(struct ath5k_hw *ah, unsigned int mode __unused)
ath5k_hw_write_rate_duration - fill rate code to duration table
int ath5k_hw_nic_wakeup(struct ath5k_hw *ah, int flags, int initial __unused)
#define delay(nanosec)
Definition epic100.c:49
#define u8
Definition igbvf_osdep.h:40
uint32_t channel
RNDIS channel.
Definition netvsc.h:3

References ah, AR5K_ANT_FIXED_A, AR5K_ANT_FIXED_B, AR5K_AR5210, AR5K_AR5211, AR5K_AR5212, AR5K_BEACON, AR5K_BEACON_ENABLE, AR5K_BEACON_RESET_TSF, AR5K_DEFAULT_ANTENNA, AR5K_DMASIZE_128B, AR5K_EEPROM_HDR_RFKILL, AR5K_EEPROM_MODE_11A, AR5K_EEPROM_MODE_11B, AR5K_EEPROM_MODE_11G, AR5K_GPIOCR, AR5K_GPIODO, AR5K_HIGH_ID, AR5K_INI_RFGAIN_2GHZ, AR5K_INI_RFGAIN_5GHZ, AR5K_LOW_ID, AR5K_MIC_QOS_CTL, AR5K_MIC_QOS_SEL, AR5K_MODE_11A, AR5K_MODE_11A_TURBO, AR5K_MODE_11B, AR5K_MODE_11G, AR5K_MODE_11G_TURBO, AR5K_MODE_XR, AR5K_PCICFG, AR5K_PCICFG_LEDSTATE, AR5K_PHY, AR5K_PHY_ACT, AR5K_PHY_ACT_DISABLE, AR5K_PHY_ACT_ENABLE, AR5K_PHY_ADC_TEST, AR5K_PHY_AGCCTL, AR5K_PHY_AGCCTL_CAL, AR5K_PHY_IQ, AR5K_PHY_IQ_CAL_NUM_LOG_MAX, AR5K_PHY_IQ_RUN, AR5K_PHY_RX_DELAY, AR5K_PHY_RX_DELAY_M, AR5K_PHY_SHIFT_5GHZ, AR5K_PHY_TST1, AR5K_PHY_TST1_TXHOLD, AR5K_PISR, AR5K_QOS_NOACK, AR5K_QOS_NOACK_2BIT_VALUES, AR5K_QOS_NOACK_BIT_OFFSET, AR5K_QOS_NOACK_BYTE_OFFSET, AR5K_QUEUE_DCU_SEQNUM, AR5K_REG_DISABLE_BITS, AR5K_REG_ENABLE_BITS, AR5K_REG_SM, AR5K_REG_WRITE_BITS, AR5K_RF5111, AR5K_RSSI_THR, AR5K_RSSI_THR_BMISS_S, AR5K_RXCFG, AR5K_RXCFG_SDMAMW, AR5K_SREV_AR2413, AR5K_SREV_AR5211, AR5K_STA_ID0, AR5K_STA_ID1, AR5K_STA_ID1_ACKCTS_6MB, AR5K_STA_ID1_BASE_RATE_11B, AR5K_STA_ID1_DEFAULT_ANTENNA, AR5K_STA_ID1_DESC_ANTENNA, AR5K_STA_ID1_RTS_DEF_ANTENNA, AR5K_STA_ID1_SELFGEN_DEF_ANT, AR5K_TUNE_BMISS_THRES, AR5K_TUNE_DEFAULT_TXPOWER, AR5K_TUNE_RSSI_THRES, AR5K_TXCFG, AR5K_TXCFG_B_MODE, AR5K_TXCFG_SDMAMR, ath5k_hw_channel(), ath5k_hw_commit_eeprom_settings(), ath5k_hw_gainf_calibrate(), ath5k_hw_get_gpio(), ath5k_hw_nic_wakeup(), ath5k_hw_noise_floor_calibration(), ath5k_hw_reg_read(), ath5k_hw_reg_write(), ath5k_hw_reset_tx_queue(), ath5k_hw_rfgain_init(), ath5k_hw_rfregs_init(), ath5k_hw_set_associd(), ath5k_hw_set_gpio_input(), ath5k_hw_set_gpio_intr(), ath5k_hw_set_imr(), ath5k_hw_set_opmode(), ath5k_hw_tweak_initval_settings(), ath5k_hw_txpower(), ath5k_hw_write_initvals(), ath5k_hw_write_ofdm_timings(), ath5k_hw_write_rate_duration(), channel, CHANNEL_A, CHANNEL_B, CHANNEL_CCK, CHANNEL_G, CHANNEL_MODES, CHANNEL_OFDM, CHANNEL_T, CHANNEL_TG, CHANNEL_XR, DBG, delay, EINVAL, mdelay(), mode, NULL, u32, u8, and udelay().

Referenced by ath5k_reset().

◆ ath5k_hw_set_power()

int ath5k_hw_set_power ( struct ath5k_hw * ah,
enum ath5k_power_mode mode,
int set_chip,
u16 sleep_duration )
extern

References ah, filter, high, mac, mode, queue, timeout(), u16, u32, and u8.

◆ ath5k_hw_start_rx_dma()

void ath5k_hw_start_rx_dma ( struct ath5k_hw * ah)
extern

ath5k_hw_start_rx_dma - Start DMA receive

@ah: The &struct ath5k_hw

Definition at line 55 of file ath5k_dma.c.

56{
59}
#define AR5K_CR
Definition reg.h:55
#define AR5K_CR_RXE
Definition reg.h:58

References ah, AR5K_CR, AR5K_CR_RXE, ath5k_hw_reg_read(), and ath5k_hw_reg_write().

Referenced by ath5k_rx_start().

◆ ath5k_hw_stop_rx_dma()

int ath5k_hw_stop_rx_dma ( struct ath5k_hw * ah)
extern

ath5k_hw_stop_rx_dma - Stop DMA receive

@ah: The &struct ath5k_hw

Definition at line 66 of file ath5k_dma.c.

67{
68 unsigned int i;
69
71
72 /*
73 * It may take some time to disable the DMA receive unit
74 */
75 for (i = 1000; i > 0 &&
77 i--)
78 udelay(10);
79
80 return i ? 0 : -EBUSY;
81}
#define AR5K_CR_RXD
Definition reg.h:61
#define EBUSY
Device or resource busy.
Definition errno.h:339

References ah, AR5K_CR, AR5K_CR_RXD, AR5K_CR_RXE, ath5k_hw_reg_read(), ath5k_hw_reg_write(), EBUSY, and udelay().

Referenced by ath5k_rx_stop().

◆ ath5k_hw_get_rxdp()

u32 ath5k_hw_get_rxdp ( struct ath5k_hw * ah)
extern

ath5k_hw_get_rxdp - Get RX Descriptor's address

@ah: The &struct ath5k_hw

XXX: Is RXDP read and clear ?

Definition at line 90 of file ath5k_dma.c.

91{
93}
#define AR5K_RXDP
Definition reg.h:67

References ah, AR5K_RXDP, ath5k_hw_reg_read(), and u32.

◆ ath5k_hw_set_rxdp()

void ath5k_hw_set_rxdp ( struct ath5k_hw * ah,
u32 phys_addr )
extern

ath5k_hw_set_rxdp - Set RX Descriptor's address

@ah: The &struct ath5k_hw @phys_addr: RX descriptor address

XXX: Should we check if rx is enabled before setting rxdp ?

Definition at line 103 of file ath5k_dma.c.

104{
105 ath5k_hw_reg_write(ah, phys_addr, AR5K_RXDP);
106}

References ah, AR5K_RXDP, ath5k_hw_reg_write(), and u32.

Referenced by ath5k_rx_start().

◆ ath5k_hw_start_tx_dma()

int ath5k_hw_start_tx_dma ( struct ath5k_hw * ah,
unsigned int queue )
extern

ath5k_hw_start_tx_dma - Start DMA transmit for a specific queue

@ah: The &struct ath5k_hw @queue: The hw queue number

Start DMA transmit for a specific queue and since 5210 doesn't have QCU/DCU, set up queue parameters for 5210 here based on queue type (one queue for normal data and one queue for beacons). For queue setup on newer chips check out qcu.c. Returns -EINVAL if queue number is out of range or if queue is already disabled.

NOTE: Must be called after setting up tx control descriptor for that queue (see below).

Definition at line 128 of file ath5k_dma.c.

129{
130 u32 tx_queue;
131
132 /* Return if queue is declared inactive */
133 if (ah->ah_txq.tqi_type == AR5K_TX_QUEUE_INACTIVE)
134 return -EIO;
135
136 if (ah->ah_version == AR5K_AR5210) {
137 tx_queue = ath5k_hw_reg_read(ah, AR5K_CR);
138
139 /* Assume always a data queue */
140 tx_queue |= AR5K_CR_TXE0 & ~AR5K_CR_TXD0;
141
142 /* Start queue */
143 ath5k_hw_reg_write(ah, tx_queue, AR5K_CR);
145 } else {
146 /* Return if queue is disabled */
148 return -EIO;
149
150 /* Start queue */
152 }
153
154 return 0;
155}
#define AR5K_QCU_TXD
Definition reg.h:566
#define AR5K_CR_TXD0
Definition reg.h:59
#define AR5K_QCU_TXE
Definition reg.h:559
#define AR5K_CR_TXE0
Definition reg.h:56
#define AR5K_REG_WRITE_Q(ah, _reg, _queue)
Definition ath5k.h:123
#define AR5K_REG_READ_Q(ah, _reg, _queue)
Definition ath5k.h:120
uint16_t queue
Queue ID.
Definition ena.h:11

References ah, AR5K_AR5210, AR5K_CR, AR5K_CR_TXD0, AR5K_CR_TXE0, AR5K_QCU_TXD, AR5K_QCU_TXE, AR5K_REG_READ_Q, AR5K_REG_WRITE_Q, AR5K_TX_QUEUE_INACTIVE, ath5k_hw_reg_read(), ath5k_hw_reg_write(), EIO, queue, and u32.

Referenced by ath5k_txbuf_setup().

◆ ath5k_hw_stop_tx_dma()

int ath5k_hw_stop_tx_dma ( struct ath5k_hw * ah,
unsigned int queue )
extern

ath5k_hw_stop_tx_dma - Stop DMA transmit on a specific queue

@ah: The &struct ath5k_hw @queue: The hw queue number

Stop DMA transmit on a specific hw queue and drain queue so we don't have any pending frames. Returns -EBUSY if we still have pending frames, -EINVAL if queue number is out of range.

Definition at line 168 of file ath5k_dma.c.

169{
170 unsigned int i = 40;
171 u32 tx_queue, pending;
172
173 /* Return if queue is declared inactive */
174 if (ah->ah_txq.tqi_type == AR5K_TX_QUEUE_INACTIVE)
175 return -EIO;
176
177 if (ah->ah_version == AR5K_AR5210) {
178 tx_queue = ath5k_hw_reg_read(ah, AR5K_CR);
179
180 /* Assume a data queue */
181 tx_queue |= AR5K_CR_TXD0 & ~AR5K_CR_TXE0;
182
183 /* Stop queue */
184 ath5k_hw_reg_write(ah, tx_queue, AR5K_CR);
186 } else {
187 /*
188 * Schedule TX disable and wait until queue is empty
189 */
191
192 /*Check for pending frames*/
193 do {
197 udelay(100);
198 } while (--i && pending);
199
200 /* For 2413+ order PCU to drop packets using
201 * QUIET mechanism */
202 if (ah->ah_mac_version >= (AR5K_SREV_AR2414 >> 4) && pending) {
203 /* Set periodicity and duration */
208
209 /* Enable quiet period for current TSF */
213 AR5K_TSF_L32_5211) >> 10,
216
217 /* Force channel idle high */
220
221 /* Wait a while and disable mechanism */
222 udelay(200);
225
226 /* Re-check for pending frames */
227 i = 40;
228 do {
232 udelay(100);
233 } while (--i && pending);
234
237 }
238
239 /* Clear register */
241 if (pending)
242 return -EBUSY;
243 }
244
245 /* TODO: Check for success on 5210 else return error */
246 return 0;
247}
#define AR5K_QUIET_CTL2
Definition reg.h:1681
#define AR5K_QUEUE_STATUS(_q)
Definition reg.h:629
#define AR5K_TSF_L32_5211
Definition reg.h:1435
#define AR5K_QUIET_CTL1
Definition reg.h:1675
#define AR5K_DIAG_SW_CHANEL_IDLE_HIGH
Definition reg.h:1428
#define AR5K_DIAG_SW_5211
Definition reg.h:1386
#define AR5K_QUIET_CTL2_QT_PER
Definition reg.h:1682
#define AR5K_QUIET_CTL1_QT_EN
Definition reg.h:1678
#define AR5K_QUIET_CTL1_NEXT_QT_TSF
Definition reg.h:1676
#define AR5K_QUIET_CTL2_QT_DUR
Definition reg.h:1684
#define AR5K_QCU_STS_FRMPENDCNT
Definition reg.h:627
uint32_t pending
Pending events.
Definition hyperv.h:1

References ah, AR5K_AR5210, AR5K_CR, AR5K_CR_TXD0, AR5K_CR_TXE0, AR5K_DIAG_SW_5211, AR5K_DIAG_SW_CHANEL_IDLE_HIGH, AR5K_QCU_STS_FRMPENDCNT, AR5K_QCU_TXD, AR5K_QUEUE_STATUS, AR5K_QUIET_CTL1, AR5K_QUIET_CTL1_NEXT_QT_TSF, AR5K_QUIET_CTL1_QT_EN, AR5K_QUIET_CTL2, AR5K_QUIET_CTL2_QT_DUR, AR5K_QUIET_CTL2_QT_PER, AR5K_REG_DISABLE_BITS, AR5K_REG_ENABLE_BITS, AR5K_REG_SM, AR5K_REG_WRITE_Q, AR5K_SREV_AR2414, AR5K_TSF_L32_5211, AR5K_TX_QUEUE_INACTIVE, ath5k_hw_reg_read(), ath5k_hw_reg_write(), EBUSY, EIO, pending, queue, u32, and udelay().

Referenced by ath5k_txq_cleanup().

◆ ath5k_hw_get_txdp()

u32 ath5k_hw_get_txdp ( struct ath5k_hw * ah,
unsigned int queue )
extern

ath5k_hw_get_txdp - Get TX Descriptor's address for a specific queue

@ah: The &struct ath5k_hw @queue: The hw queue number

Get TX descriptor's address for a specific queue. For 5210 we ignore the queue number and use tx queue type since we only have 2 queues. We use TXDP0 for normal data queue and TXDP1 for beacon queue. For newer chips with QCU/DCU we just read the corresponding TXDP register.

XXX: Is TXDP read and clear ?

Definition at line 262 of file ath5k_dma.c.

263{
264 u16 tx_reg;
265
266 /*
267 * Get the transmit queue descriptor pointer from the selected queue
268 */
269 /*5210 doesn't have QCU*/
270 if (ah->ah_version == AR5K_AR5210) {
271 /* Assume a data queue */
272 tx_reg = AR5K_NOQCU_TXDP0;
273 } else {
274 tx_reg = AR5K_QUEUE_TXDP(queue);
275 }
276
277 return ath5k_hw_reg_read(ah, tx_reg);
278}
#define AR5K_NOQCU_TXDP0
Definition reg.h:49
#define AR5K_QUEUE_TXDP(_q)
Definition reg.h:554
#define u16
Definition vga.h:20

References ah, AR5K_AR5210, AR5K_NOQCU_TXDP0, AR5K_QUEUE_TXDP, ath5k_hw_reg_read(), queue, u16, and u32.

Referenced by ath5k_txq_cleanup().

◆ ath5k_hw_set_txdp()

int ath5k_hw_set_txdp ( struct ath5k_hw * ah,
unsigned int queue,
u32 phys_addr )
extern

ath5k_hw_set_txdp - Set TX Descriptor's address for a specific queue

@ah: The &struct ath5k_hw @queue: The hw queue number

Set TX descriptor's address for a specific queue. For 5210 we ignore the queue number and we use tx queue type since we only have 2 queues so as above we use TXDP0 for normal data queue and TXDP1 for beacon queue. For newer chips with QCU/DCU we just set the corresponding TXDP register. Returns -EINVAL if queue type is invalid for 5210 and -EIO if queue is still active.

Definition at line 293 of file ath5k_dma.c.

294{
295 u16 tx_reg;
296
297 /*
298 * Set the transmit queue descriptor pointer register by type
299 * on 5210
300 */
301 if (ah->ah_version == AR5K_AR5210) {
302 /* Assume a data queue */
303 tx_reg = AR5K_NOQCU_TXDP0;
304 } else {
305 /*
306 * Set the transmit queue descriptor pointer for
307 * the selected queue on QCU for 5211+
308 * (this won't work if the queue is still active)
309 */
311 return -EIO;
312
313 tx_reg = AR5K_QUEUE_TXDP(queue);
314 }
315
316 /* Set descriptor pointer */
317 ath5k_hw_reg_write(ah, phys_addr, tx_reg);
318
319 return 0;
320}

References ah, AR5K_AR5210, AR5K_NOQCU_TXDP0, AR5K_QCU_TXE, AR5K_QUEUE_TXDP, AR5K_REG_READ_Q, ath5k_hw_reg_write(), EIO, queue, u16, and u32.

Referenced by ath5k_txbuf_setup().

◆ ath5k_hw_update_tx_triglevel()

int ath5k_hw_update_tx_triglevel ( struct ath5k_hw * ah,
int increase )
extern

ath5k_hw_update_tx_triglevel - Update tx trigger level

@ah: The &struct ath5k_hw @increase: Flag to force increase of trigger level

This function increases/decreases the tx trigger level for the tx fifo buffer (aka FIFO threshold) that is used to indicate when PCU flushes the buffer and transmits it's data. Lowering this results sending small frames more quickly but can lead to tx underruns, raising it a lot can result other problems (i think bmiss is related). Right now we start with the lowest possible (64Bytes) and if we get tx underrun we increase it using the increase flag. Returns -EIO if we have have reached maximum/minimum.

XXX: Link this with tx DMA size ? XXX: Use it to save interrupts ? TODO: Needs testing, i think it's related to bmiss...

Definition at line 340 of file ath5k_dma.c.

341{
342 u32 trigger_level, imr;
343 int ret = -EIO;
344
345 /*
346 * Disable interrupts by setting the mask
347 */
349
350 trigger_level = AR5K_REG_MS(ath5k_hw_reg_read(ah, AR5K_TXCFG),
352
353 if (!increase) {
354 if (--trigger_level < AR5K_TUNE_MIN_TX_FIFO_THRES)
355 goto done;
356 } else
357 trigger_level +=
358 ((AR5K_TUNE_MAX_TX_FIFO_THRES - trigger_level) / 2);
359
360 /*
361 * Update trigger level on success
362 */
363 if (ah->ah_version == AR5K_AR5210)
364 ath5k_hw_reg_write(ah, trigger_level, AR5K_TRIG_LVL);
365 else
367 AR5K_TXCFG_TXFULL, trigger_level);
368
369 ret = 0;
370
371done:
372 /*
373 * Restore interrupt mask
374 */
376
377 return ret;
378}
#define AR5K_TRIG_LVL
Definition reg.h:1376
#define AR5K_TXCFG_TXFULL
Definition reg.h:176
#define AR5K_TUNE_MAX_TX_FIFO_THRES
Definition ath5k.h:170
#define AR5K_TUNE_MIN_TX_FIFO_THRES
Definition ath5k.h:169
enum ath5k_int ath5k_hw_set_imr(struct ath5k_hw *ah, enum ath5k_int new_mask)
ath5k_hw_set_imr - Set interrupt mask
Definition ath5k_dma.c:549
struct bofm_section_header done
Definition bofm_test.c:46
@ imr
Definition sis900.h:27

References ah, AR5K_AR5210, AR5K_INT_GLOBAL, AR5K_REG_MS, AR5K_REG_WRITE_BITS, AR5K_TRIG_LVL, AR5K_TUNE_MAX_TX_FIFO_THRES, AR5K_TUNE_MIN_TX_FIFO_THRES, AR5K_TXCFG, AR5K_TXCFG_TXFULL, ath5k_hw_reg_read(), ath5k_hw_reg_write(), ath5k_hw_set_imr(), done, EIO, imr, and u32.

Referenced by ath5k_poll().

◆ ath5k_hw_is_intr_pending()

int ath5k_hw_is_intr_pending ( struct ath5k_hw * ah)
extern

ath5k_hw_is_intr_pending - Check if we have pending interrupts

@ah: The &struct ath5k_hw

Check if we have pending interrupts to process. Returns 1 if we have pending interrupts and 0 if we haven't.

Definition at line 392 of file ath5k_dma.c.

393{
394 return ath5k_hw_reg_read(ah, AR5K_INTPEND) == 1 ? 1 : 0;
395}
#define AR5K_INTPEND
Definition reg.h:864

References ah, AR5K_INTPEND, and ath5k_hw_reg_read().

Referenced by ath5k_poll().

◆ ath5k_hw_get_isr()

int ath5k_hw_get_isr ( struct ath5k_hw * ah,
enum ath5k_int * interrupt_mask )
extern

Definition at line 413 of file ath5k_dma.c.

414{
415 u32 data;
416
417 /*
418 * Read interrupt status from the Interrupt Status register
419 * on 5210
420 */
421 if (ah->ah_version == AR5K_AR5210) {
423 if (data == AR5K_INT_NOCARD) {
424 *interrupt_mask = data;
425 return -ENODEV;
426 }
427 } else {
428 /*
429 * Read interrupt status from Interrupt
430 * Status Register shadow copy (Read And Clear)
431 *
432 * Note: PISR/SISR Not available on 5210
433 */
435 if (data == AR5K_INT_NOCARD) {
436 *interrupt_mask = data;
437 return -ENODEV;
438 }
439 }
440
441 /*
442 * Get abstract interrupt mask (driver-compatible)
443 */
444 *interrupt_mask = (data & AR5K_INT_COMMON) & ah->ah_imr;
445
446 if (ah->ah_version != AR5K_AR5210) {
448
449 /*HIU = Host Interface Unit (PCI etc)*/
450 if (data & (AR5K_ISR_HIUERR))
451 *interrupt_mask |= AR5K_INT_FATAL;
452
453 /*Beacon Not Ready*/
454 if (data & (AR5K_ISR_BNR))
455 *interrupt_mask |= AR5K_INT_BNR;
456
457 if (sisr2 & (AR5K_SISR2_SSERR | AR5K_SISR2_DPERR |
459 *interrupt_mask |= AR5K_INT_FATAL;
460
461 if (data & AR5K_ISR_TIM)
462 *interrupt_mask |= AR5K_INT_TIM;
463
464 if (data & AR5K_ISR_BCNMISC) {
465 if (sisr2 & AR5K_SISR2_TIM)
466 *interrupt_mask |= AR5K_INT_TIM;
467 if (sisr2 & AR5K_SISR2_DTIM)
468 *interrupt_mask |= AR5K_INT_DTIM;
469 if (sisr2 & AR5K_SISR2_DTIM_SYNC)
470 *interrupt_mask |= AR5K_INT_DTIM_SYNC;
471 if (sisr2 & AR5K_SISR2_BCN_TIMEOUT)
472 *interrupt_mask |= AR5K_INT_BCN_TIMEOUT;
473 if (sisr2 & AR5K_SISR2_CAB_TIMEOUT)
474 *interrupt_mask |= AR5K_INT_CAB_TIMEOUT;
475 }
476
478 *interrupt_mask |= AR5K_INT_RX_DOPPLER;
479 if (data & AR5K_ISR_QCBRORN) {
480 *interrupt_mask |= AR5K_INT_QCBRORN;
481 ah->ah_txq_isr |= AR5K_REG_MS(
484 }
485 if (data & AR5K_ISR_QCBRURN) {
486 *interrupt_mask |= AR5K_INT_QCBRURN;
487 ah->ah_txq_isr |= AR5K_REG_MS(
490 }
491 if (data & AR5K_ISR_QTRIG) {
492 *interrupt_mask |= AR5K_INT_QTRIG;
493 ah->ah_txq_isr |= AR5K_REG_MS(
496 }
497
498 if (data & AR5K_ISR_TXOK)
499 ah->ah_txq_isr |= AR5K_REG_MS(
502
503 if (data & AR5K_ISR_TXDESC)
504 ah->ah_txq_isr |= AR5K_REG_MS(
507
508 if (data & AR5K_ISR_TXERR)
509 ah->ah_txq_isr |= AR5K_REG_MS(
512
513 if (data & AR5K_ISR_TXEOL)
514 ah->ah_txq_isr |= AR5K_REG_MS(
517
518 if (data & AR5K_ISR_TXURN)
519 ah->ah_txq_isr |= AR5K_REG_MS(
522 } else {
525 *interrupt_mask |= AR5K_INT_FATAL;
526
527 /*
528 * XXX: BMISS interrupts may occur after association.
529 * I found this on 5210 code but it needs testing. If this is
530 * true we should disable them before assoc and re-enable them
531 * after a successful assoc + some jiffies.
532 interrupt_mask &= ~AR5K_INT_BMISS;
533 */
534 }
535
536 return 0;
537}
#define AR5K_ISR_TXEOL
Definition reg.h:299
#define AR5K_ISR_TXOK
Definition reg.h:295
#define AR5K_ISR_RXDOPPLER
Definition reg.h:314
#define AR5K_RAC_PISR
Definition reg.h:367
#define AR5K_SISR4_QTRIG
Definition reg.h:361
#define AR5K_SISR2_DTIM
Definition reg.h:351
#define AR5K_SISR2_DPERR
Definition reg.h:345
#define AR5K_ISR_BNR
Definition reg.h:309
#define AR5K_ISR_DPERR
Definition reg.h:313
#define AR5K_ISR_TXDESC
Definition reg.h:296
#define AR5K_ISR_BCNMISC
Definition reg.h:316
#define AR5K_ISR_TXURN
Definition reg.h:300
#define AR5K_SISR1_QCU_TXERR
Definition reg.h:335
#define AR5K_RAC_SISR2
Definition reg.h:370
#define AR5K_SISR1_QCU_TXEOL
Definition reg.h:337
#define AR5K_ISR_MCABT
Definition reg.h:310
#define AR5K_RAC_SISR4
Definition reg.h:372
#define AR5K_SISR2_QCU_TXURN
Definition reg.h:341
#define AR5K_SISR2_TIM
Definition reg.h:346
#define AR5K_ISR_TIM
Definition reg.h:315
#define AR5K_SISR0_QCU_TXDESC
Definition reg.h:331
#define AR5K_ISR_HIUERR
Definition reg.h:308
#define AR5K_ISR_TXERR
Definition reg.h:297
#define AR5K_SISR3_QCBRORN
Definition reg.h:355
#define AR5K_ISR_QCBRURN
Definition reg.h:319
#define AR5K_ISR_QCBRORN
Definition reg.h:318
#define AR5K_RAC_SISR1
Definition reg.h:369
#define AR5K_SISR3_QCBRURN
Definition reg.h:357
#define AR5K_ISR_SSERR
Definition reg.h:312
#define AR5K_SISR2_DTIM_SYNC
Definition reg.h:348
#define AR5K_SISR0_QCU_TXOK
Definition reg.h:329
#define AR5K_SISR2_MCABT
Definition reg.h:343
#define AR5K_SISR2_SSERR
Definition reg.h:344
#define AR5K_SISR2_BCN_TIMEOUT
Definition reg.h:349
#define AR5K_ISR
Definition reg.h:287
#define AR5K_ISR_QTRIG
Definition reg.h:320
#define AR5K_RAC_SISR3
Definition reg.h:371
#define AR5K_SISR2_CAB_TIMEOUT
Definition reg.h:350
#define AR5K_RAC_SISR0
Definition reg.h:368
uint8_t data[48]
Additional event data.
Definition ena.h:11
#define ENODEV
No such device.
Definition errno.h:510

References ah, AR5K_AR5210, AR5K_INT_BCN_TIMEOUT, AR5K_INT_BNR, AR5K_INT_CAB_TIMEOUT, AR5K_INT_COMMON, AR5K_INT_DTIM, AR5K_INT_DTIM_SYNC, AR5K_INT_FATAL, AR5K_INT_NOCARD, AR5K_INT_QCBRORN, AR5K_INT_QCBRURN, AR5K_INT_QTRIG, AR5K_INT_RX_DOPPLER, AR5K_INT_TIM, AR5K_ISR, AR5K_ISR_BCNMISC, AR5K_ISR_BNR, AR5K_ISR_DPERR, AR5K_ISR_HIUERR, AR5K_ISR_MCABT, AR5K_ISR_QCBRORN, AR5K_ISR_QCBRURN, AR5K_ISR_QTRIG, AR5K_ISR_RXDOPPLER, AR5K_ISR_SSERR, AR5K_ISR_TIM, AR5K_ISR_TXDESC, AR5K_ISR_TXEOL, AR5K_ISR_TXERR, AR5K_ISR_TXOK, AR5K_ISR_TXURN, AR5K_RAC_PISR, AR5K_RAC_SISR0, AR5K_RAC_SISR1, AR5K_RAC_SISR2, AR5K_RAC_SISR3, AR5K_RAC_SISR4, AR5K_REG_MS, AR5K_SISR0_QCU_TXDESC, AR5K_SISR0_QCU_TXOK, AR5K_SISR1_QCU_TXEOL, AR5K_SISR1_QCU_TXERR, AR5K_SISR2_BCN_TIMEOUT, AR5K_SISR2_CAB_TIMEOUT, AR5K_SISR2_DPERR, AR5K_SISR2_DTIM, AR5K_SISR2_DTIM_SYNC, AR5K_SISR2_MCABT, AR5K_SISR2_QCU_TXURN, AR5K_SISR2_SSERR, AR5K_SISR2_TIM, AR5K_SISR3_QCBRORN, AR5K_SISR3_QCBRURN, AR5K_SISR4_QTRIG, ath5k_hw_reg_read(), data, ENODEV, and u32.

Referenced by ath5k_poll().

◆ ath5k_hw_set_imr()

enum ath5k_int ath5k_hw_set_imr ( struct ath5k_hw * ah,
enum ath5k_int new_mask )
extern

ath5k_hw_set_imr - Set interrupt mask

@ah: The &struct ath5k_hw @new_mask: The new interrupt mask to be set

Set the interrupt mask in hw to save interrupts. We do that by mapping ath5k_int bits to hw-specific bits to remove abstraction and writing Interrupt Mask Register.

Definition at line 549 of file ath5k_dma.c.

550{
551 enum ath5k_int old_mask, int_mask;
552
553 old_mask = ah->ah_imr;
554
555 /*
556 * Disable card interrupts to prevent any race conditions
557 * (they will be re-enabled afterwards if AR5K_INT GLOBAL
558 * is set again on the new mask).
559 */
560 if (old_mask & AR5K_INT_GLOBAL) {
563 }
564
565 /*
566 * Add additional, chipset-dependent interrupt mask flags
567 * and write them to the IMR (interrupt mask register).
568 */
569 int_mask = new_mask & AR5K_INT_COMMON;
570
571 if (ah->ah_version != AR5K_AR5210) {
572 /* Preserve per queue TXURN interrupt mask */
575
576 if (new_mask & AR5K_INT_FATAL) {
577 int_mask |= AR5K_IMR_HIUERR;
580 }
581
582 /*Beacon Not Ready*/
583 if (new_mask & AR5K_INT_BNR)
584 int_mask |= AR5K_INT_BNR;
585
586 if (new_mask & AR5K_INT_TIM)
587 int_mask |= AR5K_IMR_TIM;
588
589 if (new_mask & AR5K_INT_TIM)
590 simr2 |= AR5K_SISR2_TIM;
591 if (new_mask & AR5K_INT_DTIM)
592 simr2 |= AR5K_SISR2_DTIM;
593 if (new_mask & AR5K_INT_DTIM_SYNC)
594 simr2 |= AR5K_SISR2_DTIM_SYNC;
595 if (new_mask & AR5K_INT_BCN_TIMEOUT)
596 simr2 |= AR5K_SISR2_BCN_TIMEOUT;
597 if (new_mask & AR5K_INT_CAB_TIMEOUT)
598 simr2 |= AR5K_SISR2_CAB_TIMEOUT;
599
600 if (new_mask & AR5K_INT_RX_DOPPLER)
601 int_mask |= AR5K_IMR_RXDOPPLER;
602
603 /* Note: Per queue interrupt masks
604 * are set via reset_tx_queue (qcu.c) */
605 ath5k_hw_reg_write(ah, int_mask, AR5K_PIMR);
607
608 } else {
609 if (new_mask & AR5K_INT_FATAL)
610 int_mask |= (AR5K_IMR_SSERR | AR5K_IMR_MCABT
612
613 ath5k_hw_reg_write(ah, int_mask, AR5K_IMR);
614 }
615
616 /* If RXNOFRM interrupt is masked disable it
617 * by setting AR5K_RXNOFRM to zero */
618 if (!(new_mask & AR5K_INT_RXNOFRM))
620
621 /* Store new interrupt mask */
622 ah->ah_imr = new_mask;
623
624 /* ..re-enable interrupts if AR5K_INT_GLOBAL is set */
625 if (new_mask & AR5K_INT_GLOBAL) {
626 ath5k_hw_reg_write(ah, ah->ah_ier, AR5K_IER);
628 }
629
630 return old_mask;
631}
#define AR5K_IMR_DPERR
Definition reg.h:406
#define AR5K_IMR_SSERR
Definition reg.h:405
#define AR5K_IMR
Definition reg.h:380
#define AR5K_IER_DISABLE
Definition reg.h:93
#define AR5K_SIMR2_QCU_TXURN
Definition reg.h:431
#define AR5K_SIMR2_DPERR
Definition reg.h:435
#define AR5K_SIMR2_SSERR
Definition reg.h:434
#define AR5K_RXNOFRM
Definition reg.h:231
#define AR5K_IMR_RXDOPPLER
Definition reg.h:407
#define AR5K_SIMR2
Definition reg.h:430
#define AR5K_IMR_TIM
Definition reg.h:408
#define AR5K_IMR_MCABT
Definition reg.h:403
#define AR5K_IER
Definition reg.h:92
#define AR5K_PIMR
Definition reg.h:381
#define AR5K_IMR_HIUERR
Definition reg.h:401
#define AR5K_SIMR2_MCABT
Definition reg.h:433
ath5k_int
enum ath5k_int - Hardware interrupt masks helpers
Definition ath5k.h:806

References ah, AR5K_AR5210, AR5K_IER, AR5K_IER_DISABLE, AR5K_IMR, AR5K_IMR_DPERR, AR5K_IMR_HIUERR, AR5K_IMR_MCABT, AR5K_IMR_RXDOPPLER, AR5K_IMR_SSERR, AR5K_IMR_TIM, AR5K_INT_BCN_TIMEOUT, AR5K_INT_BNR, AR5K_INT_CAB_TIMEOUT, AR5K_INT_COMMON, AR5K_INT_DTIM, AR5K_INT_DTIM_SYNC, AR5K_INT_FATAL, AR5K_INT_GLOBAL, AR5K_INT_RX_DOPPLER, AR5K_INT_RXNOFRM, AR5K_INT_TIM, AR5K_PIMR, AR5K_RXNOFRM, AR5K_SIMR2, AR5K_SIMR2_DPERR, AR5K_SIMR2_MCABT, AR5K_SIMR2_QCU_TXURN, AR5K_SIMR2_SSERR, AR5K_SISR2_BCN_TIMEOUT, AR5K_SISR2_CAB_TIMEOUT, AR5K_SISR2_DTIM, AR5K_SISR2_DTIM_SYNC, AR5K_SISR2_TIM, ath5k_hw_reg_read(), ath5k_hw_reg_write(), and u32.

Referenced by ath5k_hw_reset(), ath5k_hw_update_tx_triglevel(), ath5k_irq(), ath5k_reset(), and ath5k_stop_hw().

◆ ath5k_eeprom_init()

int ath5k_eeprom_init ( struct ath5k_hw * ah)
extern

Definition at line 1698 of file ath5k_eeprom.c.

1699{
1700 int err;
1701
1703 if (err < 0)
1704 return err;
1705
1707 if (err < 0)
1708 return err;
1709
1711 if (err < 0)
1712 return err;
1713
1715 if (err < 0)
1716 return err;
1717
1718 return 0;
1719}
static int ath5k_eeprom_read_pcal_info(struct ath5k_hw *ah)
static int ath5k_eeprom_init_header(struct ath5k_hw *ah)
static int ath5k_eeprom_read_ctl_info(struct ath5k_hw *ah)
static int ath5k_eeprom_init_modes(struct ath5k_hw *ah)

References ah, ath5k_eeprom_init_header(), ath5k_eeprom_init_modes(), ath5k_eeprom_read_ctl_info(), and ath5k_eeprom_read_pcal_info().

Referenced by ath5k_hw_attach().

◆ ath5k_eeprom_detach()

void ath5k_eeprom_detach ( struct ath5k_hw * ah)
extern

Definition at line 1577 of file ath5k_eeprom.c.

1578{
1579 u8 mode;
1580
1583}
static int ath5k_eeprom_free_pcal_info(struct ath5k_hw *ah, int mode)

References ah, AR5K_EEPROM_MODE_11A, AR5K_EEPROM_MODE_11G, ath5k_eeprom_free_pcal_info(), mode, and u8.

Referenced by ath5k_hw_detach().

◆ ath5k_eeprom_read_mac()

int ath5k_eeprom_read_mac ( struct ath5k_hw * ah,
u8 * mac )
extern

Definition at line 1724 of file ath5k_eeprom.c.

1725{
1726 u8 mac_d[ETH_ALEN] = {};
1727 u32 total, offset;
1728 u16 data;
1729 int octet, ret;
1730
1731 ret = ath5k_hw_eeprom_read(ah, 0x20, &data);
1732 if (ret)
1733 return ret;
1734
1735 for (offset = 0x1f, octet = 0, total = 0; offset >= 0x1d; offset--) {
1737 if (ret)
1738 return ret;
1739
1740 total += data;
1741 mac_d[octet + 1] = data & 0xff;
1742 mac_d[octet] = data >> 8;
1743 octet += 2;
1744 }
1745
1746 if (!total || total == 3 * 0xffff)
1747 return -EINVAL;
1748
1749 memcpy(mac, mac_d, ETH_ALEN);
1750
1751 return 0;
1752}
static int ath5k_hw_eeprom_read(struct ath5k_hw *ah, u32 offset, u16 *data)
uint16_t offset
Offset to command line.
Definition bzimage.h:3
uint8_t mac[ETH_ALEN]
MAC address.
Definition ena.h:13
void * memcpy(void *dest, const void *src, size_t len) __nonnull

References ah, ath5k_hw_eeprom_read(), data, EINVAL, ETH_ALEN, mac, memcpy(), offset, u16, u32, and u8.

Referenced by ath5k_attach().

◆ ath5k_eeprom_is_hb63()

int ath5k_eeprom_is_hb63 ( struct ath5k_hw * ah)
extern

Definition at line 1754 of file ath5k_eeprom.c.

1755{
1756 u16 data;
1757
1759
1760 if ((ah->ah_mac_version == (AR5K_SREV_AR2425 >> 4)) && data)
1761 return 1;
1762 else
1763 return 0;
1764}
#define AR5K_EEPROM_IS_HB63
Definition eeprom.h:30

References ah, AR5K_EEPROM_IS_HB63, AR5K_SREV_AR2425, ath5k_hw_eeprom_read(), data, and u16.

Referenced by ath5k_hw_tweak_initval_settings().

◆ ath5k_hw_set_opmode()

int ath5k_hw_set_opmode ( struct ath5k_hw * ah)
extern

ath5k_hw_set_opmode - Set PCU operating mode

@ah: The &struct ath5k_hw

Initialize PCU for the various operating modes (AP/STA etc)

For iPXE we always assume STA mode.

Definition at line 49 of file ath5k_pcu.c.

50{
51 u32 pcu_reg, beacon_reg, low_id, high_id;
52
53
54 /* Preserve rest settings */
55 pcu_reg = ath5k_hw_reg_read(ah, AR5K_STA_ID1) & 0xffff0000;
58 | (ah->ah_version == AR5K_AR5210 ?
60
61 beacon_reg = 0;
62
64 | (ah->ah_version == AR5K_AR5210 ?
66
67 /*
68 * Set PCU registers
69 */
70 low_id = AR5K_LOW_ID(ah->ah_sta_id);
71 high_id = AR5K_HIGH_ID(ah->ah_sta_id);
73 ath5k_hw_reg_write(ah, pcu_reg | high_id, AR5K_STA_ID1);
74
75 /*
76 * Set Beacon Control Register on 5210
77 */
78 if (ah->ah_version == AR5K_AR5210)
79 ath5k_hw_reg_write(ah, beacon_reg, AR5K_BCR);
80
81 return 0;
82}
#define AR5K_BCR
Definition reg.h:105
#define AR5K_STA_ID1_KEYSRCH_MODE
Definition reg.h:1141
#define AR5K_STA_ID1_NO_PSPOLL
Definition reg.h:1129
#define AR5K_STA_ID1_ADHOC
Definition reg.h:1126
#define AR5K_STA_ID1_PWR_SV
Definition reg.h:1127
#define AR5K_STA_ID1_AP
Definition reg.h:1125

References ah, AR5K_AR5210, AR5K_BCR, AR5K_HIGH_ID, AR5K_LOW_ID, AR5K_STA_ID0, AR5K_STA_ID1, AR5K_STA_ID1_ADHOC, AR5K_STA_ID1_AP, AR5K_STA_ID1_KEYSRCH_MODE, AR5K_STA_ID1_NO_PSPOLL, AR5K_STA_ID1_PWR_SV, ath5k_hw_reg_read(), ath5k_hw_reg_write(), and u32.

Referenced by ath5k_hw_attach(), ath5k_hw_reset(), and ath5k_mode_setup().

◆ ath5k_hw_get_lladdr()

void ath5k_hw_get_lladdr ( struct ath5k_hw * ah,
u8 * mac )
extern

ath5k_hw_get_lladdr - Get station id

@ah: The &struct ath5k_hw @mac: The card's mac address

Initialize ah->ah_sta_id using the mac address provided (just a memcpy).

TODO: Remove it once we merge ath5k_softc and ath5k_hw

Definition at line 188 of file ath5k_pcu.c.

189{
190 memcpy(mac, ah->ah_sta_id, ETH_ALEN);
191}

References ah, ETH_ALEN, mac, memcpy(), and u8.

◆ ath5k_hw_set_lladdr()

int ath5k_hw_set_lladdr ( struct ath5k_hw * ah,
const u8 * mac )
extern

ath5k_hw_set_lladdr - Set station id

@ah: The &struct ath5k_hw @mac: The card's mac address

Set station id on hw using the provided mac address

Definition at line 201 of file ath5k_pcu.c.

202{
203 u32 low_id, high_id;
204 u32 pcu_reg;
205
206 /* Set new station ID */
207 memcpy(ah->ah_sta_id, mac, ETH_ALEN);
208
209 pcu_reg = ath5k_hw_reg_read(ah, AR5K_STA_ID1) & 0xffff0000;
210
211 low_id = AR5K_LOW_ID(mac);
212 high_id = AR5K_HIGH_ID(mac);
213
215 ath5k_hw_reg_write(ah, pcu_reg | high_id, AR5K_STA_ID1);
216
217 return 0;
218}

References ah, AR5K_HIGH_ID, AR5K_LOW_ID, AR5K_STA_ID0, AR5K_STA_ID1, ath5k_hw_reg_read(), ath5k_hw_reg_write(), ETH_ALEN, mac, memcpy(), u32, and u8.

Referenced by ath5k_start(), and ath5k_stop().

◆ ath5k_hw_set_associd()

void ath5k_hw_set_associd ( struct ath5k_hw * ah,
const u8 * bssid,
u16 assoc_id )
extern

ath5k_hw_set_associd - Set BSSID for association

@ah: The &struct ath5k_hw @bssid: BSSID @assoc_id: Assoc id

Sets the BSSID which trigers the "SME Join" operation

Definition at line 229 of file ath5k_pcu.c.

230{
231 u32 low_id, high_id;
232
233 /*
234 * Set simple BSSID mask on 5212
235 */
236 if (ah->ah_version == AR5K_AR5212) {
237 ath5k_hw_reg_write(ah, AR5K_LOW_ID(ah->ah_bssid_mask),
239 ath5k_hw_reg_write(ah, AR5K_HIGH_ID(ah->ah_bssid_mask),
241 }
242
243 /*
244 * Set BSSID which triggers the "SME Join" operation
245 */
246 low_id = AR5K_LOW_ID(bssid);
247 high_id = AR5K_HIGH_ID(bssid);
249 ath5k_hw_reg_write(ah, high_id | ((assoc_id & 0x3fff) <<
251}
#define AR5K_BSS_IDM0
Definition reg.h:1645
#define AR5K_BSS_IDM1
Definition reg.h:1646
#define AR5K_BSS_ID0
Definition reg.h:1149
#define AR5K_BSS_ID1
Definition reg.h:1156
#define AR5K_BSS_ID1_AID_S
Definition reg.h:1158

References ah, AR5K_AR5212, AR5K_BSS_ID0, AR5K_BSS_ID1, AR5K_BSS_ID1_AID_S, AR5K_BSS_IDM0, AR5K_BSS_IDM1, AR5K_HIGH_ID, AR5K_LOW_ID, ath5k_hw_reg_write(), u16, u32, and u8.

Referenced by ath5k_config(), ath5k_hw_attach(), and ath5k_hw_reset().

◆ ath5k_hw_set_bssid_mask()

int ath5k_hw_set_bssid_mask ( struct ath5k_hw * ah,
const u8 * mask )
extern

ath5k_hw_set_bssid_mask - filter out bssids we listen

@ah: the &struct ath5k_hw @mask: the bssid_mask, a u8 array of size ETH_ALEN

BSSID masking is a method used by AR5212 and newer hardware to inform PCU which bits of the interface's MAC address should be looked at when trying to decide which packets to ACK. In station mode and AP mode with a single BSS every bit matters since we lock to only one BSS. In AP mode with multiple BSSes (virtual interfaces) not every bit matters because hw must accept frames for all BSSes and so we tweak some bits of our mac address in order to have multiple BSSes.

NOTE: This is a simple filter and does not filter out all relevant frames. Some frames that are not for us might get ACKed from us by PCU because they just match the mask.

When handling multiple BSSes you can get the BSSID mask by computing the set of ~ ( MAC XOR BSSID ) for all bssids we handle.

When you do this you are essentially computing the common bits of all your BSSes. Later it is assumed the harware will "and" (&) the BSSID mask with the MAC address to obtain the relevant bits and compare the result with (frame's BSSID & mask) to see if they match.

Definition at line 349 of file ath5k_pcu.c.

350{
351 u32 low_id, high_id;
352
353 /* Cache bssid mask so that we can restore it
354 * on reset */
355 memcpy(ah->ah_bssid_mask, mask, ETH_ALEN);
356 if (ah->ah_version == AR5K_AR5212) {
357 low_id = AR5K_LOW_ID(mask);
358 high_id = AR5K_HIGH_ID(mask);
359
362
363 return 0;
364 }
365
366 return -EIO;
367}

References ah, AR5K_AR5212, AR5K_BSS_IDM0, AR5K_BSS_IDM1, AR5K_HIGH_ID, AR5K_LOW_ID, ath5k_hw_reg_write(), EIO, ETH_ALEN, memcpy(), u32, and u8.

Referenced by ath5k_attach(), and ath5k_mode_setup().

◆ ath5k_hw_start_rx_pcu()

void ath5k_hw_start_rx_pcu ( struct ath5k_hw * ah)
extern

ath5k_hw_start_rx_pcu - Start RX engine

@ah: The &struct ath5k_hw

Starts RX engine on PCU so that hw can process RXed frames (ACK etc).

NOTE: RX DMA should be already enabled using ath5k_hw_start_rx_dma TODO: Init ANI here

Definition at line 385 of file ath5k_pcu.c.

386{
388}
#define AR5K_DIAG_SW_DIS_RX
Definition reg.h:1397
#define AR5K_DIAG_SW
Definition reg.h:1387

References ah, AR5K_DIAG_SW, AR5K_DIAG_SW_DIS_RX, and AR5K_REG_DISABLE_BITS.

Referenced by ath5k_rx_start().

◆ ath5k_hw_stop_rx_pcu()

void ath5k_hw_stop_rx_pcu ( struct ath5k_hw * ah)
extern

at5k_hw_stop_rx_pcu - Stop RX engine

@ah: The &struct ath5k_hw

Stops RX engine on PCU

TODO: Detach ANI here

Definition at line 399 of file ath5k_pcu.c.

References ah, AR5K_DIAG_SW, AR5K_DIAG_SW_DIS_RX, and AR5K_REG_ENABLE_BITS.

Referenced by ath5k_rx_stop().

◆ ath5k_hw_set_mcast_filter()

void ath5k_hw_set_mcast_filter ( struct ath5k_hw * ah,
u32 filter0,
u32 filter1 )
extern

Definition at line 407 of file ath5k_pcu.c.

408{
409 /* Set the multicat filter */
412}
#define AR5K_MCAST_FILTER0
Definition reg.h:1346
#define AR5K_MCAST_FILTER1
Definition reg.h:1354

References ah, AR5K_MCAST_FILTER0, AR5K_MCAST_FILTER1, ath5k_hw_reg_write(), and u32.

Referenced by ath5k_configure_filter(), and ath5k_mode_setup().

◆ ath5k_hw_get_rx_filter()

u32 ath5k_hw_get_rx_filter ( struct ath5k_hw * ah)
extern

ath5k_hw_get_rx_filter - Get current rx filter

@ah: The &struct ath5k_hw

Returns the RX filter by reading rx filter and phy error filter registers. RX filter is used to set the allowed frame types that PCU will accept and pass to the driver. For a list of frame types check out reg.h.

Definition at line 425 of file ath5k_pcu.c.

426{
427 u32 data, filter = 0;
428
430
431 /*Radar detection for 5212*/
432 if (ah->ah_version == AR5K_AR5212) {
434
439 }
440
441 return filter;
442}
#define AR5K_RX_FILTER_RADARERR
Definition reg.h:1337
#define AR5K_RX_FILTER
Definition reg.h:1320
#define AR5K_PHY_ERR_FIL_CCK
Definition reg.h:1711
#define AR5K_RX_FILTER_PHYERR
Definition reg.h:1334
#define AR5K_PHY_ERR_FIL_OFDM
Definition reg.h:1710
#define AR5K_PHY_ERR_FIL_RADAR
Definition reg.h:1709
#define AR5K_PHY_ERR_FIL
Definition reg.h:1708
UINT8_t filter
Receive packet filter.
Definition pxe_api.h:11

References ah, AR5K_AR5212, AR5K_PHY_ERR_FIL, AR5K_PHY_ERR_FIL_CCK, AR5K_PHY_ERR_FIL_OFDM, AR5K_PHY_ERR_FIL_RADAR, AR5K_RX_FILTER, AR5K_RX_FILTER_PHYERR, AR5K_RX_FILTER_RADARERR, ath5k_hw_reg_read(), data, filter, and u32.

◆ ath5k_hw_set_rx_filter()

void ath5k_hw_set_rx_filter ( struct ath5k_hw * ah,
u32 filter )
extern

ath5k_hw_set_rx_filter - Set rx filter

@ah: The &struct ath5k_hw @filter: RX filter mask (see reg.h)

Sets RX filter register and also handles PHY error filter register on 5212 and newer chips so that we have proper PHY error reporting.

Definition at line 454 of file ath5k_pcu.c.

455{
456 u32 data = 0;
457
458 /* Set PHY error filter register on 5212*/
459 if (ah->ah_version == AR5K_AR5212) {
464 }
465
466 /*
467 * The AR5210 uses promiscous mode to detect radar activity
468 */
469 if (ah->ah_version == AR5K_AR5210 &&
473 }
474
475 /*Zero length DMA (phy error reporting) */
476 if (data)
478 else
480
481 /*Write RX Filter register*/
483
484 /*Write PHY error filter register on 5212*/
485 if (ah->ah_version == AR5K_AR5212)
487
488}
#define AR5K_RX_FILTER_PROM
Definition reg.h:1327
#define AR5K_RXCFG_ZLFDMA
Definition reg.h:201

References ah, AR5K_AR5210, AR5K_AR5212, AR5K_PHY_ERR_FIL, AR5K_PHY_ERR_FIL_CCK, AR5K_PHY_ERR_FIL_OFDM, AR5K_PHY_ERR_FIL_RADAR, AR5K_REG_DISABLE_BITS, AR5K_REG_ENABLE_BITS, AR5K_RX_FILTER, AR5K_RX_FILTER_PHYERR, AR5K_RX_FILTER_PROM, AR5K_RX_FILTER_RADARERR, AR5K_RXCFG, AR5K_RXCFG_ZLFDMA, ath5k_hw_reg_write(), data, filter, and u32.

Referenced by ath5k_configure_filter(), ath5k_mode_setup(), and ath5k_rx_stop().

◆ ath5k_hw_set_ack_bitrate_high()

void ath5k_hw_set_ack_bitrate_high ( struct ath5k_hw * ah,
int high )

ath5k_hw_set_ack_bitrate - set bitrate for ACKs

@ah: The &struct ath5k_hw @high: Flag to determine if we want to use high transmition rate for ACKs or not

If high flag is set, we tell hw to use a set of control rates based on the current transmition rate (check out control_rates array inside reset.c). If not hw just uses the lowest rate available for the current modulation scheme being used (1Mbit for CCK and 6Mbits for OFDM).

Definition at line 96 of file ath5k_pcu.c.

97{
98 if (ah->ah_version != AR5K_AR5212)
99 return;
100 else {
102 if (high)
104 else
106 }
107}
void __asmcall int val
Definition setjmp.h:12
uint32_t high
High 32 bits of address.
Definition myson.h:1

References ah, AR5K_AR5212, AR5K_REG_DISABLE_BITS, AR5K_REG_ENABLE_BITS, AR5K_STA_ID1, AR5K_STA_ID1_ACKCTS_6MB, AR5K_STA_ID1_BASE_RATE_11B, high, u32, and val.

Referenced by ath5k_init().

◆ ath5k_hw_set_ack_timeout()

int ath5k_hw_set_ack_timeout ( struct ath5k_hw * ah,
unsigned int timeout )
extern

ath5k_hw_set_ack_timeout - Set ACK timeout on PCU

@ah: The &struct ath5k_hw @timeout: Timeout in usec

Definition at line 131 of file ath5k_pcu.c.

132{
134 ah->ah_turbo) <= timeout)
135 return -EINVAL;
136
138 ath5k_hw_htoclock(timeout, ah->ah_turbo));
139
140 return 0;
141}
#define AR5K_TIME_OUT
Definition reg.h:1168
#define AR5K_TIME_OUT_ACK
Definition reg.h:1169
static unsigned int ath5k_hw_clocktoh(unsigned int clock, int turbo)
Definition ath5k.h:1208
static unsigned int ath5k_hw_htoclock(unsigned int usec, int turbo)
Definition ath5k.h:1199
void timeout(int)

References ah, AR5K_REG_MS, AR5K_REG_WRITE_BITS, AR5K_TIME_OUT, AR5K_TIME_OUT_ACK, ath5k_hw_clocktoh(), ath5k_hw_htoclock(), EINVAL, and timeout().

◆ ath5k_hw_get_ack_timeout()

unsigned int ath5k_hw_get_ack_timeout ( struct ath5k_hw * ah)
extern

ath5k_hw_het_ack_timeout - Get ACK timeout from PCU in usec

@ah: The &struct ath5k_hw

Definition at line 119 of file ath5k_pcu.c.

References ah, AR5K_REG_MS, AR5K_TIME_OUT, AR5K_TIME_OUT_ACK, ath5k_hw_clocktoh(), and ath5k_hw_reg_read().

◆ ath5k_hw_set_cts_timeout()

int ath5k_hw_set_cts_timeout ( struct ath5k_hw * ah,
unsigned int timeout )
extern

ath5k_hw_set_cts_timeout - Set CTS timeout on PCU

@ah: The &struct ath5k_hw @timeout: Timeout in usec

Definition at line 160 of file ath5k_pcu.c.

161{
163 ah->ah_turbo) <= timeout)
164 return -EINVAL;
165
167 ath5k_hw_htoclock(timeout, ah->ah_turbo));
168
169 return 0;
170}
#define AR5K_TIME_OUT_CTS
Definition reg.h:1171

References ah, AR5K_REG_MS, AR5K_REG_WRITE_BITS, AR5K_TIME_OUT, AR5K_TIME_OUT_CTS, ath5k_hw_clocktoh(), ath5k_hw_htoclock(), EINVAL, and timeout().

◆ ath5k_hw_get_cts_timeout()

unsigned int ath5k_hw_get_cts_timeout ( struct ath5k_hw * ah)
extern

ath5k_hw_get_cts_timeout - Get CTS timeout from PCU in usec

@ah: The &struct ath5k_hw

Definition at line 148 of file ath5k_pcu.c.

References ah, AR5K_REG_MS, AR5K_TIME_OUT, AR5K_TIME_OUT_CTS, ath5k_hw_clocktoh(), and ath5k_hw_reg_read().

◆ ath5k_hw_reset_key()

int ath5k_hw_reset_key ( struct ath5k_hw * ah,
u16 entry )
extern

Definition at line 497 of file ath5k_pcu.c.

498{
499 unsigned int i, type;
500 u16 micentry = entry + AR5K_KEYTABLE_MIC_OFFSET;
501
503
504 for (i = 0; i < AR5K_KEYCACHE_SIZE; i++)
506
507 /* Reset associated MIC entry if TKIP
508 * is enabled located at offset (entry + 64) */
510 for (i = 0; i < AR5K_KEYCACHE_SIZE / 2 ; i++)
512 AR5K_KEYTABLE_OFF(micentry, i));
513 }
514
515 /*
516 * Set NULL encryption on AR5212+
517 *
518 * Note: AR5K_KEYTABLE_TYPE -> AR5K_KEYTABLE_OFF(entry, 5)
519 * AR5K_KEYTABLE_TYPE_NULL -> 0x00000007
520 *
521 * Note2: Windows driver (ndiswrapper) sets this to
522 * 0x00000714 instead of 0x00000007
523 */
524 if (ah->ah_version >= AR5K_AR5211) {
526 AR5K_KEYTABLE_TYPE(entry));
527
530 AR5K_KEYTABLE_TYPE(micentry));
531 }
532 }
533
534 return 0;
535}
#define AR5K_KEYTABLE_TYPE(_n)
Definition reg.h:1815
#define AR5K_KEYTABLE_TYPE_TKIP
Definition reg.h:1819
#define AR5K_KEYTABLE_TYPE_NULL
Definition reg.h:1822
#define AR5K_KEYTABLE_MIC_OFFSET
Definition reg.h:1830
#define AR5K_KEYTABLE_OFF(_n, x)
Definition reg.h:1814
#define AR5K_KEYCACHE_SIZE
Definition ath5k.h:734
uint32_t type
Operating system type.
Definition ena.h:1

References ah, AR5K_AR5211, AR5K_KEYCACHE_SIZE, AR5K_KEYTABLE_MIC_OFFSET, AR5K_KEYTABLE_OFF, AR5K_KEYTABLE_TYPE, AR5K_KEYTABLE_TYPE_NULL, AR5K_KEYTABLE_TYPE_TKIP, ath5k_hw_reg_read(), ath5k_hw_reg_write(), type, and u16.

Referenced by ath5k_init().

◆ ath5k_hw_set_tx_queueprops()

int ath5k_hw_set_tx_queueprops ( struct ath5k_hw * ah,
const struct ath5k_txq_info * queue_info )
extern

Definition at line 35 of file ath5k_qcu.c.

37{
38 if (ah->ah_txq.tqi_type == AR5K_TX_QUEUE_INACTIVE)
39 return -EIO;
40
41 memcpy(&ah->ah_txq, queue_info, sizeof(struct ath5k_txq_info));
42
43 /*XXX: Is this supported on 5210 ?*/
44 if ((queue_info->tqi_type == AR5K_TX_QUEUE_DATA &&
45 ((queue_info->tqi_subtype == AR5K_WME_AC_VI) ||
46 (queue_info->tqi_subtype == AR5K_WME_AC_VO))) ||
47 queue_info->tqi_type == AR5K_TX_QUEUE_UAPSD)
48 ah->ah_txq.tqi_flags |= AR5K_TXQ_FLAG_POST_FR_BKOFF_DIS;
49
50 return 0;
51}
#define AR5K_TXQ_FLAG_POST_FR_BKOFF_DIS
Definition ath5k.h:502
enum ath5k_tx_queue tqi_type
Definition ath5k.h:509
enum ath5k_tx_queue_subtype tqi_subtype
Definition ath5k.h:510

References ah, AR5K_TX_QUEUE_DATA, AR5K_TX_QUEUE_INACTIVE, AR5K_TX_QUEUE_UAPSD, AR5K_TXQ_FLAG_POST_FR_BKOFF_DIS, AR5K_WME_AC_VI, AR5K_WME_AC_VO, EIO, memcpy(), ath5k_txq_info::tqi_subtype, and ath5k_txq_info::tqi_type.

Referenced by ath5k_hw_setup_tx_queue().

◆ ath5k_hw_setup_tx_queue()

int ath5k_hw_setup_tx_queue ( struct ath5k_hw * ah,
enum ath5k_tx_queue queue_type,
struct ath5k_txq_info * queue_info )
extern

Definition at line 56 of file ath5k_qcu.c.

58{
59 int ret;
60
61 /*
62 * Setup internal queue structure
63 */
64 memset(&ah->ah_txq, 0, sizeof(struct ath5k_txq_info));
65 ah->ah_txq.tqi_type = queue_type;
66
67 if (queue_info != NULL) {
68 queue_info->tqi_type = queue_type;
69 ret = ath5k_hw_set_tx_queueprops(ah, queue_info);
70 if (ret)
71 return ret;
72 }
73
74 /*
75 * We use ah_txq_status to hold a temp value for
76 * the Secondary interrupt mask registers on 5211+
77 * check out ath5k_hw_reset_tx_queue
78 */
79 AR5K_Q_ENABLE_BITS(ah->ah_txq_status, 0);
80
81 return 0;
82}
#define AR5K_Q_ENABLE_BITS(_reg, _queue)
Definition ath5k.h:126
int ath5k_hw_set_tx_queueprops(struct ath5k_hw *ah, const struct ath5k_txq_info *queue_info)
Definition ath5k_qcu.c:35

References ah, AR5K_Q_ENABLE_BITS, ath5k_hw_set_tx_queueprops(), memset(), NULL, and ath5k_txq_info::tqi_type.

Referenced by ath5k_txq_setup().

◆ ath5k_hw_num_tx_pending()

u32 ath5k_hw_num_tx_pending ( struct ath5k_hw * ah)
extern

References ah, capability, result, u32, and val.

◆ ath5k_hw_release_tx_queue()

void ath5k_hw_release_tx_queue ( struct ath5k_hw * ah)
extern

Definition at line 87 of file ath5k_qcu.c.

88{
89 /* This queue will be skipped in further operations */
90 ah->ah_txq.tqi_type = AR5K_TX_QUEUE_INACTIVE;
91 /*For SIMR setup*/
92 AR5K_Q_DISABLE_BITS(ah->ah_txq_status, 0);
93}
#define AR5K_Q_DISABLE_BITS(_reg, _queue)
Definition ath5k.h:130

References ah, AR5K_Q_DISABLE_BITS, and AR5K_TX_QUEUE_INACTIVE.

Referenced by ath5k_txq_release().

◆ ath5k_hw_reset_tx_queue()

int ath5k_hw_reset_tx_queue ( struct ath5k_hw * ah)
extern

Definition at line 98 of file ath5k_qcu.c.

99{
100 u32 cw_min, cw_max, retry_lg, retry_sh;
101 struct ath5k_txq_info *tq = &ah->ah_txq;
102 const int queue = 0;
103
104 tq = &ah->ah_txq;
105
107 return 0;
108
109 if (ah->ah_version == AR5K_AR5210) {
110 /* Only handle data queues, others will be ignored */
111 if (tq->tqi_type != AR5K_TX_QUEUE_DATA)
112 return 0;
113
114 /* Set Slot time */
115 ath5k_hw_reg_write(ah, ah->ah_turbo ?
118 /* Set ACK_CTS timeout */
119 ath5k_hw_reg_write(ah, ah->ah_turbo ?
122 /* Set Transmit Latency */
123 ath5k_hw_reg_write(ah, ah->ah_turbo ?
126
127 /* Set IFS0 */
128 if (ah->ah_turbo) {
130 (ah->ah_aifs + tq->tqi_aifs) *
133 AR5K_IFS0);
134 } else {
136 (ah->ah_aifs + tq->tqi_aifs) *
139 }
140
141 /* Set IFS1 */
142 ath5k_hw_reg_write(ah, ah->ah_turbo ?
145 /* Set AR5K_PHY_SETTLING */
146 ath5k_hw_reg_write(ah, ah->ah_turbo ?
148 | 0x38 :
150 | 0x1C,
152 /* Set Frame Control Register */
153 ath5k_hw_reg_write(ah, ah->ah_turbo ?
155 AR5K_PHY_TURBO_SHORT | 0x2020) :
156 (AR5K_PHY_FRAME_CTL_INI | 0x1020),
158 }
159
160 /*
161 * Calculate cwmin/max by channel mode
162 */
163 cw_min = ah->ah_cw_min = AR5K_TUNE_CWMIN;
164 cw_max = ah->ah_cw_max = AR5K_TUNE_CWMAX;
165 ah->ah_aifs = AR5K_TUNE_AIFS;
166 /*XR is only supported on 5212*/
167 if (IS_CHAN_XR(ah->ah_current_channel) &&
168 ah->ah_version == AR5K_AR5212) {
169 cw_min = ah->ah_cw_min = AR5K_TUNE_CWMIN_XR;
170 cw_max = ah->ah_cw_max = AR5K_TUNE_CWMAX_XR;
171 ah->ah_aifs = AR5K_TUNE_AIFS_XR;
172 /*B mode is not supported on 5210*/
173 } else if (IS_CHAN_B(ah->ah_current_channel) &&
174 ah->ah_version != AR5K_AR5210) {
175 cw_min = ah->ah_cw_min = AR5K_TUNE_CWMIN_11B;
176 cw_max = ah->ah_cw_max = AR5K_TUNE_CWMAX_11B;
177 ah->ah_aifs = AR5K_TUNE_AIFS_11B;
178 }
179
180 cw_min = 1;
181 while (cw_min < ah->ah_cw_min)
182 cw_min = (cw_min << 1) | 1;
183
184 cw_min = tq->tqi_cw_min < 0 ? (cw_min >> (-tq->tqi_cw_min)) :
185 ((cw_min << tq->tqi_cw_min) + (1 << tq->tqi_cw_min) - 1);
186 cw_max = tq->tqi_cw_max < 0 ? (cw_max >> (-tq->tqi_cw_max)) :
187 ((cw_max << tq->tqi_cw_max) + (1 << tq->tqi_cw_max) - 1);
188
189 /*
190 * Calculate and set retry limits
191 */
192 if (ah->ah_software_retry) {
193 /* XXX Need to test this */
194 retry_lg = ah->ah_limit_tx_retries;
195 retry_sh = retry_lg = retry_lg > AR5K_DCU_RETRY_LMT_SH_RETRY ?
196 AR5K_DCU_RETRY_LMT_SH_RETRY : retry_lg;
197 } else {
198 retry_lg = AR5K_INIT_LG_RETRY;
199 retry_sh = AR5K_INIT_SH_RETRY;
200 }
201
202 /*No QCU/DCU [5210]*/
203 if (ah->ah_version == AR5K_AR5210) {
204 ath5k_hw_reg_write(ah,
205 (cw_min << AR5K_NODCU_RETRY_LMT_CW_MIN_S)
206 | AR5K_REG_SM(AR5K_INIT_SLG_RETRY,
207 AR5K_NODCU_RETRY_LMT_SLG_RETRY)
208 | AR5K_REG_SM(AR5K_INIT_SSH_RETRY,
209 AR5K_NODCU_RETRY_LMT_SSH_RETRY)
210 | AR5K_REG_SM(retry_lg, AR5K_NODCU_RETRY_LMT_LG_RETRY)
211 | AR5K_REG_SM(retry_sh, AR5K_NODCU_RETRY_LMT_SH_RETRY),
212 AR5K_NODCU_RETRY_LMT);
213 } else {
214 /*QCU/DCU [5211+]*/
215 ath5k_hw_reg_write(ah,
216 AR5K_REG_SM(AR5K_INIT_SLG_RETRY,
217 AR5K_DCU_RETRY_LMT_SLG_RETRY) |
218 AR5K_REG_SM(AR5K_INIT_SSH_RETRY,
219 AR5K_DCU_RETRY_LMT_SSH_RETRY) |
220 AR5K_REG_SM(retry_lg, AR5K_DCU_RETRY_LMT_LG_RETRY) |
221 AR5K_REG_SM(retry_sh, AR5K_DCU_RETRY_LMT_SH_RETRY),
222 AR5K_QUEUE_DFS_RETRY_LIMIT(queue));
223
224 /*===Rest is also for QCU/DCU only [5211+]===*/
225
226 /*
227 * Set initial content window (cw_min/cw_max)
228 * and arbitrated interframe space (aifs)...
229 */
230 ath5k_hw_reg_write(ah,
231 AR5K_REG_SM(cw_min, AR5K_DCU_LCL_IFS_CW_MIN) |
232 AR5K_REG_SM(cw_max, AR5K_DCU_LCL_IFS_CW_MAX) |
233 AR5K_REG_SM(ah->ah_aifs + tq->tqi_aifs,
234 AR5K_DCU_LCL_IFS_AIFS),
235 AR5K_QUEUE_DFS_LOCAL_IFS(queue));
236
237 /*
238 * Set misc registers
239 */
240 /* Enable DCU early termination for this queue */
241 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue),
242 AR5K_QCU_MISC_DCU_EARLY);
243
244 /* Enable DCU to wait for next fragment from QCU */
245 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_DFS_MISC(queue),
246 AR5K_DCU_MISC_FRAG_WAIT);
247
248 /* On Maui and Spirit use the global seqnum on DCU */
249 if (ah->ah_mac_version < AR5K_SREV_AR5211)
250 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_DFS_MISC(queue),
251 AR5K_DCU_MISC_SEQNUM_CTL);
252
253 if (tq->tqi_cbr_period) {
254 ath5k_hw_reg_write(ah, AR5K_REG_SM(tq->tqi_cbr_period,
255 AR5K_QCU_CBRCFG_INTVAL) |
256 AR5K_REG_SM(tq->tqi_cbr_overflow_limit,
257 AR5K_QCU_CBRCFG_ORN_THRES),
258 AR5K_QUEUE_CBRCFG(queue));
259 AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue),
260 AR5K_QCU_MISC_FRSHED_CBR);
261 if (tq->tqi_cbr_overflow_limit)
262 AR5K_REG_ENABLE_BITS(ah,
263 AR5K_QUEUE_MISC(queue),
264 AR5K_QCU_MISC_CBR_THRES_ENABLE);
265 }
266
267 if (tq->tqi_ready_time &&
273
274 if (tq->tqi_burst_time) {
275 ath5k_hw_reg_write(ah, AR5K_REG_SM(tq->tqi_burst_time,
276 AR5K_DCU_CHAN_TIME_DUR) |
277 AR5K_DCU_CHAN_TIME_ENABLE,
278 AR5K_QUEUE_DFS_CHANNEL_TIME(queue));
279
280 if (tq->tqi_flags
281 & AR5K_TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE)
282 AR5K_REG_ENABLE_BITS(ah,
283 AR5K_QUEUE_MISC(queue),
284 AR5K_QCU_MISC_RDY_VEOL_POLICY);
285 }
286
290
294
295 /* TODO: Handle frame compression */
296
297 /*
298 * Enable interrupts for this tx queue
299 * in the secondary interrupt mask registers
300 */
302 AR5K_Q_ENABLE_BITS(ah->ah_txq_imr_txok, queue);
303
305 AR5K_Q_ENABLE_BITS(ah->ah_txq_imr_txerr, queue);
306
308 AR5K_Q_ENABLE_BITS(ah->ah_txq_imr_txurn, queue);
309
311 AR5K_Q_ENABLE_BITS(ah->ah_txq_imr_txdesc, queue);
312
314 AR5K_Q_ENABLE_BITS(ah->ah_txq_imr_txeol, queue);
315
317 AR5K_Q_ENABLE_BITS(ah->ah_txq_imr_cbrorn, queue);
318
320 AR5K_Q_ENABLE_BITS(ah->ah_txq_imr_cbrurn, queue);
321
323 AR5K_Q_ENABLE_BITS(ah->ah_txq_imr_qtrig, queue);
324
326 AR5K_Q_ENABLE_BITS(ah->ah_txq_imr_nofrm, queue);
327
328 /* Update secondary interrupt mask registers */
329
330 /* Filter out inactive queues */
331 ah->ah_txq_imr_txok &= ah->ah_txq_status;
332 ah->ah_txq_imr_txerr &= ah->ah_txq_status;
333 ah->ah_txq_imr_txurn &= ah->ah_txq_status;
334 ah->ah_txq_imr_txdesc &= ah->ah_txq_status;
335 ah->ah_txq_imr_txeol &= ah->ah_txq_status;
336 ah->ah_txq_imr_cbrorn &= ah->ah_txq_status;
337 ah->ah_txq_imr_cbrurn &= ah->ah_txq_status;
338 ah->ah_txq_imr_qtrig &= ah->ah_txq_status;
339 ah->ah_txq_imr_nofrm &= ah->ah_txq_status;
340
341 ath5k_hw_reg_write(ah, AR5K_REG_SM(ah->ah_txq_imr_txok,
343 AR5K_REG_SM(ah->ah_txq_imr_txdesc,
345 ath5k_hw_reg_write(ah, AR5K_REG_SM(ah->ah_txq_imr_txerr,
347 AR5K_REG_SM(ah->ah_txq_imr_txeol,
349 /* Update simr2 but don't overwrite rest simr2 settings */
352 AR5K_REG_SM(ah->ah_txq_imr_txurn,
354 ath5k_hw_reg_write(ah, AR5K_REG_SM(ah->ah_txq_imr_cbrorn,
356 AR5K_REG_SM(ah->ah_txq_imr_cbrurn,
358 ath5k_hw_reg_write(ah, AR5K_REG_SM(ah->ah_txq_imr_qtrig,
360 /* Set TXNOFRM_QCU for the queues with TXNOFRM enabled */
361 ath5k_hw_reg_write(ah, AR5K_REG_SM(ah->ah_txq_imr_nofrm,
363 /* No queue has TXNOFRM enabled, disable the interrupt
364 * by setting AR5K_TXNOFRM to zero */
365 if (ah->ah_txq_imr_nofrm == 0)
367
368 /* Set QCU mask for this DCU to save power */
370 }
371
372 return 0;
373}
#define AR5K_PHY_SETTLING
Definition reg.h:1970
#define AR5K_SIMR3_QCBRURN
Definition reg.h:447
#define AR5K_PHY_FRAME_CTL_INI
Definition reg.h:2283
#define AR5K_SIMR1
Definition reg.h:424
#define AR5K_SIMR1_QCU_TXERR
Definition reg.h:425
#define AR5K_SIMR0_QCU_TXOK
Definition reg.h:419
#define AR5K_TXNOFRM_QCU
Definition reg.h:239
#define AR5K_SIMR1_QCU_TXEOL
Definition reg.h:427
#define AR5K_SIMR0_QCU_TXDESC
Definition reg.h:421
#define AR5K_PHY_FRAME_CTL_5210
Definition reg.h:2266
#define AR5K_IFS0
Definition reg.h:1290
#define AR5K_IFS1
Definition reg.h:1299
#define AR5K_SLOT_TIME
Definition reg.h:1163
#define AR5K_QUEUE_DFS_MISC(_q)
Definition reg.h:747
#define AR5K_TXNOFRM
Definition reg.h:237
#define AR5K_SIMR4
Definition reg.h:450
#define AR5K_QCU_RDYTIMECFG_ENABLE
Definition reg.h:586
#define AR5K_DCU_MISC_POST_FR_BKOFF_DIS
Definition reg.h:743
#define AR5K_SIMR3_QCBRORN
Definition reg.h:445
#define AR5K_QCU_RDYTIMECFG_INTVAL
Definition reg.h:584
#define AR5K_DCU_MISC_BACKOFF_FRAG
Definition reg.h:728
#define AR5K_SIMR0
Definition reg.h:418
#define AR5K_QUEUE_QCUMASK(_q)
Definition reg.h:673
#define AR5K_IFS0_DIFS_S
Definition reg.h:1294
#define AR5K_SIMR4_QTRIG
Definition reg.h:451
#define AR5K_QUEUE_RDYTIMECFG(_q)
Definition reg.h:587
#define AR5K_USEC_5210
Definition reg.h:1215
#define AR5K_SIMR3
Definition reg.h:444
#define AR5K_TXQ_FLAG_TXURNINT_ENABLE
Definition ath5k.h:494
#define AR5K_INIT_SLOT_TIME_TURBO
Definition ath5k.h:217
#define AR5K_TXQ_FLAG_TXDESCINT_ENABLE
Definition ath5k.h:493
#define AR5K_TXQ_FLAG_QTRIGINT_ENABLE
Definition ath5k.h:497
#define AR5K_TUNE_CWMAX
Definition ath5k.h:189
#define AR5K_TXQ_FLAG_CBRORNINT_ENABLE
Definition ath5k.h:495
#define AR5K_TXQ_FLAG_TXNOFRMINT_ENABLE
Definition ath5k.h:498
#define AR5K_INIT_ACK_CTS_TIMEOUT
Definition ath5k.h:218
#define AR5K_TXQ_FLAG_TXEOLINT_ENABLE
Definition ath5k.h:492
#define AR5K_TXQ_FLAG_TXOKINT_ENABLE
Definition ath5k.h:490
#define AR5K_TUNE_AIFS_11B
Definition ath5k.h:184
#define AR5K_INIT_SIFS_TURBO
Definition ath5k.h:225
#define AR5K_INIT_TRANSMIT_LATENCY
Definition ath5k.h:232
#define AR5K_TUNE_CWMIN_11B
Definition ath5k.h:187
#define AR5K_TUNE_CWMAX_11B
Definition ath5k.h:190
#define AR5K_TUNE_AIFS_XR
Definition ath5k.h:185
#define AR5K_TUNE_CWMAX_XR
Definition ath5k.h:191
#define AR5K_INIT_SIFS
Definition ath5k.h:224
#define AR5K_INIT_SLOT_TIME
Definition ath5k.h:216
#define AR5K_INIT_PROTO_TIME_CNTRL_TURBO
Definition ath5k.h:244
#define AR5K_TXQ_FLAG_TXERRINT_ENABLE
Definition ath5k.h:491
#define AR5K_TXQ_FLAG_CBRURNINT_ENABLE
Definition ath5k.h:496
#define AR5K_TUNE_CWMIN_XR
Definition ath5k.h:188
#define IS_CHAN_B(_c)
Definition ath5k.h:660
#define AR5K_INIT_ACK_CTS_TIMEOUT_TURBO
Definition ath5k.h:219
#define AR5K_INIT_PROTO_TIME_CNTRL
Definition ath5k.h:240
#define AR5K_TXQ_FLAG_BACKOFF_DISABLE
Definition ath5k.h:499
#define AR5K_TXQ_FLAG_FRAG_BURST_BACKOFF_ENABLE
Definition ath5k.h:501
#define IS_CHAN_XR(_c)
Definition ath5k.h:659
#define AR5K_INIT_TRANSMIT_LATENCY_TURBO
Definition ath5k.h:236
if(natsemi->flags &NATSEMI_64BIT) return 1
u16 tqi_flags
Definition ath5k.h:511
u32 tqi_ready_time
Definition ath5k.h:518
s32 tqi_cw_max
Definition ath5k.h:514
s32 tqi_cw_min
Definition ath5k.h:513
u32 tqi_burst_time
Definition ath5k.h:517

References ah, AR5K_AR5210, AR5K_AR5212, AR5K_DCU_CHAN_TIME_DUR, AR5K_DCU_CHAN_TIME_ENABLE, AR5K_DCU_LCL_IFS_AIFS, AR5K_DCU_LCL_IFS_CW_MAX, AR5K_DCU_LCL_IFS_CW_MIN, AR5K_DCU_MISC_BACKOFF_FRAG, AR5K_DCU_MISC_FRAG_WAIT, AR5K_DCU_MISC_POST_FR_BKOFF_DIS, AR5K_DCU_MISC_SEQNUM_CTL, AR5K_DCU_RETRY_LMT_LG_RETRY, AR5K_DCU_RETRY_LMT_SH_RETRY, AR5K_DCU_RETRY_LMT_SLG_RETRY, AR5K_DCU_RETRY_LMT_SSH_RETRY, AR5K_IFS0, AR5K_IFS0_DIFS_S, AR5K_IFS1, AR5K_INIT_ACK_CTS_TIMEOUT, AR5K_INIT_ACK_CTS_TIMEOUT_TURBO, AR5K_INIT_LG_RETRY, AR5K_INIT_PROTO_TIME_CNTRL, AR5K_INIT_PROTO_TIME_CNTRL_TURBO, AR5K_INIT_SH_RETRY, AR5K_INIT_SIFS, AR5K_INIT_SIFS_TURBO, AR5K_INIT_SLG_RETRY, AR5K_INIT_SLOT_TIME, AR5K_INIT_SLOT_TIME_TURBO, AR5K_INIT_SSH_RETRY, AR5K_INIT_TRANSMIT_LATENCY, AR5K_INIT_TRANSMIT_LATENCY_TURBO, AR5K_NODCU_RETRY_LMT, AR5K_NODCU_RETRY_LMT_CW_MIN_S, AR5K_NODCU_RETRY_LMT_LG_RETRY, AR5K_NODCU_RETRY_LMT_SH_RETRY, AR5K_NODCU_RETRY_LMT_SLG_RETRY, AR5K_NODCU_RETRY_LMT_SSH_RETRY, AR5K_PHY_FRAME_CTL_5210, AR5K_PHY_FRAME_CTL_INI, AR5K_PHY_SETTLING, AR5K_PHY_TURBO_MODE, AR5K_PHY_TURBO_SHORT, AR5K_Q_ENABLE_BITS, AR5K_QCU_CBRCFG_INTVAL, AR5K_QCU_CBRCFG_ORN_THRES, AR5K_QCU_MISC_CBR_THRES_ENABLE, AR5K_QCU_MISC_DCU_EARLY, AR5K_QCU_MISC_FRSHED_CBR, AR5K_QCU_MISC_RDY_VEOL_POLICY, AR5K_QCU_RDYTIMECFG_ENABLE, AR5K_QCU_RDYTIMECFG_INTVAL, AR5K_QUEUE_CBRCFG, AR5K_QUEUE_DFS_CHANNEL_TIME, AR5K_QUEUE_DFS_LOCAL_IFS, AR5K_QUEUE_DFS_MISC, AR5K_QUEUE_DFS_RETRY_LIMIT, AR5K_QUEUE_MISC, AR5K_QUEUE_QCUMASK, AR5K_QUEUE_RDYTIMECFG, AR5K_REG_DISABLE_BITS, AR5K_REG_ENABLE_BITS, AR5K_REG_SM, AR5K_REG_WRITE_Q, AR5K_SIMR0, AR5K_SIMR0_QCU_TXDESC, AR5K_SIMR0_QCU_TXOK, AR5K_SIMR1, AR5K_SIMR1_QCU_TXEOL, AR5K_SIMR1_QCU_TXERR, AR5K_SIMR2, AR5K_SIMR2_QCU_TXURN, AR5K_SIMR3, AR5K_SIMR3_QCBRORN, AR5K_SIMR3_QCBRURN, AR5K_SIMR4, AR5K_SIMR4_QTRIG, AR5K_SLOT_TIME, AR5K_SREV_AR5211, AR5K_TUNE_AIFS, AR5K_TUNE_AIFS_11B, AR5K_TUNE_AIFS_XR, AR5K_TUNE_CWMAX, AR5K_TUNE_CWMAX_11B, AR5K_TUNE_CWMAX_XR, AR5K_TUNE_CWMIN, AR5K_TUNE_CWMIN_11B, AR5K_TUNE_CWMIN_XR, AR5K_TX_QUEUE_CAB, AR5K_TX_QUEUE_DATA, AR5K_TX_QUEUE_INACTIVE, AR5K_TXNOFRM, AR5K_TXNOFRM_QCU, AR5K_TXQ_FLAG_BACKOFF_DISABLE, AR5K_TXQ_FLAG_CBRORNINT_ENABLE, AR5K_TXQ_FLAG_CBRURNINT_ENABLE, AR5K_TXQ_FLAG_FRAG_BURST_BACKOFF_ENABLE, AR5K_TXQ_FLAG_QTRIGINT_ENABLE, AR5K_TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE, AR5K_TXQ_FLAG_TXDESCINT_ENABLE, AR5K_TXQ_FLAG_TXEOLINT_ENABLE, AR5K_TXQ_FLAG_TXERRINT_ENABLE, AR5K_TXQ_FLAG_TXNOFRMINT_ENABLE, AR5K_TXQ_FLAG_TXOKINT_ENABLE, AR5K_TXQ_FLAG_TXURNINT_ENABLE, AR5K_USEC_5210, ath5k_hw_reg_read(), ath5k_hw_reg_write(), IS_CHAN_B, IS_CHAN_XR, queue, ath5k_txq_info::tqi_aifs, ath5k_txq_info::tqi_burst_time, ath5k_txq_info::tqi_cbr_overflow_limit, ath5k_txq_info::tqi_cbr_period, ath5k_txq_info::tqi_cw_max, ath5k_txq_info::tqi_cw_min, ath5k_txq_info::tqi_flags, ath5k_txq_info::tqi_ready_time, ath5k_txq_info::tqi_type, and u32.

Referenced by ath5k_hw_reset().

◆ ath5k_hw_set_slot_time()

int ath5k_hw_set_slot_time ( struct ath5k_hw * ah,
unsigned int slot_time )
extern

Definition at line 378 of file ath5k_qcu.c.

379{
380 if (slot_time < AR5K_SLOT_TIME_9 || slot_time > AR5K_SLOT_TIME_MAX)
381 return -EINVAL;
382
383 if (ah->ah_version == AR5K_AR5210)
385 ah->ah_turbo), AR5K_SLOT_TIME);
386 else
388
389 return 0;
390}
#define AR5K_DCU_GBL_IFS_SLOT
Definition reg.h:765
#define AR5K_SLOT_TIME_MAX
Definition ath5k.h:627

References ah, AR5K_AR5210, AR5K_DCU_GBL_IFS_SLOT, AR5K_SLOT_TIME, AR5K_SLOT_TIME_MAX, ath5k_hw_htoclock(), ath5k_hw_reg_write(), and EINVAL.

◆ ath5k_hw_init_desc_functions()

int ath5k_hw_init_desc_functions ( struct ath5k_hw * ah)
extern

Definition at line 523 of file ath5k_desc.c.

524{
525
526 if (ah->ah_version != AR5K_AR5210 &&
527 ah->ah_version != AR5K_AR5211 &&
528 ah->ah_version != AR5K_AR5212)
529 return -ENOTSUP;
530
531 if (ah->ah_version == AR5K_AR5212) {
532 ah->ah_setup_rx_desc = ath5k_hw_setup_rx_desc;
533 ah->ah_setup_tx_desc = ath5k_hw_setup_4word_tx_desc;
534 ah->ah_proc_tx_desc = ath5k_hw_proc_4word_tx_status;
535 } else {
536 ah->ah_setup_rx_desc = ath5k_hw_setup_rx_desc;
537 ah->ah_setup_tx_desc = ath5k_hw_setup_2word_tx_desc;
538 ah->ah_proc_tx_desc = ath5k_hw_proc_2word_tx_status;
539 }
540
541 if (ah->ah_version == AR5K_AR5212)
542 ah->ah_proc_rx_desc = ath5k_hw_proc_5212_rx_status;
543 else if (ah->ah_version <= AR5K_AR5211)
544 ah->ah_proc_rx_desc = ath5k_hw_proc_5210_rx_status;
545
546 return 0;
547}
static int ath5k_hw_setup_rx_desc(struct ath5k_hw *ah __unused, struct ath5k_desc *desc, u32 size, unsigned int flags)
Definition ath5k_desc.c:365
static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah __unused, struct ath5k_desc *desc, struct ath5k_tx_status *ts)
Definition ath5k_desc.c:253
static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, unsigned int pkt_len, unsigned int hdr_len __unused, enum ath5k_pkt_type type, unsigned int tx_power, unsigned int tx_rate0, unsigned int tx_tries0, unsigned int key_index __unused, unsigned int antenna_mode, unsigned int flags, unsigned int rtscts_rate, unsigned int rtscts_duration)
Definition ath5k_desc.c:157
static int ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, unsigned int pkt_len, unsigned int hdr_len, enum ath5k_pkt_type type, unsigned int tx_power __unused, unsigned int tx_rate0, unsigned int tx_tries0, unsigned int key_index __unused, unsigned int antenna_mode, unsigned int flags, unsigned int rtscts_rate __unused, unsigned int rtscts_duration)
Definition ath5k_desc.c:43
static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah __unused, struct ath5k_desc *desc, struct ath5k_rx_status *rs)
Definition ath5k_desc.c:458
static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah __unused, struct ath5k_desc *desc, struct ath5k_tx_status *ts)
Definition ath5k_desc.c:305
static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah __unused, struct ath5k_desc *desc, struct ath5k_rx_status *rs)
Definition ath5k_desc.c:396

References ah, AR5K_AR5210, AR5K_AR5211, AR5K_AR5212, ath5k_hw_proc_2word_tx_status(), ath5k_hw_proc_4word_tx_status(), ath5k_hw_proc_5210_rx_status(), ath5k_hw_proc_5212_rx_status(), ath5k_hw_setup_2word_tx_desc(), ath5k_hw_setup_4word_tx_desc(), ath5k_hw_setup_rx_desc(), and ENOTSUP.

Referenced by ath5k_hw_attach().

◆ ath5k_hw_set_gpio_input()

int ath5k_hw_set_gpio_input ( struct ath5k_hw * ah,
u32 gpio )
extern

Definition at line 35 of file ath5k_gpio.c.

36{
37 if (gpio >= AR5K_NUM_GPIO)
38 return -EINVAL;
39
43
44 return 0;
45}
#define AR5K_GPIOCR_OUT(n)
Definition reg.h:937
#define AR5K_NUM_GPIO
Definition reg.h:928
#define AR5K_GPIOCR_IN(n)
Definition reg.h:934
A GPIO pin.
Definition gpio.h:18

References ah, AR5K_GPIOCR, AR5K_GPIOCR_IN, AR5K_GPIOCR_OUT, AR5K_NUM_GPIO, ath5k_hw_reg_read(), ath5k_hw_reg_write(), EINVAL, and u32.

Referenced by ath5k_hw_reset(), and ath5k_rfkill_set_intr().

◆ ath5k_hw_set_gpio_output()

int ath5k_hw_set_gpio_output ( struct ath5k_hw * ah,
u32 gpio )
extern

◆ ath5k_hw_get_gpio()

u32 ath5k_hw_get_gpio ( struct ath5k_hw * ah,
u32 gpio )
extern

Definition at line 65 of file ath5k_gpio.c.

66{
67 if (gpio >= AR5K_NUM_GPIO)
68 return 0xffffffff;
69
70 /* GPIO input magic */
72 0x1;
73}
#define AR5K_GPIODI_M
Definition reg.h:949
#define AR5K_GPIODI
Definition reg.h:948

References ah, AR5K_GPIODI, AR5K_GPIODI_M, AR5K_NUM_GPIO, ath5k_hw_reg_read(), and u32.

Referenced by ath5k_hw_reset(), ath5k_is_rfkill_set(), and ath5k_rfkill_set_intr().

◆ ath5k_hw_set_gpio()

int ath5k_hw_set_gpio ( struct ath5k_hw * ah,
u32 gpio,
u32 val )
extern

Definition at line 78 of file ath5k_gpio.c.

79{
80 u32 data;
81
82 if (gpio >= AR5K_NUM_GPIO)
83 return -EINVAL;
84
85 /* GPIO output magic */
87
88 data &= ~(1 << gpio);
89 data |= (val & 1) << gpio;
90
92
93 return 0;
94}

References ah, AR5K_GPIODO, AR5K_NUM_GPIO, ath5k_hw_reg_read(), ath5k_hw_reg_write(), data, EINVAL, u32, and val.

Referenced by ath5k_rfkill_disable(), and ath5k_rfkill_enable().

◆ ath5k_hw_set_gpio_intr()

void ath5k_hw_set_gpio_intr ( struct ath5k_hw * ah,
unsigned int gpio,
u32 interrupt_level )
extern

Definition at line 99 of file ath5k_gpio.c.

101{
102 u32 data;
103
104 if (gpio >= AR5K_NUM_GPIO)
105 return;
106
107 /*
108 * Set the GPIO interrupt
109 */
114
115 ath5k_hw_reg_write(ah, interrupt_level ? data :
117
118 ah->ah_imr |= AR5K_IMR_GPIO;
119
120 /* Enable GPIO interrupts */
122}
#define AR5K_GPIOCR_INT_SEL(n)
Definition reg.h:938
#define AR5K_GPIOCR_INT_SELH
Definition reg.h:933
#define AR5K_IMR_GPIO
Definition reg.h:410
#define AR5K_GPIOCR_INT_ENA
Definition reg.h:931

References ah, AR5K_GPIOCR, AR5K_GPIOCR_INT_ENA, AR5K_GPIOCR_INT_SEL, AR5K_GPIOCR_INT_SELH, AR5K_GPIOCR_OUT, AR5K_IMR_GPIO, AR5K_NUM_GPIO, AR5K_PIMR, AR5K_REG_ENABLE_BITS, ath5k_hw_reg_read(), ath5k_hw_reg_write(), data, and u32.

Referenced by ath5k_hw_reset(), and ath5k_rfkill_set_intr().

◆ ath5k_rfkill_hw_start()

void ath5k_rfkill_hw_start ( struct ath5k_hw * ah)
extern

Definition at line 81 of file ath5k_rfkill.c.

82{
83 struct ath5k_softc *sc = ah->ah_sc;
84
85 /* read rfkill GPIO configuration from EEPROM header */
86 sc->rf_kill.gpio = ah->ah_capabilities.cap_eeprom.ee_rfkill_pin;
87 sc->rf_kill.polarity = ah->ah_capabilities.cap_eeprom.ee_rfkill_pol;
88
90
91 /* enable interrupt for rfkill switch */
92 if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header))
94}
static void ath5k_rfkill_disable(struct ath5k_softc *sc)
static void ath5k_rfkill_set_intr(struct ath5k_softc *sc, int enable)
u16 gpio
Definition base.h:128
struct ath5k_softc::@344164377243325166301233055376377150275233304000 rf_kill
unsigned polarity
Definition base.h:129

References ah, AR5K_EEPROM_HDR_RFKILL, ath5k_rfkill_disable(), ath5k_rfkill_set_intr(), ath5k_softc::gpio, ath5k_softc::polarity, and ath5k_softc::rf_kill.

Referenced by ath5k_init().

◆ ath5k_rfkill_hw_stop()

void ath5k_rfkill_hw_stop ( struct ath5k_hw * ah)
extern

Definition at line 98 of file ath5k_rfkill.c.

99{
100 struct ath5k_softc *sc = ah->ah_sc;
101
102 /* disable interrupt for rfkill switch */
103 if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header))
105
106 /* enable RFKILL when stopping HW so Wifi LED is turned off */
108}
static void ath5k_rfkill_enable(struct ath5k_softc *sc)

References ah, AR5K_EEPROM_HDR_RFKILL, ath5k_rfkill_enable(), and ath5k_rfkill_set_intr().

Referenced by ath5k_stop_hw().

◆ ath5k_hw_set_capabilities()

int ath5k_hw_set_capabilities ( struct ath5k_hw * ah)

Definition at line 37 of file ath5k_caps.c.

38{
39 u16 ee_header;
40
41 /* Capabilities stored in the EEPROM */
42 ee_header = ah->ah_capabilities.cap_eeprom.ee_header;
43
44 if (ah->ah_version == AR5K_AR5210) {
45 /*
46 * Set radio capabilities
47 * (The AR5110 only supports the middle 5GHz band)
48 */
49 ah->ah_capabilities.cap_range.range_5ghz_min = 5120;
50 ah->ah_capabilities.cap_range.range_5ghz_max = 5430;
51 ah->ah_capabilities.cap_range.range_2ghz_min = 0;
52 ah->ah_capabilities.cap_range.range_2ghz_max = 0;
53
54 /* Set supported modes */
55 ah->ah_capabilities.cap_mode |= AR5K_MODE_BIT_11A;
56 ah->ah_capabilities.cap_mode |= AR5K_MODE_BIT_11A_TURBO;
57 } else {
58 /*
59 * XXX The tranceiver supports frequencies from 4920 to 6100GHz
60 * XXX and from 2312 to 2732GHz. There are problems with the
61 * XXX current ieee80211 implementation because the IEEE
62 * XXX channel mapping does not support negative channel
63 * XXX numbers (2312MHz is channel -19). Of course, this
64 * XXX doesn't matter because these channels are out of range
65 * XXX but some regulation domains like MKK (Japan) will
66 * XXX support frequencies somewhere around 4.8GHz.
67 */
68
69 /*
70 * Set radio capabilities
71 */
72
73 if (AR5K_EEPROM_HDR_11A(ee_header)) {
74 /* 4920 */
75 ah->ah_capabilities.cap_range.range_5ghz_min = 5005;
76 ah->ah_capabilities.cap_range.range_5ghz_max = 6100;
77
78 /* Set supported modes */
79 ah->ah_capabilities.cap_mode |= AR5K_MODE_BIT_11A;
80 ah->ah_capabilities.cap_mode |= AR5K_MODE_BIT_11A_TURBO;
81 if (ah->ah_version == AR5K_AR5212)
82 ah->ah_capabilities.cap_mode |=
84 }
85
86 /* Enable 802.11b if a 2GHz capable radio (2111/5112) is
87 * connected */
88 if (AR5K_EEPROM_HDR_11B(ee_header) ||
89 (AR5K_EEPROM_HDR_11G(ee_header) &&
90 ah->ah_version != AR5K_AR5211)) {
91 /* 2312 */
92 ah->ah_capabilities.cap_range.range_2ghz_min = 2412;
93 ah->ah_capabilities.cap_range.range_2ghz_max = 2732;
94
95 if (AR5K_EEPROM_HDR_11B(ee_header))
96 ah->ah_capabilities.cap_mode |=
98
99 if (AR5K_EEPROM_HDR_11G(ee_header) &&
100 ah->ah_version != AR5K_AR5211)
101 ah->ah_capabilities.cap_mode |=
103 }
104 }
105
106 /* GPIO */
107 ah->ah_gpio_npins = AR5K_NUM_GPIO;
108
109 /* Set number of supported TX queues */
110 ah->ah_capabilities.cap_queues.q_tx_num = 1;
111
112 return 0;
113}
#define AR5K_EEPROM_HDR_11G(_v)
Definition eeprom.h:71
#define AR5K_EEPROM_HDR_11B(_v)
Definition eeprom.h:70
#define AR5K_EEPROM_HDR_11A(_v)
Definition eeprom.h:69

References ah, AR5K_AR5210, AR5K_AR5211, AR5K_AR5212, AR5K_EEPROM_HDR_11A, AR5K_EEPROM_HDR_11B, AR5K_EEPROM_HDR_11G, AR5K_MODE_BIT_11A, AR5K_MODE_BIT_11A_TURBO, AR5K_MODE_BIT_11B, AR5K_MODE_BIT_11G, AR5K_MODE_BIT_11G_TURBO, AR5K_NUM_GPIO, and u16.

Referenced by ath5k_hw_attach().

◆ ath5k_hw_get_capability()

int ath5k_hw_get_capability ( struct ath5k_hw * ah,
enum ath5k_capability_type cap_type,
u32 capability,
u32 * result )
extern

Definition at line 116 of file ath5k_caps.c.

119{
120 switch (cap_type) {
122 if (result) {
123 *result = 1;
124 goto yes;
125 }
126 case AR5K_CAP_VEOL:
127 goto yes;
129 if (ah->ah_version == AR5K_AR5212)
130 goto yes;
131 else
132 goto no;
133 case AR5K_CAP_BURST:
134 goto yes;
135 case AR5K_CAP_TPC:
136 goto yes;
138 if (ah->ah_version == AR5K_AR5212)
139 goto yes;
140 else
141 goto no;
142 case AR5K_CAP_XR:
143 if (ah->ah_version == AR5K_AR5212)
144 goto yes;
145 else
146 goto no;
147 default:
148 goto no;
149 }
150
151no:
152 return -EINVAL;
153yes:
154 return 0;
155}
uint16_t result
Definition hyperv.h:33

References __unused, ah, AR5K_AR5212, AR5K_CAP_BSSIDMASK, AR5K_CAP_BURST, AR5K_CAP_COMPRESSION, AR5K_CAP_NUM_TXQUEUES, AR5K_CAP_TPC, AR5K_CAP_VEOL, AR5K_CAP_XR, capability, EINVAL, result, and u32.

◆ ath5k_hw_enable_pspoll()

int ath5k_hw_enable_pspoll ( struct ath5k_hw * ah,
u8 * bssid,
u16 assoc_id )
extern

References ah, u16, and u8.

◆ ath5k_hw_disable_pspoll()

int ath5k_hw_disable_pspoll ( struct ath5k_hw * ah)
extern

References ah, channel, flags, mode, u16, and u8.

◆ ath5k_hw_write_initvals()

int ath5k_hw_write_initvals ( struct ath5k_hw * ah,
u8 mode,
int change_channel )
extern

Definition at line 1419 of file ath5k_initvals.c.

1420{
1421 /*
1422 * Write initial register settings
1423 */
1424
1425 /* For AR5212 and combatible */
1426 if (ah->ah_version == AR5K_AR5212) {
1427
1428 /* First set of mode-specific settings */
1432
1433 /*
1434 * Write initial settings common for all modes
1435 */
1437 ar5212_ini_common_start, change_channel);
1438
1439 /* Second set of mode-specific settings */
1440 switch (ah->ah_radio) {
1441 case AR5K_RF5111:
1442
1446
1449 rf5111_ini_common_end, change_channel);
1450
1451 /* Baseband gain table */
1454 rf5111_ini_bbgain, change_channel);
1455
1456 break;
1457 case AR5K_RF5112:
1458
1462
1465 rf5112_ini_common_end, change_channel);
1466
1469 rf5112_ini_bbgain, change_channel);
1470
1471 break;
1472 case AR5K_RF5413:
1473
1477
1480 rf5413_ini_common_end, change_channel);
1481
1484 rf5112_ini_bbgain, change_channel);
1485
1486 break;
1487 case AR5K_RF2316:
1488 case AR5K_RF2413:
1489
1493
1496 rf2413_ini_common_end, change_channel);
1497
1498 /* Override settings from rf2413_ini_common_end */
1499 if (ah->ah_radio == AR5K_RF2316) {
1500 ath5k_hw_reg_write(ah, 0x00004000,
1501 AR5K_PHY_AGC);
1502 ath5k_hw_reg_write(ah, 0x081b7caa,
1503 0xa274);
1504 }
1505
1508 rf5112_ini_bbgain, change_channel);
1509 break;
1510 case AR5K_RF2317:
1511 case AR5K_RF2425:
1512
1516
1519 rf2425_ini_common_end, change_channel);
1520
1523 rf5112_ini_bbgain, change_channel);
1524 break;
1525 default:
1526 return -EINVAL;
1527
1528 }
1529
1530 /* For AR5211 */
1531 } else if (ah->ah_version == AR5K_AR5211) {
1532
1533 /* AR5K_MODE_11B */
1534 if (mode > 2) {
1535 DBG("ath5k: unsupported channel mode %d\n", mode);
1536 return -EINVAL;
1537 }
1538
1539 /* Mode-specific settings */
1542
1543 /*
1544 * Write initial settings common for all modes
1545 */
1547 ar5211_ini, change_channel);
1548
1549 /* AR5211 only comes with 5111 */
1550
1551 /* Baseband gain table */
1553 rf5111_ini_bbgain, change_channel);
1554 /* For AR5210 (for mode settings check out ath5k_hw_reset_tx_queue) */
1555 } else if (ah->ah_version == AR5K_AR5210) {
1557 ar5210_ini, change_channel);
1558 }
1559
1560 return 0;
1561}
#define AR5K_PHY_AGC
Definition reg.h:1900
static const struct ath5k_ini rf5112_ini_bbgain[]
static const struct ath5k_ini_mode ar5211_ini_mode[]
static const struct ath5k_ini rf2425_ini_common_end[]
static const struct ath5k_ini rf2413_ini_common_end[]
static const struct ath5k_ini rf5111_ini_bbgain[]
static const struct ath5k_ini rf5413_ini_common_end[]
static const struct ath5k_ini rf5111_ini_common_end[]
static const struct ath5k_ini_mode rf5112_ini_mode_end[]
static const struct ath5k_ini_mode ar5212_ini_mode_start[]
static const struct ath5k_ini_mode rf5111_ini_mode_end[]
static void ath5k_hw_ini_registers(struct ath5k_hw *ah, unsigned int size, const struct ath5k_ini *ini_regs, int change_channel)
static const struct ath5k_ini_mode rf5413_ini_mode_end[]
static void ath5k_hw_ini_mode_registers(struct ath5k_hw *ah, unsigned int size, const struct ath5k_ini_mode *ini_mode, u8 mode)
static const struct ath5k_ini ar5212_ini_common_start[]
static const struct ath5k_ini ar5211_ini[]
static const struct ath5k_ini_mode rf2413_ini_mode_end[]
static const struct ath5k_ini rf5112_ini_common_end[]
static const struct ath5k_ini ar5210_ini[]
static const struct ath5k_ini_mode rf2425_ini_mode_end[]
#define ARRAY_SIZE(x)
Definition efx_common.h:43

References ah, ar5210_ini, ar5211_ini, ar5211_ini_mode, ar5212_ini_common_start, ar5212_ini_mode_start, AR5K_AR5210, AR5K_AR5211, AR5K_AR5212, AR5K_PHY_AGC, AR5K_RF2316, AR5K_RF2317, AR5K_RF2413, AR5K_RF2425, AR5K_RF5111, AR5K_RF5112, AR5K_RF5413, ARRAY_SIZE, ath5k_hw_ini_mode_registers(), ath5k_hw_ini_registers(), ath5k_hw_reg_write(), DBG, EINVAL, mode, rf2413_ini_common_end, rf2413_ini_mode_end, rf2425_ini_common_end, rf2425_ini_mode_end, rf5111_ini_bbgain, rf5111_ini_common_end, rf5111_ini_mode_end, rf5112_ini_bbgain, rf5112_ini_common_end, rf5112_ini_mode_end, rf5413_ini_common_end, rf5413_ini_mode_end, and u8.

Referenced by ath5k_hw_reset().

◆ ath5k_hw_rfregs_init()

int ath5k_hw_rfregs_init ( struct ath5k_hw * ah,
struct net80211_channel * channel,
unsigned int mode )
extern

Definition at line 515 of file ath5k_phy.c.

517{
518 const struct ath5k_rf_reg *rf_regs;
519 const struct ath5k_ini_rfbuffer *ini_rfb;
520 const struct ath5k_gain_opt *go = NULL;
521 const struct ath5k_gain_opt_step *g_step;
522 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
523 u8 ee_mode = 0;
524 u32 *rfb;
525 int obdb = -1, bank = -1;
526 unsigned i;
527
528 switch (ah->ah_radio) {
529 case AR5K_RF5111:
530 rf_regs = rf_regs_5111;
531 ah->ah_rf_regs_count = ARRAY_SIZE(rf_regs_5111);
532 ini_rfb = rfb_5111;
533 ah->ah_rf_banks_size = ARRAY_SIZE(rfb_5111);
534 go = &rfgain_opt_5111;
535 break;
536 case AR5K_RF5112:
537 if (ah->ah_radio_5ghz_revision >= AR5K_SREV_RAD_5112A) {
538 rf_regs = rf_regs_5112a;
539 ah->ah_rf_regs_count = ARRAY_SIZE(rf_regs_5112a);
540 ini_rfb = rfb_5112a;
541 ah->ah_rf_banks_size = ARRAY_SIZE(rfb_5112a);
542 } else {
543 rf_regs = rf_regs_5112;
544 ah->ah_rf_regs_count = ARRAY_SIZE(rf_regs_5112);
545 ini_rfb = rfb_5112;
546 ah->ah_rf_banks_size = ARRAY_SIZE(rfb_5112);
547 }
548 go = &rfgain_opt_5112;
549 break;
550 case AR5K_RF2413:
551 rf_regs = rf_regs_2413;
552 ah->ah_rf_regs_count = ARRAY_SIZE(rf_regs_2413);
553 ini_rfb = rfb_2413;
554 ah->ah_rf_banks_size = ARRAY_SIZE(rfb_2413);
555 break;
556 case AR5K_RF2316:
557 rf_regs = rf_regs_2316;
558 ah->ah_rf_regs_count = ARRAY_SIZE(rf_regs_2316);
559 ini_rfb = rfb_2316;
560 ah->ah_rf_banks_size = ARRAY_SIZE(rfb_2316);
561 break;
562 case AR5K_RF5413:
563 rf_regs = rf_regs_5413;
564 ah->ah_rf_regs_count = ARRAY_SIZE(rf_regs_5413);
565 ini_rfb = rfb_5413;
566 ah->ah_rf_banks_size = ARRAY_SIZE(rfb_5413);
567 break;
568 case AR5K_RF2317:
569 rf_regs = rf_regs_2425;
570 ah->ah_rf_regs_count = ARRAY_SIZE(rf_regs_2425);
571 ini_rfb = rfb_2317;
572 ah->ah_rf_banks_size = ARRAY_SIZE(rfb_2317);
573 break;
574 case AR5K_RF2425:
575 rf_regs = rf_regs_2425;
576 ah->ah_rf_regs_count = ARRAY_SIZE(rf_regs_2425);
577 if (ah->ah_mac_srev < AR5K_SREV_AR2417) {
578 ini_rfb = rfb_2425;
579 ah->ah_rf_banks_size = ARRAY_SIZE(rfb_2425);
580 } else {
581 ini_rfb = rfb_2417;
582 ah->ah_rf_banks_size = ARRAY_SIZE(rfb_2417);
583 }
584 break;
585 default:
586 return -EINVAL;
587 }
588
589 /* If it's the first time we set rf buffer, allocate
590 * ah->ah_rf_banks based on ah->ah_rf_banks_size
591 * we set above */
592 if (ah->ah_rf_banks == NULL) {
593 ah->ah_rf_banks = malloc(sizeof(u32) * ah->ah_rf_banks_size);
594 if (ah->ah_rf_banks == NULL) {
595 return -ENOMEM;
596 }
597 }
598
599 /* Copy values to modify them */
600 rfb = ah->ah_rf_banks;
601
602 for (i = 0; i < ah->ah_rf_banks_size; i++) {
603 if (ini_rfb[i].rfb_bank >= AR5K_MAX_RF_BANKS) {
604 DBG("ath5k: invalid RF register bank\n");
605 return -EINVAL;
606 }
607
608 /* Bank changed, write down the offset */
609 if (bank != ini_rfb[i].rfb_bank) {
610 bank = ini_rfb[i].rfb_bank;
611 ah->ah_offset[bank] = i;
612 }
613
614 rfb[i] = ini_rfb[i].rfb_mode_data[mode];
615 }
616
617 /* Set Output and Driver bias current (OB/DB) */
618 if (channel->hw_value & CHANNEL_2GHZ) {
619
620 if (channel->hw_value & CHANNEL_CCK)
621 ee_mode = AR5K_EEPROM_MODE_11B;
622 else
623 ee_mode = AR5K_EEPROM_MODE_11G;
624
625 /* For RF511X/RF211X combination we
626 * use b_OB and b_DB parameters stored
627 * in eeprom on ee->ee_ob[ee_mode][0]
628 *
629 * For all other chips we use OB/DB for 2Ghz
630 * stored in the b/g modal section just like
631 * 802.11a on ee->ee_ob[ee_mode][1] */
632 if ((ah->ah_radio == AR5K_RF5111) ||
633 (ah->ah_radio == AR5K_RF5112))
634 obdb = 0;
635 else
636 obdb = 1;
637
638 ath5k_hw_rfb_op(ah, rf_regs, ee->ee_ob[ee_mode][obdb],
639 AR5K_RF_OB_2GHZ, 1);
640
641 ath5k_hw_rfb_op(ah, rf_regs, ee->ee_db[ee_mode][obdb],
642 AR5K_RF_DB_2GHZ, 1);
643
644 /* RF5111 always needs OB/DB for 5GHz, even if we use 2GHz */
645 } else if ((channel->hw_value & CHANNEL_5GHZ) ||
646 (ah->ah_radio == AR5K_RF5111)) {
647
648 /* For 11a, Turbo and XR we need to choose
649 * OB/DB based on frequency range */
650 ee_mode = AR5K_EEPROM_MODE_11A;
651 obdb = channel->center_freq >= 5725 ? 3 :
652 (channel->center_freq >= 5500 ? 2 :
653 (channel->center_freq >= 5260 ? 1 :
654 (channel->center_freq > 4000 ? 0 : -1)));
655
656 if (obdb < 0)
657 return -EINVAL;
658
659 ath5k_hw_rfb_op(ah, rf_regs, ee->ee_ob[ee_mode][obdb],
660 AR5K_RF_OB_5GHZ, 1);
661
662 ath5k_hw_rfb_op(ah, rf_regs, ee->ee_db[ee_mode][obdb],
663 AR5K_RF_DB_5GHZ, 1);
664 }
665
666 g_step = &go->go_step[ah->ah_gain.g_step_idx];
667
668 /* Bank Modifications (chip-specific) */
669 if (ah->ah_radio == AR5K_RF5111) {
670
671 /* Set gain_F settings according to current step */
672 if (channel->hw_value & CHANNEL_OFDM) {
673
676 g_step->gos_param[0]);
677
678 ath5k_hw_rfb_op(ah, rf_regs, g_step->gos_param[1],
679 AR5K_RF_PWD_90, 1);
680
681 ath5k_hw_rfb_op(ah, rf_regs, g_step->gos_param[2],
682 AR5K_RF_PWD_84, 1);
683
684 ath5k_hw_rfb_op(ah, rf_regs, g_step->gos_param[3],
686
687 /* We programmed gain_F parameters, switch back
688 * to active state */
689 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE;
690
691 }
692
693 /* Bank 6/7 setup */
694
695 ath5k_hw_rfb_op(ah, rf_regs, !ee->ee_xpd[ee_mode],
696 AR5K_RF_PWD_XPD, 1);
697
698 ath5k_hw_rfb_op(ah, rf_regs, ee->ee_x_gain[ee_mode],
700
701 ath5k_hw_rfb_op(ah, rf_regs, ee->ee_i_gain[ee_mode],
702 AR5K_RF_GAIN_I, 1);
703
704 ath5k_hw_rfb_op(ah, rf_regs, ee->ee_xpd[ee_mode],
705 AR5K_RF_PLO_SEL, 1);
706
707 /* TODO: Half/quarter channel support */
708 }
709
710 if (ah->ah_radio == AR5K_RF5112) {
711
712 /* Set gain_F settings according to current step */
713 if (channel->hw_value & CHANNEL_OFDM) {
714
715 ath5k_hw_rfb_op(ah, rf_regs, g_step->gos_param[0],
717
718 ath5k_hw_rfb_op(ah, rf_regs, g_step->gos_param[1],
719 AR5K_RF_PWD_138, 1);
720
721 ath5k_hw_rfb_op(ah, rf_regs, g_step->gos_param[2],
722 AR5K_RF_PWD_137, 1);
723
724 ath5k_hw_rfb_op(ah, rf_regs, g_step->gos_param[3],
725 AR5K_RF_PWD_136, 1);
726
727 ath5k_hw_rfb_op(ah, rf_regs, g_step->gos_param[4],
728 AR5K_RF_PWD_132, 1);
729
730 ath5k_hw_rfb_op(ah, rf_regs, g_step->gos_param[5],
731 AR5K_RF_PWD_131, 1);
732
733 ath5k_hw_rfb_op(ah, rf_regs, g_step->gos_param[6],
734 AR5K_RF_PWD_130, 1);
735
736 /* We programmed gain_F parameters, switch back
737 * to active state */
738 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE;
739 }
740
741 /* Bank 6/7 setup */
742
743 ath5k_hw_rfb_op(ah, rf_regs, ee->ee_xpd[ee_mode],
744 AR5K_RF_XPD_SEL, 1);
745
746 if (ah->ah_radio_5ghz_revision < AR5K_SREV_RAD_5112A) {
747 /* Rev. 1 supports only one xpd */
748 ath5k_hw_rfb_op(ah, rf_regs,
749 ee->ee_x_gain[ee_mode],
751
752 } else {
753 /* TODO: Set high and low gain bits */
754 ath5k_hw_rfb_op(ah, rf_regs,
755 ee->ee_x_gain[ee_mode],
757 ath5k_hw_rfb_op(ah, rf_regs,
758 ee->ee_x_gain[ee_mode],
760
761 /* Lower synth voltage on Rev 2 */
762 ath5k_hw_rfb_op(ah, rf_regs, 2,
764
765 ath5k_hw_rfb_op(ah, rf_regs, 2,
767
768 ath5k_hw_rfb_op(ah, rf_regs, 2,
770
771 ath5k_hw_rfb_op(ah, rf_regs, 2,
772 AR5K_RF_PUSH_UP, 1);
773
774 /* Decrease power consumption on 5213+ BaseBand */
775 if (ah->ah_phy_revision >= AR5K_SREV_PHY_5212A) {
776 ath5k_hw_rfb_op(ah, rf_regs, 1,
777 AR5K_RF_PAD2GND, 1);
778
779 ath5k_hw_rfb_op(ah, rf_regs, 1,
780 AR5K_RF_XB2_LVL, 1);
781
782 ath5k_hw_rfb_op(ah, rf_regs, 1,
783 AR5K_RF_XB5_LVL, 1);
784
785 ath5k_hw_rfb_op(ah, rf_regs, 1,
786 AR5K_RF_PWD_167, 1);
787
788 ath5k_hw_rfb_op(ah, rf_regs, 1,
789 AR5K_RF_PWD_166, 1);
790 }
791 }
792
793 ath5k_hw_rfb_op(ah, rf_regs, ee->ee_i_gain[ee_mode],
794 AR5K_RF_GAIN_I, 1);
795
796 /* TODO: Half/quarter channel support */
797
798 }
799
800 if (ah->ah_radio == AR5K_RF5413 &&
801 channel->hw_value & CHANNEL_2GHZ) {
802
804 1);
805
806 /* Set optimum value for early revisions (on pci-e chips) */
807 if (ah->ah_mac_srev >= AR5K_SREV_AR5424 &&
808 ah->ah_mac_srev < AR5K_SREV_AR5413)
809 ath5k_hw_rfb_op(ah, rf_regs, ath5k_hw_bitswap(6, 3),
811
812 }
813
814 /* Write RF banks on hw */
815 for (i = 0; i < ah->ah_rf_banks_size; i++) {
816 AR5K_REG_WAIT(i);
817 ath5k_hw_reg_write(ah, rfb[i], ini_rfb[i].rfb_ctrl_register);
818 }
819
820 return 0;
821}
#define AR5K_PHY_FRAME_CTL_TX_CLIP
Definition reg.h:2271
#define AR5K_PHY_FRAME_CTL
Definition reg.h:2268
#define AR5K_SREV_AR5413
Definition ath5k.h:301
#define AR5K_MAX_RF_BANKS
Definition ath5k.h:952
#define AR5K_SREV_PHY_5212A
Definition ath5k.h:329
#define AR5K_SREV_RAD_5112A
Definition ath5k.h:314
#define AR5K_SREV_AR5424
Definition ath5k.h:300
static u32 ath5k_hw_bitswap(u32 val, unsigned int bits)
Definition ath5k.h:1267
#define AR5K_REG_WAIT(_i)
Definition ath5k.h:135
static unsigned int ath5k_hw_rfb_op(struct ath5k_hw *ah, const struct ath5k_rf_reg *rf_regs, u32 val, u8 reg_id, int set)
Definition ath5k_phy.c:52
void * malloc(size_t size)
Allocate memory.
Definition malloc.c:621
static const struct ath5k_rf_reg rf_regs_2316[]
Definition rfbuffer.h:732
static const struct ath5k_rf_reg rf_regs_5413[]
Definition rfbuffer.h:828
static const struct ath5k_ini_rfbuffer rfb_5112[]
Definition rfbuffer.h:338
static const struct ath5k_ini_rfbuffer rfb_5413[]
Definition rfbuffer.h:838
static const struct ath5k_rf_reg rf_regs_2425[]
Definition rfbuffer.h:939
@ AR5K_RF_PWD_90
Definition rfbuffer.h:104
@ AR5K_RF_GAIN_I
Definition rfbuffer.h:115
@ AR5K_RF_MIXGAIN_OVR
Definition rfbuffer.h:123
@ AR5K_RF_RFGAIN_SEL
Definition rfbuffer.h:117
@ AR5K_RF_XB5_LVL
Definition rfbuffer.h:101
@ AR5K_RF_DB_2GHZ
Definition rfbuffer.h:86
@ AR5K_RF_LOW_VC_CP
Definition rfbuffer.h:97
@ AR5K_RF_PWD_ICLOBUF_2G
Definition rfbuffer.h:102
@ AR5K_RF_PWD_130
Definition rfbuffer.h:105
@ AR5K_RF_OB_5GHZ
Definition rfbuffer.h:85
@ AR5K_RF_OB_2GHZ
Definition rfbuffer.h:84
@ AR5K_RF_PWD_167
Definition rfbuffer.h:112
@ AR5K_RF_PD_GAIN_LO
Definition rfbuffer.h:93
@ AR5K_RF_PD_GAIN_HI
Definition rfbuffer.h:94
@ AR5K_RF_PWD_XPD
Definition rfbuffer.h:90
@ AR5K_RF_HIGH_VC_CP
Definition rfbuffer.h:95
@ AR5K_RF_PWD_84
Definition rfbuffer.h:103
@ AR5K_RF_MID_VC_CP
Definition rfbuffer.h:96
@ AR5K_RF_XB2_LVL
Definition rfbuffer.h:100
@ AR5K_RF_PWD_131
Definition rfbuffer.h:106
@ AR5K_RF_PWD_138
Definition rfbuffer.h:110
@ AR5K_RF_PLO_SEL
Definition rfbuffer.h:116
@ AR5K_RF_XPD_GAIN
Definition rfbuffer.h:92
@ AR5K_RF_PUSH_UP
Definition rfbuffer.h:98
@ AR5K_RF_PAD2GND
Definition rfbuffer.h:99
@ AR5K_RF_PWD_136
Definition rfbuffer.h:108
@ AR5K_RF_XPD_SEL
Definition rfbuffer.h:91
@ AR5K_RF_PWD_132
Definition rfbuffer.h:107
@ AR5K_RF_PWD_166
Definition rfbuffer.h:111
@ AR5K_RF_PWD_137
Definition rfbuffer.h:109
@ AR5K_RF_DERBY_CHAN_SEL_MODE
Definition rfbuffer.h:113
@ AR5K_RF_DB_5GHZ
Definition rfbuffer.h:87
static const struct ath5k_ini_rfbuffer rfb_2417[]
Definition rfbuffer.h:1108
static const struct ath5k_rf_reg rf_regs_5111[]
Definition rfbuffer.h:161
static const struct ath5k_rf_reg rf_regs_5112a[]
Definition rfbuffer.h:480
static const struct ath5k_rf_reg rf_regs_5112[]
Definition rfbuffer.h:310
static const struct ath5k_ini_rfbuffer rfb_2317[]
Definition rfbuffer.h:1027
static const struct ath5k_ini_rfbuffer rfb_2316[]
Definition rfbuffer.h:738
static const struct ath5k_rf_reg rf_regs_2413[]
Definition rfbuffer.h:644
static const struct ath5k_ini_rfbuffer rfb_2425[]
Definition rfbuffer.h:947
static const struct ath5k_ini_rfbuffer rfb_5112a[]
Definition rfbuffer.h:518
static const struct ath5k_ini_rfbuffer rfb_2413[]
Definition rfbuffer.h:652
static const struct ath5k_ini_rfbuffer rfb_5111[]
Definition rfbuffer.h:180
static const struct ath5k_gain_opt rfgain_opt_5112
Definition rfgain.h:504
static const struct ath5k_gain_opt rfgain_opt_5111
Definition rfgain.h:478
u16 ee_ob[AR5K_EEPROM_N_MODES][AR5K_EEPROM_N_OBDB]
Definition eeprom.h:404
u16 ee_i_gain[AR5K_EEPROM_N_MODES]
Definition eeprom.h:413
u16 ee_db[AR5K_EEPROM_N_MODES][AR5K_EEPROM_N_OBDB]
Definition eeprom.h:405
u16 ee_x_gain[AR5K_EEPROM_N_MODES]
Definition eeprom.h:412
u16 ee_xpd[AR5K_EEPROM_N_MODES]
Definition eeprom.h:411
s8 gos_param[AR5K_GAIN_CRN_MAX_FIX_BITS]
Definition rfgain.h:461
const struct ath5k_gain_opt_step go_step[AR5K_GAIN_STEP_COUNT]
Definition rfgain.h:468
u32 rfb_mode_data[5]
Definition rfbuffer.h:55

References ah, AR5K_EEPROM_MODE_11A, AR5K_EEPROM_MODE_11B, AR5K_EEPROM_MODE_11G, AR5K_MAX_RF_BANKS, AR5K_PHY_FRAME_CTL, AR5K_PHY_FRAME_CTL_TX_CLIP, AR5K_REG_WAIT, AR5K_REG_WRITE_BITS, AR5K_RF2316, AR5K_RF2317, AR5K_RF2413, AR5K_RF2425, AR5K_RF5111, AR5K_RF5112, AR5K_RF5413, AR5K_RF_DB_2GHZ, AR5K_RF_DB_5GHZ, AR5K_RF_DERBY_CHAN_SEL_MODE, AR5K_RF_GAIN_I, AR5K_RF_HIGH_VC_CP, AR5K_RF_LOW_VC_CP, AR5K_RF_MID_VC_CP, AR5K_RF_MIXGAIN_OVR, AR5K_RF_OB_2GHZ, AR5K_RF_OB_5GHZ, AR5K_RF_PAD2GND, AR5K_RF_PD_GAIN_HI, AR5K_RF_PD_GAIN_LO, AR5K_RF_PLO_SEL, AR5K_RF_PUSH_UP, AR5K_RF_PWD_130, AR5K_RF_PWD_131, AR5K_RF_PWD_132, AR5K_RF_PWD_136, AR5K_RF_PWD_137, AR5K_RF_PWD_138, AR5K_RF_PWD_166, AR5K_RF_PWD_167, AR5K_RF_PWD_84, AR5K_RF_PWD_90, AR5K_RF_PWD_ICLOBUF_2G, AR5K_RF_PWD_XPD, AR5K_RF_RFGAIN_SEL, AR5K_RF_XB2_LVL, AR5K_RF_XB5_LVL, AR5K_RF_XPD_GAIN, AR5K_RF_XPD_SEL, AR5K_RFGAIN_ACTIVE, AR5K_SREV_AR2417, AR5K_SREV_AR5413, AR5K_SREV_AR5424, AR5K_SREV_PHY_5212A, AR5K_SREV_RAD_5112A, ARRAY_SIZE, ath5k_hw_bitswap(), ath5k_hw_reg_write(), ath5k_hw_rfb_op(), channel, CHANNEL_2GHZ, CHANNEL_5GHZ, CHANNEL_CCK, CHANNEL_OFDM, DBG, ath5k_eeprom_info::ee_db, ath5k_eeprom_info::ee_i_gain, ath5k_eeprom_info::ee_ob, ath5k_eeprom_info::ee_x_gain, ath5k_eeprom_info::ee_xpd, EINVAL, ENOMEM, ath5k_gain_opt::go_step, ath5k_gain_opt_step::gos_param, malloc(), mode, NULL, rf_regs_2316, rf_regs_2413, rf_regs_2425, rf_regs_5111, rf_regs_5112, rf_regs_5112a, rf_regs_5413, rfb_2316, rfb_2317, rfb_2413, rfb_2417, rfb_2425, rfb_5111, rfb_5112, rfb_5112a, rfb_5413, ath5k_ini_rfbuffer::rfb_bank, ath5k_ini_rfbuffer::rfb_mode_data, rfgain_opt_5111, rfgain_opt_5112, u32, and u8.

Referenced by ath5k_hw_reset().

◆ ath5k_hw_rfgain_init()

int ath5k_hw_rfgain_init ( struct ath5k_hw * ah,
unsigned int freq )
extern

Definition at line 453 of file ath5k_phy.c.

454{
455 const struct ath5k_ini_rfgain *ath5k_rfg;
456 unsigned int i, size;
457
458 switch (ah->ah_radio) {
459 case AR5K_RF5111:
460 ath5k_rfg = rfgain_5111;
462 break;
463 case AR5K_RF5112:
464 ath5k_rfg = rfgain_5112;
466 break;
467 case AR5K_RF2413:
468 ath5k_rfg = rfgain_2413;
470 break;
471 case AR5K_RF2316:
472 ath5k_rfg = rfgain_2316;
474 break;
475 case AR5K_RF5413:
476 ath5k_rfg = rfgain_5413;
478 break;
479 case AR5K_RF2317:
480 case AR5K_RF2425:
481 ath5k_rfg = rfgain_2425;
483 break;
484 default:
485 return -EINVAL;
486 }
487
488 switch (freq) {
491 break;
492 default:
493 return -EINVAL;
494 }
495
496 for (i = 0; i < size; i++) {
497 AR5K_REG_WAIT(i);
498 ath5k_hw_reg_write(ah, ath5k_rfg[i].rfg_value[freq],
499 (u32)ath5k_rfg[i].rfg_register);
500 }
501
502 return 0;
503}
uint16_t size
Buffer size.
Definition dwmac.h:3
static const struct ath5k_ini_rfgain rfgain_2413[]
Definition rfgain.h:172
static const struct ath5k_ini_rfgain rfgain_5413[]
Definition rfgain.h:309
static const struct ath5k_ini_rfgain rfgain_2425[]
Definition rfgain.h:379
static const struct ath5k_ini_rfgain rfgain_5112[]
Definition rfgain.h:103
static const struct ath5k_ini_rfgain rfgain_2316[]
Definition rfgain.h:240
static const struct ath5k_ini_rfgain rfgain_5111[]
Definition rfgain.h:34
u32 rfg_value[2]
Definition rfgain.h:30

References ah, AR5K_INI_RFGAIN_2GHZ, AR5K_INI_RFGAIN_5GHZ, AR5K_REG_WAIT, AR5K_RF2316, AR5K_RF2317, AR5K_RF2413, AR5K_RF2425, AR5K_RF5111, AR5K_RF5112, AR5K_RF5413, ARRAY_SIZE, ath5k_hw_reg_write(), EINVAL, ath5k_ini_rfgain::rfg_register, ath5k_ini_rfgain::rfg_value, rfgain_2316, rfgain_2413, rfgain_2425, rfgain_5111, rfgain_5112, rfgain_5413, size, and u32.

Referenced by ath5k_hw_reset().

◆ ath5k_hw_gainf_calibrate()

enum ath5k_rfgain ath5k_hw_gainf_calibrate ( struct ath5k_hw * ah)
extern

Definition at line 390 of file ath5k_phy.c.

391{
392 u32 data, type;
393 struct ath5k_eeprom_info *ee = &ah->ah_capabilities.cap_eeprom;
394
395 if (ah->ah_rf_banks == NULL ||
396 ah->ah_gain.g_state == AR5K_RFGAIN_INACTIVE)
398
399 /* No check requested, either engine is inactive
400 * or an adjustment is already requested */
401 if (ah->ah_gain.g_state != AR5K_RFGAIN_READ_REQUESTED)
402 goto done;
403
404 /* Read the PAPD (Peak to Average Power Detector)
405 * register */
407
408 /* No probe is scheduled, read gain_F measurement */
410 ah->ah_gain.g_current = data >> AR5K_PHY_PAPD_PROBE_GAINF_S;
412
413 /* If tx packet is CCK correct the gain_F measurement
414 * by cck ofdm gain delta */
416 if (ah->ah_radio_5ghz_revision >= AR5K_SREV_RAD_5112A)
417 ah->ah_gain.g_current +=
419 else
420 ah->ah_gain.g_current +=
422 }
423
424 /* Further correct gain_F measurement for
425 * RF5112A radios */
426 if (ah->ah_radio_5ghz_revision >= AR5K_SREV_RAD_5112A) {
428 ah->ah_gain.g_current =
429 ah->ah_gain.g_current >= ah->ah_gain.g_f_corr ?
430 (ah->ah_gain.g_current-ah->ah_gain.g_f_corr) :
431 0;
432 }
433
434 /* Check if measurement is ok and if we need
435 * to adjust gain, schedule a gain adjustment,
436 * else switch back to the acive state */
438 AR5K_GAIN_CHECK_ADJUST(&ah->ah_gain) &&
440 ah->ah_gain.g_state = AR5K_RFGAIN_NEED_CHANGE;
441 } else {
442 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE;
443 }
444 }
445
446done:
447 return ah->ah_gain.g_state;
448}
#define AR5K_PHY_PAPD_PROBE_TYPE
Definition reg.h:2243
#define AR5K_PHY_PAPD_PROBE_TYPE_CCK
Definition reg.h:2247
#define AR5K_PHY_PAPD_PROBE_TX_NEXT
Definition reg.h:2241
#define AR5K_PHY_PAPD_PROBE
Definition reg.h:2235
#define AR5K_PHY_PAPD_PROBE_GAINF_S
Definition reg.h:2249
static int ath5k_hw_rf_check_gainf_readback(struct ath5k_hw *ah)
Definition ath5k_phy.c:270
static s8 ath5k_hw_rf_gainf_adjust(struct ath5k_hw *ah)
Definition ath5k_phy.c:321
static u32 ath5k_hw_rf_gainf_corr(struct ath5k_hw *ah)
Definition ath5k_phy.c:215
#define AR5K_GAIN_CCK_PROBE_CORR
Definition rfgain.h:451
#define AR5K_GAIN_CHECK_ADJUST(_g)
Definition rfgain.h:457
u16 ee_cck_ofdm_gain_delta
Definition eeprom.h:391

References ah, AR5K_GAIN_CCK_PROBE_CORR, AR5K_GAIN_CHECK_ADJUST, AR5K_PHY_PAPD_PROBE, AR5K_PHY_PAPD_PROBE_GAINF_S, AR5K_PHY_PAPD_PROBE_TX_NEXT, AR5K_PHY_PAPD_PROBE_TYPE, AR5K_PHY_PAPD_PROBE_TYPE_CCK, AR5K_REG_MS, AR5K_RFGAIN_ACTIVE, AR5K_RFGAIN_INACTIVE, AR5K_RFGAIN_NEED_CHANGE, AR5K_RFGAIN_READ_REQUESTED, AR5K_SREV_RAD_5112A, ath5k_hw_reg_read(), ath5k_hw_rf_check_gainf_readback(), ath5k_hw_rf_gainf_adjust(), ath5k_hw_rf_gainf_corr(), data, done, ath5k_eeprom_info::ee_cck_ofdm_gain_delta, NULL, type, and u32.

Referenced by ath5k_calibrate(), and ath5k_hw_reset().

◆ ath5k_hw_rfgain_opt_init()

int ath5k_hw_rfgain_opt_init ( struct ath5k_hw * ah)
extern

Definition at line 159 of file ath5k_phy.c.

160{
161 /* Initialize the gain optimization values */
162 switch (ah->ah_radio) {
163 case AR5K_RF5111:
164 ah->ah_gain.g_step_idx = rfgain_opt_5111.go_default;
165 ah->ah_gain.g_low = 20;
166 ah->ah_gain.g_high = 35;
167 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE;
168 break;
169 case AR5K_RF5112:
170 ah->ah_gain.g_step_idx = rfgain_opt_5112.go_default;
171 ah->ah_gain.g_low = 20;
172 ah->ah_gain.g_high = 85;
173 ah->ah_gain.g_state = AR5K_RFGAIN_ACTIVE;
174 break;
175 default:
176 return -EINVAL;
177 }
178
179 return 0;
180}

References ah, AR5K_RF5111, AR5K_RF5112, AR5K_RFGAIN_ACTIVE, EINVAL, rfgain_opt_5111, and rfgain_opt_5112.

Referenced by ath5k_hw_attach().

◆ ath5k_channel_ok()

int ath5k_channel_ok ( struct ath5k_hw * ah,
u16 freq,
unsigned int flags )
extern

Definition at line 831 of file ath5k_phy.c.

832{
833 /* Check if the channel is in our supported range */
834 if (flags & CHANNEL_2GHZ) {
835 if ((freq >= ah->ah_capabilities.cap_range.range_2ghz_min) &&
836 (freq <= ah->ah_capabilities.cap_range.range_2ghz_max))
837 return 1;
838 } else if (flags & CHANNEL_5GHZ)
839 if ((freq >= ah->ah_capabilities.cap_range.range_5ghz_min) &&
840 (freq <= ah->ah_capabilities.cap_range.range_5ghz_max))
841 return 1;
842
843 return 0;
844}

References ah, CHANNEL_2GHZ, CHANNEL_5GHZ, flags, and u16.

Referenced by ath5k_copy_channels(), and ath5k_hw_channel().

◆ ath5k_hw_channel()

int ath5k_hw_channel ( struct ath5k_hw * ah,
struct net80211_channel * channel )
extern

Definition at line 1049 of file ath5k_phy.c.

1050{
1051 int ret;
1052 /*
1053 * Check bounds supported by the PHY (we don't care about regultory
1054 * restrictions at this point). Note: hw_value already has the band
1055 * (CHANNEL_2GHZ, or CHANNEL_5GHZ) so we inform ath5k_channel_ok()
1056 * of the band by that */
1057 if (!ath5k_channel_ok(ah, channel->center_freq, channel->hw_value)) {
1058 DBG("ath5k: channel frequency (%d MHz) out of supported "
1059 "range\n", channel->center_freq);
1060 return -EINVAL;
1061 }
1062
1063 /*
1064 * Set the channel and wait
1065 */
1066 switch (ah->ah_radio) {
1067 case AR5K_RF5110:
1069 break;
1070 case AR5K_RF5111:
1072 break;
1073 case AR5K_RF2425:
1075 break;
1076 default:
1078 break;
1079 }
1080
1081 if (ret) {
1082 DBG("ath5k: setting channel failed: %s\n", strerror(ret));
1083 return ret;
1084 }
1085
1086 /* Set JAPAN setting for channel 14 */
1087 if (channel->center_freq == 2484) {
1090 } else {
1093 }
1094
1095 ah->ah_current_channel = channel;
1096 ah->ah_turbo = (channel->hw_value == CHANNEL_T ? 1 : 0);
1097
1098 return 0;
1099}
#define AR5K_PHY_CCKTXCTL_JAPAN
Definition reg.h:2507
#define AR5K_PHY_CCKTXCTL
Definition reg.h:2505
#define AR5K_PHY_CCKTXCTL_WORLD
Definition reg.h:2506
static int ath5k_hw_rf5110_channel(struct ath5k_hw *ah, struct net80211_channel *channel)
Definition ath5k_phy.c:868
static int ath5k_hw_rf2425_channel(struct ath5k_hw *ah, struct net80211_channel *channel)
Definition ath5k_phy.c:1010
int ath5k_channel_ok(struct ath5k_hw *ah, u16 freq, unsigned int flags)
Definition ath5k_phy.c:831
static int ath5k_hw_rf5111_channel(struct ath5k_hw *ah, struct net80211_channel *channel)
Definition ath5k_phy.c:916
static int ath5k_hw_rf5112_channel(struct ath5k_hw *ah, struct net80211_channel *channel)
Definition ath5k_phy.c:962
char * strerror(int errno)
Retrieve string representation of error number.
Definition strerror.c:79

References ah, AR5K_PHY_CCKTXCTL, AR5K_PHY_CCKTXCTL_JAPAN, AR5K_PHY_CCKTXCTL_WORLD, AR5K_REG_ENABLE_BITS, AR5K_RF2425, AR5K_RF5110, AR5K_RF5111, ath5k_channel_ok(), ath5k_hw_rf2425_channel(), ath5k_hw_rf5110_channel(), ath5k_hw_rf5111_channel(), ath5k_hw_rf5112_channel(), channel, CHANNEL_T, DBG, EINVAL, and strerror().

Referenced by ath5k_hw_reset(), and ath5k_hw_rf5110_calibrate().

◆ ath5k_hw_phy_calibrate()

int ath5k_hw_phy_calibrate ( struct ath5k_hw * ah,
struct net80211_channel * channel )
extern

Definition at line 1346 of file ath5k_phy.c.

1348{
1349 int ret;
1350
1351 if (ah->ah_radio == AR5K_RF5110)
1353 else
1355
1356 return ret;
1357}
static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah, struct net80211_channel *channel)
Definition ath5k_phy.c:1178
static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah, struct net80211_channel *channel)
Definition ath5k_phy.c:1278

References ah, AR5K_RF5110, ath5k_hw_rf5110_calibrate(), ath5k_hw_rf511x_calibrate(), and channel.

Referenced by ath5k_calibrate().

◆ ath5k_hw_noise_floor_calibration()

int ath5k_hw_noise_floor_calibration ( struct ath5k_hw * ah,
short freq )
extern

ath5k_hw_noise_floor_calibration - perform PHY noise floor calibration

@ah: struct ath5k_hw pointer we are operating on @freq: the channel frequency, just used for error logging

This function performs a noise floor calibration of the PHY and waits for it to complete. Then the noise floor value is compared to some maximum noise floor we consider valid.

Note that this is different from what the madwifi HAL does: it reads the noise floor and afterwards initiates the calibration. Since the noise floor calibration can take some time to finish, depending on the current channel use, that avoids the occasional timeout warnings we are seeing now.

See the following link for an Atheros patent on noise floor calibration: http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PALL \ &p=1&u=%2Fnetahtml%2FPTO%2Fsrchnum.htm&r=1&f=G&l=50&s1=7245893.PN.&OS=PN/7

XXX: Since during noise floor calibration antennas are detached according to the patent, we should stop tx queues here.

Definition at line 1128 of file ath5k_phy.c.

1129{
1130 int ret;
1131 unsigned int i;
1132 s32 noise_floor;
1133
1134 /*
1135 * Enable noise floor calibration
1136 */
1139
1140 ret = ath5k_hw_register_timeout(ah, AR5K_PHY_AGCCTL,
1141 AR5K_PHY_AGCCTL_NF, 0, 0);
1142
1143 if (ret) {
1144 DBG("ath5k: noise floor calibration timeout (%d MHz)\n", freq);
1145 return -EAGAIN;
1146 }
1147
1148 /* Wait until the noise floor is calibrated and read the value */
1149 for (i = 20; i > 0; i--) {
1150 mdelay(1);
1151 noise_floor = ath5k_hw_reg_read(ah, AR5K_PHY_NF);
1152 noise_floor = AR5K_PHY_NF_RVAL(noise_floor);
1153 if (noise_floor & AR5K_PHY_NF_ACTIVE) {
1154 noise_floor = AR5K_PHY_NF_AVAL(noise_floor);
1155
1156 if (noise_floor <= AR5K_TUNE_NOISE_FLOOR)
1157 break;
1158 }
1159 }
1160
1161 DBG2("ath5k: noise floor %d\n", noise_floor);
1162
1163 if (noise_floor > AR5K_TUNE_NOISE_FLOOR) {
1164 DBG("ath5k: noise floor calibration failed (%d MHz)\n", freq);
1165 return -EAGAIN;
1166 }
1167
1168 ah->ah_noise_floor = noise_floor;
1169
1170 return 0;
1171}
#define AR5K_PHY_NF
Definition reg.h:2032
#define AR5K_PHY_AGCCTL_NF
Definition reg.h:2025
#define AR5K_PHY_NF_RVAL(_n)
Definition reg.h:2035
#define AR5K_PHY_NF_AVAL(_n)
Definition reg.h:2036
#define AR5K_PHY_NF_ACTIVE
Definition reg.h:2034
#define AR5K_TUNE_NOISE_FLOOR
Definition ath5k.h:192
#define DBG2(...)
Definition compiler.h:515
#define EAGAIN
Resource temporarily unavailable.
Definition errno.h:319
int32_t s32
Definition stdint.h:23

References ah, AR5K_PHY_AGCCTL, AR5K_PHY_AGCCTL_NF, AR5K_PHY_NF, AR5K_PHY_NF_ACTIVE, AR5K_PHY_NF_AVAL, AR5K_PHY_NF_RVAL, AR5K_REG_ENABLE_BITS, AR5K_TUNE_NOISE_FLOOR, ath5k_hw_reg_read(), DBG, DBG2, EAGAIN, and mdelay().

Referenced by ath5k_hw_reset(), ath5k_hw_rf5110_calibrate(), and ath5k_hw_rf511x_calibrate().

◆ ath5k_hw_radio_revision()

u16 ath5k_hw_radio_revision ( struct ath5k_hw * ah,
unsigned int chan )
extern

Definition at line 1373 of file ath5k_phy.c.

1374{
1375 unsigned int i;
1376 u32 srev;
1377 u16 ret;
1378
1379 /*
1380 * Set the radio chip access register
1381 */
1382 switch (chan) {
1383 case CHANNEL_2GHZ:
1385 break;
1386 case CHANNEL_5GHZ:
1388 break;
1389 default:
1390 return 0;
1391 }
1392
1393 mdelay(2);
1394
1395 /* ...wait until PHY is ready and read the selected radio revision */
1396 ath5k_hw_reg_write(ah, 0x00001c16, AR5K_PHY(0x34));
1397
1398 for (i = 0; i < 8; i++)
1399 ath5k_hw_reg_write(ah, 0x00010000, AR5K_PHY(0x20));
1400
1401 if (ah->ah_version == AR5K_AR5210) {
1402 srev = ath5k_hw_reg_read(ah, AR5K_PHY(256) >> 28) & 0xf;
1403 ret = (u16)ath5k_hw_bitswap(srev, 4) + 1;
1404 } else {
1405 srev = (ath5k_hw_reg_read(ah, AR5K_PHY(0x100)) >> 24) & 0xff;
1406 ret = (u16)ath5k_hw_bitswap(((srev & 0xf0) >> 4) |
1407 ((srev & 0x0f) << 4), 8);
1408 }
1409
1410 /* Reset to the 5GHz mode */
1412
1413 return ret;
1414}
#define AR5K_PHY_SHIFT_2GHZ
Definition reg.h:1878

References ah, AR5K_AR5210, AR5K_PHY, AR5K_PHY_SHIFT_2GHZ, AR5K_PHY_SHIFT_5GHZ, ath5k_hw_bitswap(), ath5k_hw_reg_read(), ath5k_hw_reg_write(), CHANNEL_2GHZ, CHANNEL_5GHZ, mdelay(), u16, and u32.

Referenced by ath5k_hw_attach().

◆ ath5k_hw_set_def_antenna()

void ath5k_hw_set_def_antenna ( struct ath5k_hw * ah,
unsigned int ant )
extern

Definition at line 1417 of file ath5k_phy.c.

1418{
1419 if (ah->ah_version != AR5K_AR5210)
1421}

References ah, AR5K_AR5210, AR5K_DEFAULT_ANTENNA, and ath5k_hw_reg_write().

◆ ath5k_hw_get_def_antenna()

unsigned int ath5k_hw_get_def_antenna ( struct ath5k_hw * ah)
extern

Definition at line 1423 of file ath5k_phy.c.

1424{
1425 if (ah->ah_version != AR5K_AR5210)
1427
1428 return 0; /*XXX: What do we return for 5210 ?*/
1429}

References ah, AR5K_AR5210, AR5K_DEFAULT_ANTENNA, and ath5k_hw_reg_read().

◆ ath5k_hw_phy_disable()

int ath5k_hw_phy_disable ( struct ath5k_hw * ah)
extern

Definition at line 1359 of file ath5k_phy.c.

1360{
1362
1363 return 0;
1364}

References ah, AR5K_PHY_ACT, AR5K_PHY_ACT_DISABLE, and ath5k_hw_reg_write().

Referenced by ath5k_stop_hw().

◆ ath5k_hw_txpower()

int ath5k_hw_txpower ( struct ath5k_hw * ah,
struct net80211_channel * channel,
u8 ee_mode,
u8 txpower )
extern

Definition at line 2475 of file ath5k_phy.c.

2477{
2478 struct ath5k_rate_pcal_info rate_info;
2479 u8 type;
2480 int ret;
2481
2482 if (txpower > AR5K_TUNE_MAX_TXPOWER) {
2483 DBG("ath5k: invalid tx power %d\n", txpower);
2484 return -EINVAL;
2485 }
2486 if (txpower == 0)
2487 txpower = AR5K_TUNE_DEFAULT_TXPOWER;
2488
2489 /* Reset TX power values */
2490 memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower));
2491 ah->ah_txpower.txp_tpc = AR5K_TUNE_TPC_TXPOWER;
2492 ah->ah_txpower.txp_min_pwr = 0;
2493 ah->ah_txpower.txp_max_pwr = AR5K_TUNE_MAX_TXPOWER;
2494
2495 /* Initialize TX power table */
2496 switch (ah->ah_radio) {
2497 case AR5K_RF5111:
2499 break;
2500 case AR5K_RF5112:
2502 break;
2503 case AR5K_RF2413:
2504 case AR5K_RF5413:
2505 case AR5K_RF2316:
2506 case AR5K_RF2317:
2507 case AR5K_RF2425:
2509 break;
2510 default:
2511 return -EINVAL;
2512 }
2513
2514 /* FIXME: Only on channel/mode change */
2516 if (ret)
2517 return ret;
2518
2519 /* Limit max power if we have a CTL available */
2521
2522 /* FIXME: Tx power limit for this regdomain
2523 * XXX: Mac80211/CRDA will do that anyway ? */
2524
2525 /* FIXME: Antenna reduction stuff */
2526
2527 /* FIXME: Limit power on turbo modes */
2528
2529 /* FIXME: TPC scale reduction */
2530
2531 /* Get surounding channels for per-rate power table
2532 * calibration */
2533 ath5k_get_rate_pcal_data(ah, channel, &rate_info);
2534
2535 /* Setup rate power table */
2536 ath5k_setup_rate_powertable(ah, txpower, &rate_info, ee_mode);
2537
2538 /* Write rate power table on hw */
2540 AR5K_TXPOWER_OFDM(2, 16) | AR5K_TXPOWER_OFDM(1, 8) |
2542
2544 AR5K_TXPOWER_OFDM(6, 16) | AR5K_TXPOWER_OFDM(5, 8) |
2546
2548 AR5K_TXPOWER_CCK(9, 16) | AR5K_TXPOWER_CCK(15, 8) |
2550
2552 AR5K_TXPOWER_CCK(13, 16) | AR5K_TXPOWER_CCK(12, 8) |
2554
2555 /* FIXME: TPC support */
2556 if (ah->ah_txpower.txp_tpc) {
2559
2564 AR5K_TPC);
2565 } else {
2568 }
2569
2570 return 0;
2571}
@ AR5K_PWRTABLE_LINEAR_PCDAC
Definition eeprom.h:316
@ AR5K_PWRTABLE_PWR_TO_PCDAC
Definition eeprom.h:315
@ AR5K_PWRTABLE_PWR_TO_PDADC
Definition eeprom.h:317
#define AR5K_TPC_ACK
Definition reg.h:1555
#define AR5K_PHY_TXPOWER_RATE4
Definition reg.h:2261
#define AR5K_TPC_CHIRP
Definition reg.h:1559
#define AR5K_PHY_TXPOWER_RATE3
Definition reg.h:2260
#define AR5K_PHY_TXPOWER_RATE1
Definition reg.h:2256
#define AR5K_PHY_TXPOWER_RATE_MAX_TPC_ENABLE
Definition reg.h:2259
#define AR5K_PHY_TXPOWER_RATE2
Definition reg.h:2257
#define AR5K_TPC_CTS
Definition reg.h:1557
#define AR5K_PHY_TXPOWER_RATE_MAX
Definition reg.h:2258
#define AR5K_TPC
Definition reg.h:1554
#define AR5K_TUNE_TPC_TXPOWER
Definition ath5k.h:195
#define AR5K_TUNE_MAX_TXPOWER
Definition ath5k.h:193
#define AR5K_TXPOWER_OFDM(_r, _v)
Definition ath5k.h:538
#define AR5K_TXPOWER_CCK(_r, _v)
Definition ath5k.h:543
static int ath5k_setup_channel_powertable(struct ath5k_hw *ah, struct net80211_channel *channel, u8 ee_mode, u8 type)
Definition ath5k_phy.c:2191
static void ath5k_get_max_ctl_power(struct ath5k_hw *ah, struct net80211_channel *channel)
Definition ath5k_phy.c:1749
static void ath5k_setup_rate_powertable(struct ath5k_hw *ah, u16 max_pwr, struct ath5k_rate_pcal_info *rate_info, u8 ee_mode)
Definition ath5k_phy.c:2413
static void ath5k_get_rate_pcal_data(struct ath5k_hw *ah, struct net80211_channel *channel, struct ath5k_rate_pcal_info *rates)
Definition ath5k_phy.c:1661

References ah, AR5K_PHY_TXPOWER_RATE1, AR5K_PHY_TXPOWER_RATE2, AR5K_PHY_TXPOWER_RATE3, AR5K_PHY_TXPOWER_RATE4, AR5K_PHY_TXPOWER_RATE_MAX, AR5K_PHY_TXPOWER_RATE_MAX_TPC_ENABLE, AR5K_PWRTABLE_LINEAR_PCDAC, AR5K_PWRTABLE_PWR_TO_PCDAC, AR5K_PWRTABLE_PWR_TO_PDADC, AR5K_REG_MS, AR5K_RF2316, AR5K_RF2317, AR5K_RF2413, AR5K_RF2425, AR5K_RF5111, AR5K_RF5112, AR5K_RF5413, AR5K_TPC, AR5K_TPC_ACK, AR5K_TPC_CHIRP, AR5K_TPC_CTS, AR5K_TUNE_DEFAULT_TXPOWER, AR5K_TUNE_MAX_TXPOWER, AR5K_TUNE_TPC_TXPOWER, AR5K_TXPOWER_CCK, AR5K_TXPOWER_OFDM, ath5k_get_max_ctl_power(), ath5k_get_rate_pcal_data(), ath5k_hw_reg_write(), ath5k_setup_channel_powertable(), ath5k_setup_rate_powertable(), channel, DBG, EINVAL, memset(), type, and u8.

Referenced by ath5k_hw_reset(), and ath5k_hw_set_txpower_limit().

◆ ath5k_hw_set_txpower_limit()

int ath5k_hw_set_txpower_limit ( struct ath5k_hw * ah,
u8 ee_mode,
u8 txpower )
extern

Definition at line 2573 of file ath5k_phy.c.

2574{
2575 struct net80211_channel *channel = ah->ah_current_channel;
2576
2577 DBG2("ath5k: changing txpower to %d\n", txpower);
2578
2579 return ath5k_hw_txpower(ah, channel, mode, txpower);
2580}
int ath5k_hw_txpower(struct ath5k_hw *ah, struct net80211_channel *channel, u8 ee_mode, u8 txpower)
Definition ath5k_phy.c:2475
An 802.11 RF channel.
Definition net80211.h:386

References ah, ath5k_hw_txpower(), channel, DBG2, mode, and u8.

◆ ath5k_hw_htoclock()

unsigned int ath5k_hw_htoclock ( unsigned int usec,
int turbo )
inlinestatic

Definition at line 1199 of file ath5k.h.

1200{
1201 return turbo ? (usec * 80) : (usec * 40);
1202}

Referenced by ath5k_hw_set_ack_timeout(), ath5k_hw_set_cts_timeout(), ath5k_hw_set_slot_time(), and ath5k_hw_write_ofdm_timings().

◆ ath5k_hw_clocktoh()

unsigned int ath5k_hw_clocktoh ( unsigned int clock,
int turbo )
inlinestatic

Definition at line 1208 of file ath5k.h.

1209{
1210 return turbo ? (clock / 80) : (clock / 40);
1211}

Referenced by ath5k_hw_get_ack_timeout(), ath5k_hw_get_cts_timeout(), ath5k_hw_set_ack_timeout(), and ath5k_hw_set_cts_timeout().

◆ ath5k_hw_reg_read()

◆ ath5k_hw_reg_write()

void ath5k_hw_reg_write ( struct ath5k_hw * ah,
u32 val,
u16 reg )
inlinestatic

◆ ath5k_hw_bitswap()

u32 ath5k_hw_bitswap ( u32 val,
unsigned int bits )
inlinestatic

Definition at line 1267 of file ath5k.h.

1268{
1269 u32 retval = 0, bit, i;
1270
1271 for (i = 0; i < bits; i++) {
1272 bit = (val >> i) & 1;
1273 retval = (retval << 1) | bit;
1274 }
1275
1276 return retval;
1277}
static volatile void * bits
Definition bitops.h:28
unsigned long retval
Definition xen.h:46
static unsigned int unsigned int bit
Definition bigint.h:392

References bit, bits, retval, u32, and val.

Referenced by ath5k_hw_radio_revision(), ath5k_hw_rf2425_channel(), ath5k_hw_rf5110_chan2athchan(), ath5k_hw_rf5111_channel(), ath5k_hw_rf5112_channel(), ath5k_hw_rfb_op(), and ath5k_hw_rfregs_init().