Linux Kernel
3.7.1
|
#include <linux/io.h>
#include <linux/interrupt.h>
#include <linux/types.h>
#include <linux/average.h>
#include <linux/leds.h>
#include <net/mac80211.h>
#include "desc.h"
#include "eeprom.h"
#include "debug.h"
#include "../ath.h"
#include "ani.h"
Go to the source code of this file.
Data Structures | |
struct | ath5k_tx_status |
struct | ath5k_txq |
struct | ath5k_txq_info |
struct | ath5k_rx_status |
struct | ath5k_gain |
struct | ath5k_athchan_2ghz |
struct | ath5k_capabilities |
struct | ath5k_nfcal_hist |
struct | ath5k_led |
struct | ath5k_rfkill |
struct | ath5k_statistics |
struct | ath5k_hw |
struct | ath_bus_ops |
Macros | |
#define | CHAN_DEBUG 0 |
#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 | ATH5K_PRINTF(fmt,...) pr_warn("%s: " fmt, __func__, ##__VA_ARGS__) |
#define | ATH5K_PRINTK(_sc, _level, _fmt,...) _ath5k_printk(_sc, _level, _fmt, ##__VA_ARGS__) |
#define | ATH5K_PRINTK_LIMIT(_sc, _level, _fmt,...) |
#define | ATH5K_INFO(_sc, _fmt,...) ATH5K_PRINTK(_sc, KERN_INFO, _fmt, ##__VA_ARGS__) |
#define | ATH5K_WARN(_sc, _fmt,...) ATH5K_PRINTK_LIMIT(_sc, KERN_WARNING, _fmt, ##__VA_ARGS__) |
#define | ATH5K_ERR(_sc, _fmt,...) ATH5K_PRINTK_LIMIT(_sc, KERN_ERR, _fmt, ##__VA_ARGS__) |
#define | AR5K_REG_SM(_val, _flags) (((_val) << _flags##_S) & (_flags)) |
#define | AR5K_REG_MS(_val, _flags) (((_val) & (_flags)) >> _flags##_S) |
#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) ath5k_hw_reg_write(ah, ath5k_hw_reg_read(ah, _reg) | (_flags), _reg) |
#define | AR5K_REG_DISABLE_BITS(ah, _reg, _flags) ath5k_hw_reg_write(ah, ath5k_hw_reg_read(ah, _reg) & ~(_flags), _reg) |
#define | AR5K_REG_READ_Q(ah, _reg, _queue) (ath5k_hw_reg_read(ah, _reg) & (1 << _queue)) \ |
#define | AR5K_REG_WRITE_Q(ah, _reg, _queue) ath5k_hw_reg_write(ah, (1 << _queue), _reg) |
#define | AR5K_Q_ENABLE_BITS(_reg, _queue) |
#define | AR5K_Q_DISABLE_BITS(_reg, _queue) |
#define | AR5K_REG_WAIT(_i) |
#define | AR5K_TUNE_DMA_BEACON_RESP 2 |
#define | AR5K_TUNE_SW_BEACON_RESP 10 |
#define | AR5K_TUNE_ADDITIONAL_SWBA_BACKOFF 0 |
#define | AR5K_TUNE_MIN_TX_FIFO_THRES 1 |
#define | AR5K_TUNE_MAX_TX_FIFO_THRES ((IEEE80211_MAX_FRAME_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_CCA_MAX_GOOD_VALUE -95 |
#define | AR5K_TUNE_MAX_TXPOWER 63 |
#define | AR5K_TUNE_DEFAULT_TXPOWER 25 |
#define | AR5K_TUNE_TPC_TXPOWER false |
#define | ATH5K_TUNE_CALIBRATION_INTERVAL_FULL 60000 /* 60 sec */ |
#define | ATH5K_TUNE_CALIBRATION_INTERVAL_SHORT 10000 /* 10 sec */ |
#define | ATH5K_TUNE_CALIBRATION_INTERVAL_ANI 1000 /* 1 sec */ |
#define | ATH5K_TX_COMPLETE_POLL_INT 3000 /* 3 sec */ |
#define | AR5K_INIT_CARR_SENSE_EN 1 |
#define | AR5K_INIT_CFG 0x00000000 |
#define | AR5K_INIT_CYCRSSI_THR1 2 |
#define | AR5K_INIT_RETRY_SHORT 7 |
#define | AR5K_INIT_RETRY_LONG 4 |
#define | AR5K_INIT_SLOT_TIME_TURBO 6 |
#define | AR5K_INIT_SLOT_TIME_DEFAULT 9 |
#define | AR5K_INIT_SLOT_TIME_HALF_RATE 13 |
#define | AR5K_INIT_SLOT_TIME_QUARTER_RATE 21 |
#define | AR5K_INIT_SLOT_TIME_B 20 |
#define | AR5K_SLOT_TIME_MAX 0xffff |
#define | AR5K_INIT_SIFS_TURBO 6 |
#define | AR5K_INIT_SIFS_DEFAULT_BG 10 |
#define | AR5K_INIT_SIFS_DEFAULT_A 16 |
#define | AR5K_INIT_SIFS_HALF_RATE 32 |
#define | AR5K_INIT_SIFS_QUARTER_RATE 64 |
#define | AR5K_INIT_OFDM_PREAMPLE_TIME 20 |
#define | AR5K_INIT_OFDM_PREAMBLE_TIME_MIN 14 |
#define | AR5K_INIT_OFDM_SYMBOL_TIME 4 |
#define | AR5K_INIT_OFDM_PLCP_BITS 22 |
#define | AR5K_INIT_RX_LAT_MAX 63 |
#define | AR5K_INIT_TX_LAT_A 54 |
#define | AR5K_INIT_TX_LAT_BG 384 |
#define | AR5K_INIT_TX_LAT_MIN 32 |
#define | AR5K_INIT_TX_LATENCY_5210 54 |
#define | AR5K_INIT_RX_LATENCY_5210 29 |
#define | AR5K_INIT_TXF2TXD_START_DEFAULT 14 |
#define | AR5K_INIT_TXF2TXD_START_DELAY_10MHZ 12 |
#define | AR5K_INIT_TXF2TXD_START_DELAY_5MHZ 13 |
#define | AR5K_SWITCH_SETTLING 5760 |
#define | AR5K_SWITCH_SETTLING_TURBO 7168 |
#define | AR5K_AGC_SETTLING 28 |
#define | AR5K_AGC_SETTLING_TURBO 37 |
#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_AR5312_R2 0x52 /* AP31 */ |
#define | AR5K_SREV_AR5212_V4 0x54 /* ??? */ |
#define | AR5K_SREV_AR5213 0x55 /* ??? */ |
#define | AR5K_SREV_AR5312_R7 0x57 /* AP30 */ |
#define | AR5K_SREV_AR2313_R8 0x58 /* AP43 */ |
#define | AR5K_SREV_AR5213A 0x59 /* Hainan */ |
#define | AR5K_SREV_AR2413 0x78 /* Griffin lite */ |
#define | AR5K_SREV_AR2414 0x70 /* Griffin */ |
#define | AR5K_SREV_AR2315_R6 0x86 /* AP51-Light */ |
#define | AR5K_SREV_AR2315_R7 0x87 /* AP51-Full */ |
#define | AR5K_SREV_AR5424 0x90 /* Condor */ |
#define | AR5K_SREV_AR2317_R1 0x90 /* AP61-Light */ |
#define | AR5K_SREV_AR2317_R2 0x91 /* AP61-Full */ |
#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 | AR5K_TXSTAT_ALTRATE 0x80 |
#define | AR5K_TXERR_XRETRY 0x01 |
#define | AR5K_TXERR_FILT 0x02 |
#define | AR5K_TXERR_FIFO 0x04 |
#define | AR5K_NUM_TX_QUEUES 10 |
#define | AR5K_NUM_TX_QUEUES_NOQCU 2 |
#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 | AR5K_BEACON_PERIOD 0x0000ffff |
#define | AR5K_BEACON_ENA 0x00800000 /*enable beacon xmit*/ |
#define | AR5K_BEACON_RESET_TSF 0x01000000 /*force a TSF reset*/ |
#define | TSF_TO_TU(_tsf) (u32)((_tsf) >> 10) |
#define | AR5K_SLOT_TIME_9 396 |
#define | AR5K_SLOT_TIME_20 880 |
#define | AR5K_SLOT_TIME_MAX 0xffff |
#define | AR5K_MAX_RATES 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 | 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_LED_INIT 0 /*IEEE80211_S_INIT*/ |
#define | AR5K_LED_SCAN 1 /*IEEE80211_S_SCAN*/ |
#define | AR5K_LED_AUTH 2 /*IEEE80211_S_AUTH*/ |
#define | AR5K_LED_ASSOC 3 /*IEEE80211_S_ASSOC*/ |
#define | AR5K_LED_RUN 4 /*IEEE80211_S_RUN*/ |
#define | AR5K_SOFTLED_PIN 0 |
#define | AR5K_SOFTLED_ON 0 |
#define | AR5K_SOFTLED_OFF 1 |
#define | ATH5K_NF_CAL_HIST_MAX 8 |
#define | ATH5K_LED_MAX_NAME_LEN 31 |
#define | AR5K_MAX_GPIO 10 |
#define | AR5K_MAX_RF_BANKS 8 |
#define | ATH_CHAN_MAX (14 + 14 + 14 + 252 + 20) |
#define | ATH_RXBUF 40 /* number of RX buffers */ |
#define | ATH_TXBUF 200 /* number of TX buffers */ |
#define | ATH_BCBUF 4 /* number of beacon buffers */ |
#define | ATH5K_TXQ_LEN_MAX (ATH_TXBUF / 4) /* bufs per queue */ |
#define | ATH5K_TXQ_LEN_LOW (ATH5K_TXQ_LEN_MAX / 2) /* low mark */ |
#define | ATH_STAT_INVALID 0 /* disable hardware accesses */ |
#define | ATH_STAT_PROMISC 1 |
#define | ATH_STAT_LEDSOFT 2 /* enable LED gpio status */ |
#define | ATH_STAT_STARTED 3 /* opened & irqs enabled */ |
#define | ah_modes ah_capabilities.cap_mode |
#define | ah_ee_version ah_capabilities.cap_eeprom.ee_version |
Variables | |
void const char * | level |
void const char const char * | fmt |
bool | ath5k_modparam_nohwcrypt |
struct ieee80211_ops | ath5k_hw_ops |
#define ah_ee_version ah_capabilities.cap_eeprom.ee_version |
#define AR5K_ASSERT_ENTRY | ( | _e, | |
_s | |||
) |
#define AR5K_BEACON_RESET_TSF 0x01000000 /*force a TSF reset*/ |
#define AR5K_MAX_RATES 32 |
DOC: Rate codes
Seems the ar5xxx hardware 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 (html unfriendly):
Rate code Rate (Kbps)
"S" indicates CCK rates with short preamble and "L" with long preamble.
AR5211 has different rate codes for CCK (802.11B) rates. It only uses the lowest 4 bits, so they are the same as above with a 0xF mask. (0xB, 0xA, 0x9 and 0x8 for 1M, 2M, 5.5M and 11M). We handle this in ath5k_setup_bands().
#define AR5K_Q_DISABLE_BITS | ( | _reg, | |
_queue | |||
) |
#define AR5K_Q_ENABLE_BITS | ( | _reg, | |
_queue | |||
) |
#define AR5K_REG_MASKED_BITS | ( | ah, | |
_reg, | |||
_flags, | |||
_mask | |||
) |
#define AR5K_REG_MS | ( | _val, | |
_flags | |||
) | (((_val) & (_flags)) >> _flags##_S) |
#define AR5K_REG_SM | ( | _val, | |
_flags | |||
) | (((_val) << _flags##_S) & (_flags)) |
#define AR5K_REG_WAIT | ( | _i | ) |
#define AR5K_REG_WRITE_BITS | ( | ah, | |
_reg, | |||
_flags, | |||
_val | |||
) |
#define AR5K_TUNE_MAX_TX_FIFO_THRES ((IEEE80211_MAX_FRAME_LEN / 64) + 1) |
#define AR5K_TXPOWER_CCK | ( | _r, | |
_v | |||
) |
#define AR5K_TXPOWER_OFDM | ( | _r, | |
_v | |||
) |
#define AR5K_TXQ_FLAG_BACKOFF_DISABLE 0x0200 /* Disable random post-backoff */ |
#define AR5K_TXQ_FLAG_CBRORNINT_ENABLE 0x0020 /* Enable CBRORN interrupt */ |
#define AR5K_TXQ_FLAG_CBRURNINT_ENABLE 0x0040 /* Enable CBRURN interrupt */ |
#define AR5K_TXQ_FLAG_COMPRESSION_ENABLE 0x2000 /* Enable hw compression -not implemented-*/ |
#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_QTRIGINT_ENABLE 0x0080 /* Enable QTRIG interrupt */ |
#define AR5K_TXQ_FLAG_RDYTIME_EXP_POLICY_ENABLE 0x0300 /* Enable ready time expiry policy (?)*/ |
#define AR5K_TXQ_FLAG_TXDESCINT_ENABLE 0x0008 /* Enable TXDESC interrupt -not used- */ |
#define AR5K_TXQ_FLAG_TXEOLINT_ENABLE 0x0004 /* Enable TXEOL interrupt -not used- */ |
#define AR5K_TXQ_FLAG_TXERRINT_ENABLE 0x0002 /* Enable TXERR interrupt */ |
#define AR5K_TXQ_FLAG_TXNOFRMINT_ENABLE 0x0100 /* Enable TXNOFRM interrupt */ |
#define AR5K_TXQ_FLAG_TXOKINT_ENABLE 0x0001 /* Enable TXOK interrupt */ |
#define AR5K_TXQ_FLAG_TXURNINT_ENABLE 0x0010 /* Enable TXURN interrupt */ |
#define ATH5K_ERR | ( | _sc, | |
_fmt, | |||
... | |||
) | ATH5K_PRINTK_LIMIT(_sc, KERN_ERR, _fmt, ##__VA_ARGS__) |
#define ATH5K_INFO | ( | _sc, | |
_fmt, | |||
... | |||
) | ATH5K_PRINTK(_sc, KERN_INFO, _fmt, ##__VA_ARGS__) |
#define ATH5K_PRINTK | ( | _sc, | |
_level, | |||
_fmt, | |||
... | |||
) | _ath5k_printk(_sc, _level, _fmt, ##__VA_ARGS__) |
#define ATH5K_PRINTK_LIMIT | ( | _sc, | |
_level, | |||
_fmt, | |||
... | |||
) |
#define ATH5K_TUNE_CALIBRATION_INTERVAL_ANI 1000 /* 1 sec */ |
#define ATH5K_TUNE_CALIBRATION_INTERVAL_FULL 60000 /* 60 sec */ |
#define ATH5K_TUNE_CALIBRATION_INTERVAL_SHORT 10000 /* 10 sec */ |
#define ATH5K_TXQ_LEN_LOW (ATH5K_TXQ_LEN_MAX / 2) /* low mark */ |
#define ATH5K_WARN | ( | _sc, | |
_fmt, | |||
... | |||
) | ATH5K_PRINTK_LIMIT(_sc, KERN_WARNING, _fmt, ##__VA_ARGS__) |
#define PCI_DEVICE_ID_3COM_2_3CRPAG175 0x0013 /* 3CRPAG175 (Atheros AR5212) */ |
#define PCI_DEVICE_ID_3COM_3CRDAG675 0x0013 /* 3CRDAG675 (Atheros AR5212) */ |
#define PCI_DEVICE_ID_ATHEROS_AR2413 0x001a /* AR2413 (Griffin-lite) */ |
#define PCI_DEVICE_ID_ATHEROS_AR5210_AP 0x0207 /* AR5210 (Early) */ |
#define PCI_DEVICE_ID_ATHEROS_AR5210_DEFAULT 0x1107 /* AR5210 (no eeprom) */ |
#define PCI_DEVICE_ID_ATHEROS_AR5211_DEFAULT 0x1112 /* AR5211 (no eeprom) */ |
#define PCI_DEVICE_ID_ATHEROS_AR5211_FPGA11B 0xf11b /* AR5211 (emulation board) */ |
#define PCI_DEVICE_ID_ATHEROS_AR5211_LEGACY 0xff12 /* AR5211 (emulation board) */ |
#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_AR5212_DEFAULT 0x1113 /* AR5212 (no eeprom) */ |
#define PCI_DEVICE_ID_ATHEROS_AR5212_FPGA 0xf013 /* AR5212 (emulation board) */ |
#define PCI_DEVICE_ID_ATHEROS_AR5212_IBM 0x1014 /* AR5212 (IBM MiniPCI) */ |
#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_AR5413 0x001b /* AR5413 (Eagle) */ |
#define PCI_DEVICE_ID_ATHEROS_AR5424 0x001c /* AR5424 (Condor PCI-E) */ |
enum ath5k_ant_mode |
enum ath5k_ant_mode - Antenna operation mode : Default antenna setup : Only antenna A is present : Only antenna B is present : STA locked on a single ap : AP with tx antenna set on tx desc : STA with tx antenna set on tx desc : Debug mode -A -> Rx, B-> Tx- : Used for boundary checks
For more infos on antenna control check out phy.c
enum ath5k_bw_mode |
enum ath5k_calibration_mask - Mask which calibration is active at the moment : Full calibration (AGC + SHORT) : Short calibration (NF + I/Q) : Noise Floor calibration : Adaptive Noise Immunity
enum ath5k_dmasize |
enum ath5k_dmasize - DMA size definitions (2^(n+2)) : 4Bytes : 8Bytes : 16Bytes : 32Bytes : 64Bytes (Default) : 128Bytes : 256Bytes : 512Bytes
These are used to set DMA burst size on hw
Note: Some platforms can't handle more than 4Bytes be careful on embedded boards.
enum ath5k_driver_mode |
DOC: Atheros XR
Some of this information is based on Documentation from:
http://madwifi-project.org/wiki/ChipsetFeatures/SuperAG
Atheros' eXtended Range - range enhancing extension is a modulation scheme that is supposed to double the link distance between an Atheros XR-enabled client device with an Atheros XR-enabled access point. This is achieved by increasing the receiver sensitivity up to, -105dBm, which is about 20dB above what the 802.11 specifications demand. In addition, new (proprietary) data rates are introduced: 3, 2, 1, 0.5 and 0.25 MBit/s.
Please note that can you either use XR or TURBO but you cannot use both, they are exclusive.
Also note that we do not plan to support XR mode at least for now. You can get a mode similar to XR by using 5MHz bwmode. DOC: Atheros SuperAG
In addition to XR we have another modulation scheme called TURBO mode that is supposed to provide a throughput transmission speed up to 40Mbit/s -60Mbit/s at a 108Mbit/s signaling rate achieved through the bonding of two 54Mbit/s 802.11g channels. To use this feature both ends must support it. There is also a distinction between "static" and "dynamic" turbo modes:
This article claims Super G sticks to bonding of channels 5 and 6 for USA:
http://www.pcworld.com/article/id,113428-page,1/article.html
The channel bonding seems to be driver specific though.
In addition to TURBO modes we also have the following features for even greater speed-up:
As with XR we also don't plan to support SuperAG features for now. You can get a mode similar to TURBO by using 40MHz bwmode. enum ath5k_driver_mode - PHY operation mode : 802.11a : 802.11b : 801.11g : Used for boundary checks
Do not change the order here, we use these as array indices and it also maps EEPROM structures.
enum ath5k_int |
enum ath5k_int - Hardware interrupt masks helpers : Frame successfully received : Request RX descriptor/Read RX descriptor : Frame reception failed : No frame received within a specified time period : Reached "End Of List", means we need more RX descriptors : Indicates we got RX FIFO overrun. Note that Rx overrun is not always fatal, on some chips we can continue operation without resetting the card, that's why AR5K_INT_FATAL is not common for all chips. : Mask to identify all RX related interrupts
: Frame transmission success : Request TX descriptor/Read TX status descriptor : Frame transmission failure : 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" : No frame was transmitted within a specified time period : Indicates we got TX FIFO underrun. In such case we should increase the TX trigger threshold. : Mask to identify all TX related interrupts
: Indicates the either Management Information Base counters or one of the PHY error counters reached the maximum value and should be read and cleared. : Software triggered interrupt. : RX PHY Error : RX Key cache miss : 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. : Beacon received with an RSSI value below our threshold : 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. : Beacon queue got triggered (DMA beacon alert) while empty. : Beacon with local station's TIM bit set : Beacon with DTIM bit and zero DTIM count received : DTIM sync lost : GPIO interrupt is used for RF Kill switches connected to our GPIO pins. : Beacon timeout, we waited after TBTT but got noting : We waited for CAB traffic after the beacon but got nothing or an incomplete CAB frame sequence. : A queue got it's CBR counter expired : A queue got triggered wile empty : A queue got triggered
: Fatal errors were encountered, typically caused by bus/DMA errors. Indicates we need to reset the card. : Used to clear and set the IER : Signals the card has been removed : Common interrupts shared among 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 among different MACs.
enum ath5k_pkt_type |
enum ath5k_power_mode |
enum ath5k_power_mode - Power management modes : Undefined : Allow card to sleep if possible : Force card to wake up : Force card to full sleep (DANGEROUS) : Allow to sleep for a specified duration
Currently only PM_AWAKE is used, FULL_SLEEP and NETWORK_SLEEP/AUTO are also known to have problems on some cards. This is not a big problem though because we can have almost the same effect as FULL_SLEEP by putting card on warm reset (it's almost powered down).
enum ath5k_radio |
enum ath5k_radio - PHY Chips : RF5110 (Fez) : RF5111 (Sombrero) : RF2112/5112(A) (Derby/Derby2) : RF2413/2414 (Griffin/Griffin-Lite) : RF5413/5414/5424 (Eagle/Condor) : RF2315/2316 (Cobra SoC) : RF2317 (Spider SoC) : RF2425/2417 (Swan/Nalla)
enum ath5k_rfgain |
enum ath5k_tx_queue |
enum ath5k_tx_queue - Queue types used to classify tx queues. : q is unused – see ath5k_hw_release_tx_queue : A normal data queue : The beacon queue : The after-beacon queue : Unscheduled Automatic Power Save Delivery queue
enum ath5k_tx_queue_id |
enum ath5k_tx_queue_id - Queue ID numbers as returned by the hw functions : Data queue on AR5210 (no QCU available) : Beacon queue on AR5210 (no QCU available) : Data queue min index : Data queue max index : Content after beacon queue : Beacon queue : Urgent Automatic Power Save Delivery,
Each number represents a hw queue. If hw does not support hw queues (eg 5210) all data goes in one queue.
enum ath5k_tx_queue_subtype - Queue sub-types to classify normal data queues : Background traffic : Best-effort (normal) traffic : Video traffic : Voice traffic
These are the 4 Access Categories as defined in WME spec. 0 is the lowest priority and 4 is the highest. Normal data that hasn't been classified goes to the Best Effort AC.
enum ath5k_version |
void __printf | ( | 3 | , |
4 | |||
) | const |
bool ath5k_channel_ok | ( | struct ath5k_hw * | ah, |
struct ieee80211_channel * | channel | ||
) |
ath5k_channel_ok() - Check if a channel is supported by the hw : The &struct ath5k_hw : The &struct ieee80211_channel
Note: We don't do any regulatory domain checks here, it's just a sanity check.
bool ath5k_hw_chan_has_spur_noise | ( | struct ath5k_hw * | ah, |
struct ieee80211_channel * | channel | ||
) |
ath5k_hw_chan_has_spur_noise() - Check if channel is sensitive to spur noise : The &struct ath5k_hw : The &struct ieee80211_channel
ath5k_hw_check_beacon_timers() - Check if the beacon timers are correct : The &struct ath5k_hw : beacon interval
This is a workaround for IBSS mode
The need for this function arises from the fact that we have 4 separate HW timer registers (TIMER0 - TIMER3), which are closely related to the next beacon target time (NBTT), and that the HW updates these timers separately based on the current TSF value. The hardware increments each timer by the beacon interval, when the local TSF converted to TU is equal to the value stored in the timer.
The reception of a beacon with the same BSSID can update the local HW TSF at any time - this is something we can't avoid. If the TSF jumps to a time which is later than the time stored in a timer, this timer will not be updated until the TSF in TU wraps around at 16 bit (the size of the timers) and reaches the time which is stored in the timer.
The problem is that these timers are closely related to TIMER0 (NBTT) and that they define a time "window". When the TSF jumps between two timers (e.g. ATIM and NBTT), the one in the past will be left behind (not updated), while the one in the future will be updated every beacon interval. This causes the window to get larger, until the TSF wraps around as described above and the timer which was left behind gets updated again. But - because the beacon interval is usually not an exact divisor of the size of the timers (16 bit), an unwanted "window" between these timers has developed!
This is especially important with the ATIM window, because during the ATIM window only ATIM frames and no data frames are allowed to be sent, which creates transmission pauses after each beacon. This symptom has been described as "ramping ping" because ping times increase linearly for some time and then drop down again. A wrong window on the DMA beacon timer has the same effect, so we check for these two conditions.
Returns true if O.K.
ath5k_hw_dma_init() - Initialize DMA unit : The &struct ath5k_hw
Set DMA size and pre-enable interrupts (driver handles tx/rx buffer setup and dma start/stop)
XXX: Save/restore RXDP/TXDP registers ?
ath5k_hw_dma_stop() - stop DMA unit : The &struct ath5k_hw
Stop tx/rx DMA and interrupts. Returns -EBUSY if tx or rx dma failed to stop.
XXX: Sometimes DMA unit hangs and we have stuck frames on tx queues, only a reset can fix that.
enum ath5k_rfgain ath5k_hw_gainf_calibrate | ( | struct ath5k_hw * | ah | ) |
ath5k_hw_gainf_calibrate() - Do a gain_F calibration : The &struct ath5k_hw
Main callback for thermal RF gain calibration engine Check for a new gain reading and schedule an adjustment if needed.
Returns one of enum ath5k_rfgain codes
int ath5k_hw_get_frame_duration | ( | struct ath5k_hw * | ah, |
enum ieee80211_band | band, | ||
int | len, | ||
struct ieee80211_rate * | rate, | ||
bool | shortpre | ||
) |
ath5k_hw_get_rxdp() - Get RX Descriptor's address : The &struct ath5k_hw
int ath5k_hw_get_tx_queueprops | ( | struct ath5k_hw * | ah, |
int | queue, | ||
struct ath5k_txq_info * | queue_info | ||
) |
ath5k_hw_get_tx_queueprops() - Get properties for a transmit queue : The &struct ath5k_hw : One of enum ath5k_tx_queue_id : The &struct ath5k_txq_info to fill
ath5k_hw_get_txdp() - Get TX Descriptor's address for a specific queue : The &struct ath5k_hw : 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 ?
ath5k_hw_init() - Check if hw is supported and init the needed structs : The &struct ath5k_hw associated with the device
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.
ath5k_hw_init_beacon_timers() - Initialize beacon timers : The &struct ath5k_hw : Next TBTT : Current beacon interval
This function is used to initialize beacon timers based on current operation mode and settings.
ath5k_hw_init_nfcal_hist() - Initialize NF calibration history buffer : The &struct ath5k_hw
ath5k_hw_is_intr_pending() - Check if we have pending interrupts : 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.
int ath5k_hw_nic_wakeup | ( | struct ath5k_hw * | ah, |
struct ieee80211_channel * | channel | ||
) |
ath5k_hw_nic_wakeup() - Force card out of sleep : The &struct ath5k_hw : The &struct ieee80211_channel
Bring up MAC + PHY Chips and program PLL NOTE: Channel is NULL for the initial wakeup.
Returns 0 on success, -EIO on hw failure or -EINVAL for false channel infos
DOC: Queue Control Unit (QCU)/DCF Control Unit (DCU) functions
Here we setup parameters for the 12 available TX queues. Note that on the various registers we can usually only map the first 10 of them so basically we have 10 queues to play with. Each queue has a matching QCU that controls when the queue will get triggered and multiple QCUs can be mapped to a single DCU that controls the various DFS parameters for the various queues. In our setup we have a 1:1 mapping between QCUs and DCUs allowing us to have different DFS settings for each queue.
When a frame goes into a TX queue, QCU decides when it'll trigger a transmission based on various criteria (such as how many data we have inside it's buffer or -if it's a beacon queue- if it's time to fire up the queue based on TSF etc), DCU adds backoff, IFSes etc and then a scheduler (arbitrator) decides the priority of each QCU based on it's configuration (e.g. beacons are always transmitted when they leave DCU bypassing all other frames from other queues waiting to be transmitted). After a frame leaves the DCU it goes to PCU for further processing and then to PHY for the actual transmission. ath5k_hw_num_tx_pending() - Get number of pending frames for a given queue : The &struct ath5k_hw : One of enum ath5k_tx_queue_id
ath5k_hw_on_hold() - Put device on hold : The &struct ath5k_hw
Put MAC and Baseband on warm reset and keep that state (don't clean sleep control register). After this MAC and Baseband are disabled and a full reset is needed to come back. This way we save as much power as possible without putting the card on full sleep.
Returns 0 on success or -EIO on error
void ath5k_hw_pcu_init | ( | struct ath5k_hw * | ah, |
enum nl80211_iftype | op_mode | ||
) |
ath5k_hw_pcu_init() - Initialize PCU : The &struct ath5k_hw : One of enum nl80211_iftype : One of enum ath5k_driver_mode
This function is used to initialize PCU by setting current operation mode and various other settings.
int ath5k_hw_phy_calibrate | ( | struct ath5k_hw * | ah, |
struct ieee80211_channel * | channel | ||
) |
ath5k_hw_phy_calibrate() - Perform a PHY calibration : The &struct ath5k_hw : The &struct ieee80211_channel
The main function we call from above to perform a short or full PHY calibration based on RF chip and current channel
u16 ath5k_hw_radio_revision | ( | struct ath5k_hw * | ah, |
enum ieee80211_band | band | ||
) |
DOC: PHY related functions
Here we handle the low-level functions related to baseband and analog frontend (RF) parts. This is by far the most complex part of the hw code so make sure you know what you are doing.
Here is a list of what this is all about:
Also have in mind we never got documentation for most of these functions, what we have comes mostly from Atheros's code, reverse engineering and patent docs/presentations etc. ath5k_hw_radio_revision() - Get the PHY Chip revision : The &struct ath5k_hw : One of enum ieee80211_band
Returns the revision number of a 2GHz, 5GHz or single chip radio.
DOC: Reset function and helpers
Here we implement the main reset routine, used to bring the card to a working state and ready to receive. We also handle routines that don't fit on other places such as clock, sleep and power control ath5k_hw_register_timeout() - Poll a register for a flag/field change : The &struct ath5k_hw : The register to read : The flag/field to check on the register : The field value we expect (if we check a field) : Instead of checking if the flag got cleared, check if it got set
Some registers contain flags that indicate that an operation is running. We use this function to poll these registers and check if these flags get cleared. We also use it to poll a register field (containing multiple flags) until it gets a specific value.
Returns -EAGAIN if we exceeded AR5K_TUNE_REGISTER_TIMEOUT * 15us or 0
ath5k_hw_release_tx_queue() - Set a transmit queue inactive : The &struct ath5k_hw : One of enum ath5k_tx_queue_id
int ath5k_hw_reset | ( | struct ath5k_hw * | ah, |
enum nl80211_iftype | op_mode, | ||
struct ieee80211_channel * | channel, | ||
bool | fast, | ||
bool | skip_pcu | ||
) |
ath5k_hw_reset() - The main reset function : The &struct ath5k_hw : One of enum nl80211_iftype : The &struct ieee80211_channel : Enable fast channel switching : Skip pcu initialization
This is the function we call each time we want to (re)initialize the card and pass new settings to hw. We also call it when hw runs into trouble to make it come back to a working state.
Returns 0 on success, -EINVAL on false op_mode or channel infos, or -EIO on failure.
ath5k_hw_reset_tsf() - Force a TSF reset : The &struct ath5k_hw
Forces a TSF reset on PCU
DOC: RF Gain optimization
This code is used to optimize RF gain on different environments (temperature mostly) based on feedback from a power detector.
It's only used on RF5111 and RF5112, later RF chips seem to have auto adjustment on hw -notice they have a much smaller BANK 7 and no gain optimization ladder-.
For more infos check out this patent doc "http://www.freepatentsonline.com/7400691.html"
This paper describes power drops as seen on the receiver due to probe packets "http://www.cnri.dit.ie/publications/ICT08%20-%20Practical%20Issues %20of%20Power%20Control.pdf"
And this is the MadWiFi bug entry related to the above "http://madwifi-project.org/ticket/1659" with various measurements and diagrams ath5k_hw_rfgain_opt_init() - Initialize ah_gain during attach : The &struct ath5k_hw
ath5k_hw_set_antenna_mode() - Set antenna operating mode : The &struct ath5k_hw : One of enum ath5k_ant_mode
ath5k_hw_set_bssid_mask() - Filter out bssids we listen : The &struct ath5k_hw : The BSSID mask to set (array of octets)
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.
For more information check out ../hw.c of the common ath module.
ath5k_hw_set_coverage_class() - Set IEEE 802.11 coverage class : The &struct ath5k_hw : IEEE 802.11 coverage class number
Sets IFS intervals and ACK/CTS timeouts for given coverage class.
ath5k_hw_set_gpio_intr() - Initialize the GPIO interrupt (RFKill switch) : The &struct ath5k_hw : The GPIO pin to use : True to generate interrupt on active pin (high)
This function is used to set up the GPIO interrupt for the hw RFKill switch. That switch is connected to a GPIO pin and it's number is stored on EEPROM. It can either open or close the circuit to indicate that we should disable RF/Wireless to save power (we also get that from EEPROM).
ath5k_hw_set_imr() - Set interrupt mask : The &struct ath5k_hw : 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.
DOC: GPIO/LED functions
Here we control the 6 bidirectional GPIO pins provided by the hw. We can set a GPIO pin to be an input or an output pin on GPIO control register and then read or set its status from GPIO data input/output registers.
We also control the two LED pins provided by the hw, LED_0 is our "power" LED and LED_1 is our "network activity" LED but many scenarios are available from hw. Vendors might also provide LEDs connected to the GPIO pins, we handle them through the LED subsystem on led.c ath5k_hw_set_ledstate() - Set led state : The &struct ath5k_hw : One of AR5K_LED_*
Used to set the LED blinking state. This only works for the LED connected to the LED_0, LED_1 pins, not the GPIO based.
ath5k_hw_set_mcast_filter() - Set multicast filter : The &struct ath5k_hw : Lower 32bits of muticast filter : Higher 16bits of multicast filter
int ath5k_hw_set_opmode | ( | struct ath5k_hw * | ah, |
enum nl80211_iftype | op_mode | ||
) |
ath5k_hw_set_rxdp() - Set RX Descriptor's address : The &struct ath5k_hw : RX descriptor address
Returns -EIO if rx is active
int ath5k_hw_set_tx_queueprops | ( | struct ath5k_hw * | ah, |
int | queue, | ||
const struct ath5k_txq_info * | qinfo | ||
) |
ath5k_hw_set_tx_queueprops() - Set properties for a transmit queue : The &struct ath5k_hw : One of enum ath5k_tx_queue_id : The &struct ath5k_txq_info to use
Returns 0 on success or -EIO if queue is inactive
ath5k_hw_set_txdp() - Set TX Descriptor's address for a specific queue : The &struct ath5k_hw : The hw queue number : The physical address
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.
int ath5k_hw_setup_mrr_tx_desc | ( | struct ath5k_hw * | ah, |
struct ath5k_desc * | desc, | ||
u_int | tx_rate1, | ||
u_int | tx_tries1, | ||
u_int | tx_rate2, | ||
u_int | tx_tries2, | ||
u_int | tx_rate3, | ||
u_int | tx_tries3 | ||
) |
ath5k_hw_setup_mrr_tx_desc() - Initialize an MRR tx control descriptor : The &struct ath5k_hw : The &struct ath5k_desc : HW idx for rate used on transmission series 1 : Max number of retransmissions for transmission series 1 : HW idx for rate used on transmission series 2 : Max number of retransmissions for transmission series 2 : HW idx for rate used on transmission series 3 : Max number of retransmissions for transmission series 3
Multi rate retry (MRR) tx control descriptors are available only on AR5212 MACs, they are part of the normal 4-word tx control descriptor (see above) but we handle them through a separate function for better abstraction.
Returns 0 on success or -EINVAL on invalid input
int ath5k_hw_setup_rx_desc | ( | struct ath5k_hw * | ah, |
struct ath5k_desc * | desc, | ||
u32 | size, | ||
unsigned int | flags | ||
) |
ath5k_hw_setup_rx_desc() - Initialize an rx control descriptor : The &struct ath5k_hw : The &struct ath5k_desc : RX buffer length in bytes : One of AR5K_RXDESC_* flags
int ath5k_hw_setup_tx_queue | ( | struct ath5k_hw * | ah, |
enum ath5k_tx_queue | queue_type, | ||
struct ath5k_txq_info * | queue_info | ||
) |
ath5k_hw_setup_tx_queue() - Initialize a transmit queue : The &struct ath5k_hw : One of enum ath5k_tx_queue : The &struct ath5k_txq_info to use
Returns 0 on success, -EINVAL on invalid arguments
ath5k_hw_start_rx_dma() - Start DMA receive : The &struct ath5k_hw
ath5k_hw_start_rx_pcu() - Start RX engine : 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
ath5k_hw_start_tx_dma() - Start DMA transmit for a specific queue : The &struct ath5k_hw : 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).
ath5k_hw_update_mib_counters() - Update MIB counters (mac layer statistics) : The &struct ath5k_hw
Reads MIB counters from PCU and updates sw statistics. Is called after a MIB interrupt, because one of these counters might have reached their maximum and triggered the MIB interrupt, to let us read and clear the counter.
NOTE: Is called in interrupt context!
ath5k_hw_update_tx_triglevel() - Update tx trigger level : The &struct ath5k_hw : 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 its data. Lowering this results sending small frames more quickly but can lead to tx underruns, raising it a lot can result other problems. 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 reached maximum/minimum.
XXX: Link this with tx DMA size ? XXX2: Use it to save interrupts ?
ath5k_hw_write_initvals() - Write initial chip-specific register dump : The &struct ath5k_hw : One of enum ath5k_driver_mode : Skip PCU registers
Write initial chip-specific register dump, to get the chipset on a clean and ready-to-work state after warm reset.
Definition at line 1440 of file initvals.c.
struct ieee80211_ops ath5k_hw_ops |
Definition at line 788 of file mac80211-ops.c.