iPXE
Data Structures | Macros | Enumerations | Functions | Variables
hw.h File Reference
#include <errno.h>
#include "mac.h"
#include "ani.h"
#include "eeprom.h"
#include "calib.h"
#include "reg.h"
#include "phy.h"
#include "../regd.h"

Go to the source code of this file.

Data Structures

struct  ath9k_hw_capabilities
 
struct  ath9k_ops_config
 
struct  ath9k_hw_cal_data
 
struct  ath9k_channel
 
struct  ath9k_beacon_state
 
struct  chan_centers
 
struct  ath9k_hw_version
 
struct  ath_gen_timer_configuration
 
struct  ath_gen_timer
 
struct  ath_gen_timer_table
 
struct  ath_hw_antcomb_conf
 
struct  ath_hw_radar_conf
 struct ath_hw_radar_conf - radar detection initialization parameters More...
 
struct  ath_hw_private_ops
 struct ath_hw_private_ops - callbacks used internally by hardware code More...
 
struct  ath_hw_ops
 struct ath_hw_ops - callbacks used by hardware code and driver code More...
 
struct  ath_nf_limits
 
struct  ath_hw
 
struct  ath_bus_ops
 

Macros

#define ERRFILE   ERRFILE_ath9k
 
#define ATHEROS_VENDOR_ID   0x168c
 
#define AR5416_DEVID_PCI   0x0023
 
#define AR5416_DEVID_PCIE   0x0024
 
#define AR9160_DEVID_PCI   0x0027
 
#define AR9280_DEVID_PCI   0x0029
 
#define AR9280_DEVID_PCIE   0x002a
 
#define AR9285_DEVID_PCIE   0x002b
 
#define AR2427_DEVID_PCIE   0x002c
 
#define AR9287_DEVID_PCI   0x002d
 
#define AR9287_DEVID_PCIE   0x002e
 
#define AR9300_DEVID_PCIE   0x0030
 
#define AR9300_DEVID_AR9340   0x0031
 
#define AR9300_DEVID_AR9485_PCIE   0x0032
 
#define AR5416_AR9100_DEVID   0x000b
 
#define AR_SUBVENDOR_ID_NOG   0x0e11
 
#define AR_SUBVENDOR_ID_NEW_A   0x7065
 
#define AR5416_MAGIC   0x19641014
 
#define AR9280_COEX2WIRE_SUBSYSID   0x309b
 
#define AT9285_COEX3WIRE_SA_SUBSYSID   0x30aa
 
#define AT9285_COEX3WIRE_DA_SUBSYSID   0x30ab
 
#define AR9300_NUM_BT_WEIGHTS   4
 
#define AR9300_NUM_WLAN_WEIGHTS   4
 
#define ATH_AMPDU_LIMIT_MAX   (64 * 1024 - 1)
 
#define ATH_DEFAULT_NOISE_FLOOR   -95
 
#define ATH9K_RSSI_BAD   -128
 
#define ATH9K_NUM_CHANNELS   38
 
#define REG_WRITE(_ah, _reg, _val)   (_ah)->reg_ops.write((_ah), (_val), (_reg))
 
#define REG_READ(_ah, _reg)   (_ah)->reg_ops.read((_ah), (_reg))
 
#define REG_READ_MULTI(_ah, _addr, _val, _cnt)   (_ah)->reg_ops.multi_read((_ah), (_addr), (_val), (_cnt))
 
#define REG_RMW(_ah, _reg, _set, _clr)   (_ah)->reg_ops.rmw((_ah), (_reg), (_set), (_clr))
 
#define ENABLE_REGWRITE_BUFFER(_ah)
 
#define REGWRITE_BUFFER_FLUSH(_ah)
 
#define SM(_v, _f)   (((_v) << _f##_S) & _f)
 
#define MS(_v, _f)   (((_v) & _f) >> _f##_S)
 
#define REG_RMW_FIELD(_a, _r, _f, _v)   REG_RMW(_a, _r, (((_v) << _f##_S) & _f), (_f))
 
#define REG_READ_FIELD(_a, _r, _f)   (((REG_READ(_a, _r) & _f) >> _f##_S))
 
#define REG_SET_BIT(_a, _r, _f)   REG_RMW(_a, _r, (_f), 0)
 
#define REG_CLR_BIT(_a, _r, _f)   REG_RMW(_a, _r, 0, (_f))
 
#define DO_DELAY(x)
 
#define REG_WRITE_ARRAY(iniarray, column, regWr)   ath9k_hw_write_array(ah, iniarray, column, &(regWr))
 
#define AR_GPIO_OUTPUT_MUX_AS_OUTPUT   0
 
#define AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED   1
 
#define AR_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED   2
 
#define AR_GPIO_OUTPUT_MUX_AS_TX_FRAME   3
 
#define AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL   4
 
#define AR_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED   5
 
#define AR_GPIO_OUTPUT_MUX_AS_MAC_POWER_LED   6
 
#define AR_GPIOD_MASK   0x00001FFF
 
#define AR_GPIO_BIT(_gpio)   (1 << (_gpio))
 
#define BASE_ACTIVATE_DELAY   100
 
#define RTC_PLL_SETTLE_DELAY   (AR_SREV_9340(ah) ? 1000 : 100)
 
#define COEF_SCALE_S   24
 
#define HT40_CHANNEL_CENTER_SHIFT   10
 
#define ATH9K_ANTENNA0_CHAINMASK   0x1
 
#define ATH9K_ANTENNA1_CHAINMASK   0x2
 
#define ATH9K_NUM_DMA_DEBUG_REGS   8
 
#define ATH9K_NUM_QUEUES   10
 
#define MAX_RATE_POWER   63
 
#define AH_WAIT_TIMEOUT   100000 /* (us) */
 
#define AH_TSF_WRITE_TIMEOUT   100 /* (us) */
 
#define AH_TIME_QUANTUM   10
 
#define AR_KEYTABLE_SIZE   128
 
#define POWER_UP_TIME   10000
 
#define SPUR_RSSI_THRESH   40
 
#define CAB_TIMEOUT_VAL   10
 
#define BEACON_TIMEOUT_VAL   10
 
#define MIN_BEACON_TIMEOUT_VAL   1
 
#define SLEEP_SLOP   3
 
#define INIT_CONFIG_STATUS   0x00000000
 
#define INIT_RSSI_THR   0x00000700
 
#define INIT_BCON_CNTRL_REG   0x00000000
 
#define TU_TO_USEC(_tu)   ((_tu) << 10)
 
#define ATH9K_HW_RX_HP_QDEPTH   16
 
#define ATH9K_HW_RX_LP_QDEPTH   128
 
#define PAPRD_GAIN_TABLE_ENTRIES   32
 
#define PAPRD_TABLE_SZ   24
 
#define SPUR_DISABLE   0
 
#define SPUR_ENABLE_IOCTL   1
 
#define SPUR_ENABLE_EEPROM   2
 
#define AR_SPUR_5413_1   1640
 
#define AR_SPUR_5413_2   1200
 
#define AR_NO_SPUR   0x8000
 
#define AR_BASE_FREQ_2GHZ   2300
 
#define AR_BASE_FREQ_5GHZ   4900
 
#define AR_SPUR_FEEQ_BOUND_HT40   19
 
#define AR_SPUR_FEEQ_BOUND_HT20   10
 
#define CHANNEL_CW_INT   0x00002
 
#define CHANNEL_CCK   0x00020
 
#define CHANNEL_OFDM   0x00040
 
#define CHANNEL_2GHZ   0x00080
 
#define CHANNEL_5GHZ   0x00100
 
#define CHANNEL_PASSIVE   0x00200
 
#define CHANNEL_DYN   0x00400
 
#define CHANNEL_HALF   0x04000
 
#define CHANNEL_QUARTER   0x08000
 
#define CHANNEL_HT20   0x10000
 
#define CHANNEL_HT40PLUS   0x20000
 
#define CHANNEL_HT40MINUS   0x40000
 
#define CHANNEL_A   (CHANNEL_5GHZ|CHANNEL_OFDM)
 
#define CHANNEL_B   (CHANNEL_2GHZ|CHANNEL_CCK)
 
#define CHANNEL_G   (CHANNEL_2GHZ|CHANNEL_OFDM)
 
#define CHANNEL_G_HT20   (CHANNEL_2GHZ|CHANNEL_HT20)
 
#define CHANNEL_A_HT20   (CHANNEL_5GHZ|CHANNEL_HT20)
 
#define CHANNEL_G_HT40PLUS   (CHANNEL_2GHZ|CHANNEL_HT40PLUS)
 
#define CHANNEL_G_HT40MINUS   (CHANNEL_2GHZ|CHANNEL_HT40MINUS)
 
#define CHANNEL_A_HT40PLUS   (CHANNEL_5GHZ|CHANNEL_HT40PLUS)
 
#define CHANNEL_A_HT40MINUS   (CHANNEL_5GHZ|CHANNEL_HT40MINUS)
 
#define CHANNEL_ALL
 
#define IS_CHAN_G(_c)
 
#define IS_CHAN_OFDM(_c)   (((_c)->channelFlags & CHANNEL_OFDM) != 0)
 
#define IS_CHAN_5GHZ(_c)   (((_c)->channelFlags & CHANNEL_5GHZ) != 0)
 
#define IS_CHAN_2GHZ(_c)   (((_c)->channelFlags & CHANNEL_2GHZ) != 0)
 
#define IS_CHAN_HALF_RATE(_c)   (((_c)->channelFlags & CHANNEL_HALF) != 0)
 
#define IS_CHAN_QUARTER_RATE(_c)   (((_c)->channelFlags & CHANNEL_QUARTER) != 0)
 
#define IS_CHAN_A_FAST_CLOCK(_ah, _c)
 
#define IS_CHAN_B(_c)   ((_c)->chanmode == CHANNEL_B)
 
#define IS_CHAN_HT20(_c)
 
#define IS_CHAN_HT40(_c)
 
#define IS_CHAN_HT(_c)   (IS_CHAN_HT20((_c)) || IS_CHAN_HT40((_c)))
 
#define ATH9K_BEACON_PERIOD   0x0000ffff
 
#define ATH9K_TSFOOR_THRESHOLD   0x00004240 /* 16k us */
 
#define ATH_MAX_GEN_TIMER   16
 
#define AR_GENTMR_BIT(_index)   (1 << (_index))
 
#define debruijn32   0x077CB531U
 
#define AH_USE_EEPROM   0x1
 
#define AH_UNPLUGGED   0x2 /* The card has been physically removed. */
 
#define totalPowerMeasI   meas0.unsign
 
#define totalPowerMeasQ   meas1.unsign
 
#define totalIqCorrMeas   meas2.sign
 
#define totalAdcIOddPhase   meas0.unsign
 
#define totalAdcIEvenPhase   meas1.unsign
 
#define totalAdcQOddPhase   meas2.unsign
 
#define totalAdcQEvenPhase   meas3.unsign
 
#define totalAdcDcOffsetIOddPhase   meas0.sign
 
#define totalAdcDcOffsetIEvenPhase   meas1.sign
 
#define totalAdcDcOffsetQOddPhase   meas2.sign
 
#define totalAdcDcOffsetQEvenPhase   meas3.sign
 
#define ATH_PCIE_CAP_LINK_CTRL   0x70
 
#define ATH_PCIE_CAP_LINK_L0S   1
 
#define ATH_PCIE_CAP_LINK_L1   2
 
#define ATH9K_CLOCK_RATE_CCK   22
 
#define ATH9K_CLOCK_RATE_5GHZ_OFDM   40
 
#define ATH9K_CLOCK_RATE_2GHZ_OFDM   44
 
#define ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM   44
 

Enumerations

enum  ath_hw_txq_subtype { ATH_TXQ_AC_BE = 0 }
 
enum  ath_ini_subsys { ATH_INI_PRE = 0, ATH_INI_CORE, ATH_INI_POST, ATH_INI_NUM_SPLIT }
 
enum  ath9k_hw_caps {
  ATH9K_HW_CAP_HT = BIT(0), ATH9K_HW_CAP_RFSILENT = BIT(1), ATH9K_HW_CAP_CST = BIT(2), ATH9K_HW_CAP_AUTOSLEEP = BIT(4),
  ATH9K_HW_CAP_4KB_SPLITTRANS = BIT(5), ATH9K_HW_CAP_EDMA = BIT(6), ATH9K_HW_CAP_RAC_SUPPORTED = BIT(7), ATH9K_HW_CAP_LDPC = BIT(8),
  ATH9K_HW_CAP_FASTCLOCK = BIT(9), ATH9K_HW_CAP_SGI_20 = BIT(10), ATH9K_HW_CAP_PAPRD = BIT(11), ATH9K_HW_CAP_ANT_DIV_COMB = BIT(12),
  ATH9K_HW_CAP_2GHZ = BIT(13), ATH9K_HW_CAP_5GHZ = BIT(14), ATH9K_HW_CAP_APM = BIT(15)
}
 
enum  ath9k_int {
  ATH9K_INT_RX = 0x00000001, ATH9K_INT_RXDESC = 0x00000002, ATH9K_INT_RXHP = 0x00000001, ATH9K_INT_RXLP = 0x00000002,
  ATH9K_INT_RXNOFRM = 0x00000008, ATH9K_INT_RXEOL = 0x00000010, ATH9K_INT_RXORN = 0x00000020, ATH9K_INT_TX = 0x00000040,
  ATH9K_INT_TXDESC = 0x00000080, ATH9K_INT_TIM_TIMER = 0x00000100, ATH9K_INT_BB_WATCHDOG = 0x00000400, ATH9K_INT_TXURN = 0x00000800,
  ATH9K_INT_MIB = 0x00001000, ATH9K_INT_RXPHY = 0x00004000, ATH9K_INT_RXKCM = 0x00008000, ATH9K_INT_SWBA = 0x00010000,
  ATH9K_INT_BMISS = 0x00040000, ATH9K_INT_BNR = 0x00100000, ATH9K_INT_TIM = 0x00200000, ATH9K_INT_DTIM = 0x00400000,
  ATH9K_INT_DTIMSYNC = 0x00800000, ATH9K_INT_GPIO = 0x01000000, ATH9K_INT_CABEND = 0x02000000, ATH9K_INT_TSFOOR = 0x04000000,
  ATH9K_INT_GENTIMER = 0x08000000, ATH9K_INT_CST = 0x10000000, ATH9K_INT_GTT = 0x20000000, ATH9K_INT_FATAL = 0x40000000,
  ATH9K_INT_GLOBAL = 0x80000000, ATH9K_INT_BMISC, ATH9K_INT_COMMON, ATH9K_INT_NOCARD = 0xffffffff
}
 
enum  ath9k_power_mode { ATH9K_PM_AWAKE = 0, ATH9K_PM_FULL_SLEEP, ATH9K_PM_NETWORK_SLEEP, ATH9K_PM_UNDEFINED }
 
enum  ath9k_tp_scale {
  ATH9K_TP_SCALE_MAX = 0, ATH9K_TP_SCALE_50, ATH9K_TP_SCALE_25, ATH9K_TP_SCALE_12,
  ATH9K_TP_SCALE_MIN
}
 
enum  ser_reg_mode { SER_REG_MODE_OFF = 0, SER_REG_MODE_ON = 1, SER_REG_MODE_AUTO = 2 }
 
enum  ath9k_rx_qtype { ATH9K_RX_QUEUE_HP, ATH9K_RX_QUEUE_LP, ATH9K_RX_QUEUE_MAX }
 
enum  { ATH9K_RESET_POWER_ON, ATH9K_RESET_WARM, ATH9K_RESET_COLD }
 

Functions

 FILE_LICENCE (BSD2)
 
 FILE_SECBOOT (FORBIDDEN)
 
static struct ath_commonath9k_hw_common (struct ath_hw *ah)
 
static struct ath_regulatoryath9k_hw_regulatory (struct ath_hw *ah)
 
static struct ath_hw_private_opsath9k_hw_private_ops (struct ath_hw *ah)
 
static struct ath_hw_opsath9k_hw_ops (struct ath_hw *ah)
 
static u8 get_streams (int mask)
 
const char * ath9k_hw_probe (u16 vendorid, u16 devid)
 
void ath9k_hw_deinit (struct ath_hw *ah)
 
int ath9k_hw_init (struct ath_hw *ah)
 
int ath9k_hw_reset (struct ath_hw *ah, struct ath9k_channel *chan, struct ath9k_hw_cal_data *caldata, int bChannelChange)
 
int ath9k_hw_fill_cap_info (struct ath_hw *ah)
 
u32 ath9k_regd_get_ctl (struct ath_regulatory *reg, struct ath9k_channel *chan)
 
void ath9k_hw_cfg_gpio_input (struct ath_hw *ah, u32 gpio)
 
u32 ath9k_hw_gpio_get (struct ath_hw *ah, u32 gpio)
 
void ath9k_hw_cfg_output (struct ath_hw *ah, u32 gpio, u32 ah_signal_type)
 
void ath9k_hw_set_gpio (struct ath_hw *ah, u32 gpio, u32 val)
 
u32 ath9k_hw_getdefantenna (struct ath_hw *ah)
 
void ath9k_hw_setantenna (struct ath_hw *ah, u32 antenna)
 
int ath9k_hw_wait (struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout)
 
void ath9k_hw_write_array (struct ath_hw *ah, struct ar5416IniArray *array, int column, unsigned int *writecnt)
 
u32 ath9k_hw_reverse_bits (u32 val, u32 n)
 
u16 ath9k_hw_computetxtime (struct ath_hw *ah, u8 phy, int kbps, u32 frameLen, u16 rateix, int shortPreamble)
 
void ath9k_hw_get_channel_centers (struct ath_hw *ah, struct ath9k_channel *chan, struct chan_centers *centers)
 
u32 ath9k_hw_getrxfilter (struct ath_hw *ah)
 
void ath9k_hw_setrxfilter (struct ath_hw *ah, u32 bits)
 
int ath9k_hw_phy_disable (struct ath_hw *ah)
 
int ath9k_hw_disable (struct ath_hw *ah)
 
void ath9k_hw_set_txpowerlimit (struct ath_hw *ah, u32 limit, int test)
 
void ath9k_hw_setopmode (struct ath_hw *ah)
 
void ath9k_hw_setmcastfilter (struct ath_hw *ah, u32 filter0, u32 filter1)
 
void ath9k_hw_setbssidmask (struct ath_hw *ah)
 
void ath9k_hw_write_associd (struct ath_hw *ah)
 
void ath9k_hw_init_global_settings (struct ath_hw *ah)
 
u32 ar9003_get_pll_sqsum_dvc (struct ath_hw *ah)
 
void ath9k_hw_set11nmac2040 (struct ath_hw *ah)
 
int ath9k_hw_check_alive (struct ath_hw *ah)
 
int ath9k_hw_setpower (struct ath_hw *ah, enum ath9k_power_mode mode)
 
void ath9k_hw_name (struct ath_hw *ah, char *hw_name, size_t len)
 
void ath9k_hw_htc_resetinit (struct ath_hw *ah)
 
void ath9k_hw_get_delta_slope_vals (struct ath_hw *ah, u32 coef_scaled, u32 *coef_mantissa, u32 *coef_exponent)
 
void ar9002_hw_cck_chan14_spread (struct ath_hw *ah)
 
int ar9002_hw_rf_claim (struct ath_hw *ah)
 
void ar9002_hw_enable_async_fifo (struct ath_hw *ah)
 
void ar9002_hw_update_async_fifo (struct ath_hw *ah)
 
void ar9002_hw_enable_wep_aggregation (struct ath_hw *ah)
 
void ar9003_hw_disable_phy_restart (struct ath_hw *ah)
 
void ar5008_hw_attach_phy_ops (struct ath_hw *ah)
 
void ar9002_hw_attach_phy_ops (struct ath_hw *ah)
 
void ar9003_hw_attach_phy_ops (struct ath_hw *ah)
 
void ar9002_hw_attach_calib_ops (struct ath_hw *ah)
 
void ar9003_hw_attach_calib_ops (struct ath_hw *ah)
 
void ar9002_hw_attach_ops (struct ath_hw *ah)
 
void ar9003_hw_attach_ops (struct ath_hw *ah)
 
void ar9002_hw_load_ani_reg (struct ath_hw *ah, struct ath9k_channel *chan)
 
void ath9k_ani_reset (struct ath_hw *ah, int is_scanning)
 
void ath9k_hw_proc_mib_event (struct ath_hw *ah)
 
void ath9k_hw_ani_monitor (struct ath_hw *ah, struct ath9k_channel *chan)
 

Variables

int modparam_force_new_ani
 

Macro Definition Documentation

◆ ERRFILE

#define ERRFILE   ERRFILE_ath9k

Definition at line 39 of file hw.h.

◆ ATHEROS_VENDOR_ID

#define ATHEROS_VENDOR_ID   0x168c

Definition at line 41 of file hw.h.

◆ AR5416_DEVID_PCI

#define AR5416_DEVID_PCI   0x0023

Definition at line 43 of file hw.h.

◆ AR5416_DEVID_PCIE

#define AR5416_DEVID_PCIE   0x0024

Definition at line 44 of file hw.h.

◆ AR9160_DEVID_PCI

#define AR9160_DEVID_PCI   0x0027

Definition at line 45 of file hw.h.

◆ AR9280_DEVID_PCI

#define AR9280_DEVID_PCI   0x0029

Definition at line 46 of file hw.h.

◆ AR9280_DEVID_PCIE

#define AR9280_DEVID_PCIE   0x002a

Definition at line 47 of file hw.h.

◆ AR9285_DEVID_PCIE

#define AR9285_DEVID_PCIE   0x002b

Definition at line 48 of file hw.h.

◆ AR2427_DEVID_PCIE

#define AR2427_DEVID_PCIE   0x002c

Definition at line 49 of file hw.h.

◆ AR9287_DEVID_PCI

#define AR9287_DEVID_PCI   0x002d

Definition at line 50 of file hw.h.

◆ AR9287_DEVID_PCIE

#define AR9287_DEVID_PCIE   0x002e

Definition at line 51 of file hw.h.

◆ AR9300_DEVID_PCIE

#define AR9300_DEVID_PCIE   0x0030

Definition at line 52 of file hw.h.

◆ AR9300_DEVID_AR9340

#define AR9300_DEVID_AR9340   0x0031

Definition at line 53 of file hw.h.

◆ AR9300_DEVID_AR9485_PCIE

#define AR9300_DEVID_AR9485_PCIE   0x0032

Definition at line 54 of file hw.h.

◆ AR5416_AR9100_DEVID

#define AR5416_AR9100_DEVID   0x000b

Definition at line 56 of file hw.h.

◆ AR_SUBVENDOR_ID_NOG

#define AR_SUBVENDOR_ID_NOG   0x0e11

Definition at line 58 of file hw.h.

◆ AR_SUBVENDOR_ID_NEW_A

#define AR_SUBVENDOR_ID_NEW_A   0x7065

Definition at line 59 of file hw.h.

◆ AR5416_MAGIC

#define AR5416_MAGIC   0x19641014

Definition at line 60 of file hw.h.

◆ AR9280_COEX2WIRE_SUBSYSID

#define AR9280_COEX2WIRE_SUBSYSID   0x309b

Definition at line 62 of file hw.h.

◆ AT9285_COEX3WIRE_SA_SUBSYSID

#define AT9285_COEX3WIRE_SA_SUBSYSID   0x30aa

Definition at line 63 of file hw.h.

◆ AT9285_COEX3WIRE_DA_SUBSYSID

#define AT9285_COEX3WIRE_DA_SUBSYSID   0x30ab

Definition at line 64 of file hw.h.

◆ AR9300_NUM_BT_WEIGHTS

#define AR9300_NUM_BT_WEIGHTS   4

Definition at line 66 of file hw.h.

◆ AR9300_NUM_WLAN_WEIGHTS

#define AR9300_NUM_WLAN_WEIGHTS   4

Definition at line 67 of file hw.h.

◆ ATH_AMPDU_LIMIT_MAX

#define ATH_AMPDU_LIMIT_MAX   (64 * 1024 - 1)

Definition at line 69 of file hw.h.

◆ ATH_DEFAULT_NOISE_FLOOR

#define ATH_DEFAULT_NOISE_FLOOR   -95

Definition at line 71 of file hw.h.

◆ ATH9K_RSSI_BAD

#define ATH9K_RSSI_BAD   -128

Definition at line 73 of file hw.h.

◆ ATH9K_NUM_CHANNELS

#define ATH9K_NUM_CHANNELS   38

Definition at line 75 of file hw.h.

◆ REG_WRITE

#define REG_WRITE (   _ah,
  _reg,
  _val 
)    (_ah)->reg_ops.write((_ah), (_val), (_reg))

Definition at line 78 of file hw.h.

◆ REG_READ

#define REG_READ (   _ah,
  _reg 
)    (_ah)->reg_ops.read((_ah), (_reg))

Definition at line 81 of file hw.h.

◆ REG_READ_MULTI

#define REG_READ_MULTI (   _ah,
  _addr,
  _val,
  _cnt 
)    (_ah)->reg_ops.multi_read((_ah), (_addr), (_val), (_cnt))

Definition at line 84 of file hw.h.

◆ REG_RMW

#define REG_RMW (   _ah,
  _reg,
  _set,
  _clr 
)    (_ah)->reg_ops.rmw((_ah), (_reg), (_set), (_clr))

Definition at line 87 of file hw.h.

◆ ENABLE_REGWRITE_BUFFER

#define ENABLE_REGWRITE_BUFFER (   _ah)
Value:
do { \
if ((_ah)->reg_ops.enable_write_buffer) \
(_ah)->reg_ops.enable_write_buffer((_ah)); \
} while (0)

Definition at line 90 of file hw.h.

◆ REGWRITE_BUFFER_FLUSH

#define REGWRITE_BUFFER_FLUSH (   _ah)
Value:
do { \
if ((_ah)->reg_ops.write_flush) \
(_ah)->reg_ops.write_flush((_ah)); \
} while (0)

Definition at line 96 of file hw.h.

◆ SM

#define SM (   _v,
  _f 
)    (((_v) << _f##_S) & _f)

Definition at line 102 of file hw.h.

◆ MS

#define MS (   _v,
  _f 
)    (((_v) & _f) >> _f##_S)

Definition at line 103 of file hw.h.

◆ REG_RMW_FIELD

#define REG_RMW_FIELD (   _a,
  _r,
  _f,
  _v 
)    REG_RMW(_a, _r, (((_v) << _f##_S) & _f), (_f))

Definition at line 104 of file hw.h.

◆ REG_READ_FIELD

#define REG_READ_FIELD (   _a,
  _r,
  _f 
)    (((REG_READ(_a, _r) & _f) >> _f##_S))

Definition at line 106 of file hw.h.

◆ REG_SET_BIT

#define REG_SET_BIT (   _a,
  _r,
  _f 
)    REG_RMW(_a, _r, (_f), 0)

Definition at line 108 of file hw.h.

◆ REG_CLR_BIT

#define REG_CLR_BIT (   _a,
  _r,
  _f 
)    REG_RMW(_a, _r, 0, (_f))

Definition at line 110 of file hw.h.

◆ DO_DELAY

#define DO_DELAY (   x)
Value:
do { \
if (((++(x) % 64) == 0) && \
(ath9k_hw_common(ah)->bus_ops->ath_bus_type \
!= ATH_USB)) \
udelay(1); \
} while (0)
static unsigned int x
Definition: pixbuf.h:63
Definition: ath.h:129
static struct ath_common * ath9k_hw_common(struct ath_hw *ah)
Definition: hw.h:870
uint8_t ah
Definition: registers.h:85

Definition at line 113 of file hw.h.

◆ REG_WRITE_ARRAY

#define REG_WRITE_ARRAY (   iniarray,
  column,
  regWr 
)    ath9k_hw_write_array(ah, iniarray, column, &(regWr))

Definition at line 120 of file hw.h.

◆ AR_GPIO_OUTPUT_MUX_AS_OUTPUT

#define AR_GPIO_OUTPUT_MUX_AS_OUTPUT   0

Definition at line 123 of file hw.h.

◆ AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED

#define AR_GPIO_OUTPUT_MUX_AS_PCIE_ATTENTION_LED   1

Definition at line 124 of file hw.h.

◆ AR_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED

#define AR_GPIO_OUTPUT_MUX_AS_PCIE_POWER_LED   2

Definition at line 125 of file hw.h.

◆ AR_GPIO_OUTPUT_MUX_AS_TX_FRAME

#define AR_GPIO_OUTPUT_MUX_AS_TX_FRAME   3

Definition at line 126 of file hw.h.

◆ AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL

#define AR_GPIO_OUTPUT_MUX_AS_RX_CLEAR_EXTERNAL   4

Definition at line 127 of file hw.h.

◆ AR_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED

#define AR_GPIO_OUTPUT_MUX_AS_MAC_NETWORK_LED   5

Definition at line 128 of file hw.h.

◆ AR_GPIO_OUTPUT_MUX_AS_MAC_POWER_LED

#define AR_GPIO_OUTPUT_MUX_AS_MAC_POWER_LED   6

Definition at line 129 of file hw.h.

◆ AR_GPIOD_MASK

#define AR_GPIOD_MASK   0x00001FFF

Definition at line 131 of file hw.h.

◆ AR_GPIO_BIT

#define AR_GPIO_BIT (   _gpio)    (1 << (_gpio))

Definition at line 132 of file hw.h.

◆ BASE_ACTIVATE_DELAY

#define BASE_ACTIVATE_DELAY   100

Definition at line 134 of file hw.h.

◆ RTC_PLL_SETTLE_DELAY

#define RTC_PLL_SETTLE_DELAY   (AR_SREV_9340(ah) ? 1000 : 100)

Definition at line 135 of file hw.h.

◆ COEF_SCALE_S

#define COEF_SCALE_S   24

Definition at line 136 of file hw.h.

◆ HT40_CHANNEL_CENTER_SHIFT

#define HT40_CHANNEL_CENTER_SHIFT   10

Definition at line 137 of file hw.h.

◆ ATH9K_ANTENNA0_CHAINMASK

#define ATH9K_ANTENNA0_CHAINMASK   0x1

Definition at line 139 of file hw.h.

◆ ATH9K_ANTENNA1_CHAINMASK

#define ATH9K_ANTENNA1_CHAINMASK   0x2

Definition at line 140 of file hw.h.

◆ ATH9K_NUM_DMA_DEBUG_REGS

#define ATH9K_NUM_DMA_DEBUG_REGS   8

Definition at line 142 of file hw.h.

◆ ATH9K_NUM_QUEUES

#define ATH9K_NUM_QUEUES   10

Definition at line 143 of file hw.h.

◆ MAX_RATE_POWER

#define MAX_RATE_POWER   63

Definition at line 145 of file hw.h.

◆ AH_WAIT_TIMEOUT

#define AH_WAIT_TIMEOUT   100000 /* (us) */

Definition at line 146 of file hw.h.

◆ AH_TSF_WRITE_TIMEOUT

#define AH_TSF_WRITE_TIMEOUT   100 /* (us) */

Definition at line 147 of file hw.h.

◆ AH_TIME_QUANTUM

#define AH_TIME_QUANTUM   10

Definition at line 148 of file hw.h.

◆ AR_KEYTABLE_SIZE

#define AR_KEYTABLE_SIZE   128

Definition at line 149 of file hw.h.

◆ POWER_UP_TIME

#define POWER_UP_TIME   10000

Definition at line 150 of file hw.h.

◆ SPUR_RSSI_THRESH

#define SPUR_RSSI_THRESH   40

Definition at line 151 of file hw.h.

◆ CAB_TIMEOUT_VAL

#define CAB_TIMEOUT_VAL   10

Definition at line 153 of file hw.h.

◆ BEACON_TIMEOUT_VAL

#define BEACON_TIMEOUT_VAL   10

Definition at line 154 of file hw.h.

◆ MIN_BEACON_TIMEOUT_VAL

#define MIN_BEACON_TIMEOUT_VAL   1

Definition at line 155 of file hw.h.

◆ SLEEP_SLOP

#define SLEEP_SLOP   3

Definition at line 156 of file hw.h.

◆ INIT_CONFIG_STATUS

#define INIT_CONFIG_STATUS   0x00000000

Definition at line 158 of file hw.h.

◆ INIT_RSSI_THR

#define INIT_RSSI_THR   0x00000700

Definition at line 159 of file hw.h.

◆ INIT_BCON_CNTRL_REG

#define INIT_BCON_CNTRL_REG   0x00000000

Definition at line 160 of file hw.h.

◆ TU_TO_USEC

#define TU_TO_USEC (   _tu)    ((_tu) << 10)

Definition at line 162 of file hw.h.

◆ ATH9K_HW_RX_HP_QDEPTH

#define ATH9K_HW_RX_HP_QDEPTH   16

Definition at line 164 of file hw.h.

◆ ATH9K_HW_RX_LP_QDEPTH

#define ATH9K_HW_RX_LP_QDEPTH   128

Definition at line 165 of file hw.h.

◆ PAPRD_GAIN_TABLE_ENTRIES

#define PAPRD_GAIN_TABLE_ENTRIES   32

Definition at line 167 of file hw.h.

◆ PAPRD_TABLE_SZ

#define PAPRD_TABLE_SZ   24

Definition at line 168 of file hw.h.

◆ SPUR_DISABLE

#define SPUR_DISABLE   0

Definition at line 236 of file hw.h.

◆ SPUR_ENABLE_IOCTL

#define SPUR_ENABLE_IOCTL   1

Definition at line 237 of file hw.h.

◆ SPUR_ENABLE_EEPROM

#define SPUR_ENABLE_EEPROM   2

Definition at line 238 of file hw.h.

◆ AR_SPUR_5413_1

#define AR_SPUR_5413_1   1640

Definition at line 239 of file hw.h.

◆ AR_SPUR_5413_2

#define AR_SPUR_5413_2   1200

Definition at line 240 of file hw.h.

◆ AR_NO_SPUR

#define AR_NO_SPUR   0x8000

Definition at line 241 of file hw.h.

◆ AR_BASE_FREQ_2GHZ

#define AR_BASE_FREQ_2GHZ   2300

Definition at line 242 of file hw.h.

◆ AR_BASE_FREQ_5GHZ

#define AR_BASE_FREQ_5GHZ   4900

Definition at line 243 of file hw.h.

◆ AR_SPUR_FEEQ_BOUND_HT40

#define AR_SPUR_FEEQ_BOUND_HT40   19

Definition at line 244 of file hw.h.

◆ AR_SPUR_FEEQ_BOUND_HT20

#define AR_SPUR_FEEQ_BOUND_HT20   10

Definition at line 245 of file hw.h.

◆ CHANNEL_CW_INT

#define CHANNEL_CW_INT   0x00002

Definition at line 302 of file hw.h.

◆ CHANNEL_CCK

#define CHANNEL_CCK   0x00020

Definition at line 303 of file hw.h.

◆ CHANNEL_OFDM

#define CHANNEL_OFDM   0x00040

Definition at line 304 of file hw.h.

◆ CHANNEL_2GHZ

#define CHANNEL_2GHZ   0x00080

Definition at line 305 of file hw.h.

◆ CHANNEL_5GHZ

#define CHANNEL_5GHZ   0x00100

Definition at line 306 of file hw.h.

◆ CHANNEL_PASSIVE

#define CHANNEL_PASSIVE   0x00200

Definition at line 307 of file hw.h.

◆ CHANNEL_DYN

#define CHANNEL_DYN   0x00400

Definition at line 308 of file hw.h.

◆ CHANNEL_HALF

#define CHANNEL_HALF   0x04000

Definition at line 309 of file hw.h.

◆ CHANNEL_QUARTER

#define CHANNEL_QUARTER   0x08000

Definition at line 310 of file hw.h.

◆ CHANNEL_HT20

#define CHANNEL_HT20   0x10000

Definition at line 311 of file hw.h.

◆ CHANNEL_HT40PLUS

#define CHANNEL_HT40PLUS   0x20000

Definition at line 312 of file hw.h.

◆ CHANNEL_HT40MINUS

#define CHANNEL_HT40MINUS   0x40000

Definition at line 313 of file hw.h.

◆ CHANNEL_A

#define CHANNEL_A   (CHANNEL_5GHZ|CHANNEL_OFDM)

Definition at line 315 of file hw.h.

◆ CHANNEL_B

#define CHANNEL_B   (CHANNEL_2GHZ|CHANNEL_CCK)

Definition at line 316 of file hw.h.

◆ CHANNEL_G

#define CHANNEL_G   (CHANNEL_2GHZ|CHANNEL_OFDM)

Definition at line 317 of file hw.h.

◆ CHANNEL_G_HT20

#define CHANNEL_G_HT20   (CHANNEL_2GHZ|CHANNEL_HT20)

Definition at line 318 of file hw.h.

◆ CHANNEL_A_HT20

#define CHANNEL_A_HT20   (CHANNEL_5GHZ|CHANNEL_HT20)

Definition at line 319 of file hw.h.

◆ CHANNEL_G_HT40PLUS

#define CHANNEL_G_HT40PLUS   (CHANNEL_2GHZ|CHANNEL_HT40PLUS)

Definition at line 320 of file hw.h.

◆ CHANNEL_G_HT40MINUS

#define CHANNEL_G_HT40MINUS   (CHANNEL_2GHZ|CHANNEL_HT40MINUS)

Definition at line 321 of file hw.h.

◆ CHANNEL_A_HT40PLUS

#define CHANNEL_A_HT40PLUS   (CHANNEL_5GHZ|CHANNEL_HT40PLUS)

Definition at line 322 of file hw.h.

◆ CHANNEL_A_HT40MINUS

#define CHANNEL_A_HT40MINUS   (CHANNEL_5GHZ|CHANNEL_HT40MINUS)

Definition at line 323 of file hw.h.

◆ CHANNEL_ALL

#define CHANNEL_ALL
Value:
CHANNEL_CCK| \
CHANNEL_2GHZ | \
CHANNEL_5GHZ | \
CHANNEL_HT20 | \
CHANNEL_HT40PLUS | \
CHANNEL_HT40MINUS)
#define CHANNEL_OFDM
Definition: hw.h:304

Definition at line 324 of file hw.h.

◆ IS_CHAN_G

#define IS_CHAN_G (   _c)
Value:
((((_c)->channelFlags & (CHANNEL_G)) == CHANNEL_G) || \
(((_c)->channelFlags & CHANNEL_G_HT40PLUS) == CHANNEL_G_HT40PLUS) || \
u32 channelFlags
Definition: hw.h:351
#define CHANNEL_G
Definition: hw.h:317
#define CHANNEL_G_HT20
Definition: hw.h:318
#define CHANNEL_G_HT40PLUS
Definition: hw.h:320
#define CHANNEL_G_HT40MINUS
Definition: hw.h:321

Definition at line 356 of file hw.h.

◆ IS_CHAN_OFDM

#define IS_CHAN_OFDM (   _c)    (((_c)->channelFlags & CHANNEL_OFDM) != 0)

Definition at line 360 of file hw.h.

◆ IS_CHAN_5GHZ

#define IS_CHAN_5GHZ (   _c)    (((_c)->channelFlags & CHANNEL_5GHZ) != 0)

Definition at line 361 of file hw.h.

◆ IS_CHAN_2GHZ

#define IS_CHAN_2GHZ (   _c)    (((_c)->channelFlags & CHANNEL_2GHZ) != 0)

Definition at line 362 of file hw.h.

◆ IS_CHAN_HALF_RATE

#define IS_CHAN_HALF_RATE (   _c)    (((_c)->channelFlags & CHANNEL_HALF) != 0)

Definition at line 363 of file hw.h.

◆ IS_CHAN_QUARTER_RATE

#define IS_CHAN_QUARTER_RATE (   _c)    (((_c)->channelFlags & CHANNEL_QUARTER) != 0)

Definition at line 364 of file hw.h.

◆ IS_CHAN_A_FAST_CLOCK

#define IS_CHAN_A_FAST_CLOCK (   _ah,
  _c 
)
Value:
((((_c)->channelFlags & CHANNEL_5GHZ) != 0) && \
((_ah)->caps.hw_caps & ATH9K_HW_CAP_FASTCLOCK))
u32 channelFlags
Definition: hw.h:351
#define CHANNEL_5GHZ
Definition: hw.h:306

Definition at line 365 of file hw.h.

◆ IS_CHAN_B

#define IS_CHAN_B (   _c)    ((_c)->chanmode == CHANNEL_B)

Definition at line 370 of file hw.h.

◆ IS_CHAN_HT20

#define IS_CHAN_HT20 (   _c)
Value:
(((_c)->chanmode == CHANNEL_A_HT20) || \
u32 chanmode
Definition: hw.h:352
#define CHANNEL_A_HT20
Definition: hw.h:319
#define CHANNEL_G_HT20
Definition: hw.h:318

Definition at line 371 of file hw.h.

◆ IS_CHAN_HT40

#define IS_CHAN_HT40 (   _c)
Value:
(((_c)->chanmode == CHANNEL_A_HT40PLUS) || \
((_c)->chanmode == CHANNEL_A_HT40MINUS) || \
((_c)->chanmode == CHANNEL_G_HT40PLUS) || \
u32 chanmode
Definition: hw.h:352
#define CHANNEL_A_HT40MINUS
Definition: hw.h:323
#define CHANNEL_A_HT40PLUS
Definition: hw.h:322
#define CHANNEL_G_HT40PLUS
Definition: hw.h:320
#define CHANNEL_G_HT40MINUS
Definition: hw.h:321

Definition at line 373 of file hw.h.

◆ IS_CHAN_HT

#define IS_CHAN_HT (   _c)    (IS_CHAN_HT20((_c)) || IS_CHAN_HT40((_c)))

Definition at line 377 of file hw.h.

◆ ATH9K_BEACON_PERIOD

#define ATH9K_BEACON_PERIOD   0x0000ffff

Definition at line 410 of file hw.h.

◆ ATH9K_TSFOOR_THRESHOLD

#define ATH9K_TSFOOR_THRESHOLD   0x00004240 /* 16k us */

Definition at line 411 of file hw.h.

◆ ATH_MAX_GEN_TIMER

#define ATH_MAX_GEN_TIMER   16

Definition at line 449 of file hw.h.

◆ AR_GENTMR_BIT

#define AR_GENTMR_BIT (   _index)    (1 << (_index))

Definition at line 451 of file hw.h.

◆ debruijn32

#define debruijn32   0x077CB531U

Definition at line 457 of file hw.h.

◆ AH_USE_EEPROM

#define AH_USE_EEPROM   0x1

Definition at line 654 of file hw.h.

◆ AH_UNPLUGGED

#define AH_UNPLUGGED   0x2 /* The card has been physically removed. */

Definition at line 655 of file hw.h.

◆ totalPowerMeasI

#define totalPowerMeasI   meas0.unsign

Definition at line 720 of file hw.h.

◆ totalPowerMeasQ

#define totalPowerMeasQ   meas1.unsign

Definition at line 721 of file hw.h.

◆ totalIqCorrMeas

#define totalIqCorrMeas   meas2.sign

Definition at line 722 of file hw.h.

◆ totalAdcIOddPhase

#define totalAdcIOddPhase   meas0.unsign

Definition at line 723 of file hw.h.

◆ totalAdcIEvenPhase

#define totalAdcIEvenPhase   meas1.unsign

Definition at line 724 of file hw.h.

◆ totalAdcQOddPhase

#define totalAdcQOddPhase   meas2.unsign

Definition at line 725 of file hw.h.

◆ totalAdcQEvenPhase

#define totalAdcQEvenPhase   meas3.unsign

Definition at line 726 of file hw.h.

◆ totalAdcDcOffsetIOddPhase

#define totalAdcDcOffsetIOddPhase   meas0.sign

Definition at line 727 of file hw.h.

◆ totalAdcDcOffsetIEvenPhase

#define totalAdcDcOffsetIEvenPhase   meas1.sign

Definition at line 728 of file hw.h.

◆ totalAdcDcOffsetQOddPhase

#define totalAdcDcOffsetQOddPhase   meas2.sign

Definition at line 729 of file hw.h.

◆ totalAdcDcOffsetQEvenPhase

#define totalAdcDcOffsetQEvenPhase   meas3.sign

Definition at line 730 of file hw.h.

◆ ATH_PCIE_CAP_LINK_CTRL

#define ATH_PCIE_CAP_LINK_CTRL   0x70

Definition at line 989 of file hw.h.

◆ ATH_PCIE_CAP_LINK_L0S

#define ATH_PCIE_CAP_LINK_L0S   1

Definition at line 990 of file hw.h.

◆ ATH_PCIE_CAP_LINK_L1

#define ATH_PCIE_CAP_LINK_L1   2

Definition at line 991 of file hw.h.

◆ ATH9K_CLOCK_RATE_CCK

#define ATH9K_CLOCK_RATE_CCK   22

Definition at line 993 of file hw.h.

◆ ATH9K_CLOCK_RATE_5GHZ_OFDM

#define ATH9K_CLOCK_RATE_5GHZ_OFDM   40

Definition at line 994 of file hw.h.

◆ ATH9K_CLOCK_RATE_2GHZ_OFDM

#define ATH9K_CLOCK_RATE_2GHZ_OFDM   44

Definition at line 995 of file hw.h.

◆ ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM

#define ATH9K_CLOCK_FAST_RATE_5GHZ_OFDM   44

Definition at line 996 of file hw.h.

Enumeration Type Documentation

◆ ath_hw_txq_subtype

Enumerator
ATH_TXQ_AC_BE 

Definition at line 170 of file hw.h.

170  {
171  ATH_TXQ_AC_BE = 0,
172 };

◆ ath_ini_subsys

Enumerator
ATH_INI_PRE 
ATH_INI_CORE 
ATH_INI_POST 
ATH_INI_NUM_SPLIT 

Definition at line 174 of file hw.h.

174  {
175  ATH_INI_PRE = 0,
176  ATH_INI_CORE,
177  ATH_INI_POST,
179 };

◆ ath9k_hw_caps

Enumerator
ATH9K_HW_CAP_HT 
ATH9K_HW_CAP_RFSILENT 
ATH9K_HW_CAP_CST 
ATH9K_HW_CAP_AUTOSLEEP 
ATH9K_HW_CAP_4KB_SPLITTRANS 
ATH9K_HW_CAP_EDMA 
ATH9K_HW_CAP_RAC_SUPPORTED 
ATH9K_HW_CAP_LDPC 
ATH9K_HW_CAP_FASTCLOCK 
ATH9K_HW_CAP_SGI_20 
ATH9K_HW_CAP_PAPRD 
ATH9K_HW_CAP_ANT_DIV_COMB 
ATH9K_HW_CAP_2GHZ 
ATH9K_HW_CAP_5GHZ 
ATH9K_HW_CAP_APM 

Definition at line 181 of file hw.h.

◆ ath9k_int

enum ath9k_int
Enumerator
ATH9K_INT_RX 
ATH9K_INT_RXDESC 
ATH9K_INT_RXHP 
ATH9K_INT_RXLP 
ATH9K_INT_RXNOFRM 
ATH9K_INT_RXEOL 
ATH9K_INT_RXORN 
ATH9K_INT_TX 
ATH9K_INT_TXDESC 
ATH9K_INT_TIM_TIMER 
ATH9K_INT_BB_WATCHDOG 
ATH9K_INT_TXURN 
ATH9K_INT_MIB 
ATH9K_INT_RXPHY 
ATH9K_INT_RXKCM 
ATH9K_INT_SWBA 
ATH9K_INT_BMISS 
ATH9K_INT_BNR 
ATH9K_INT_TIM 
ATH9K_INT_DTIM 
ATH9K_INT_DTIMSYNC 
ATH9K_INT_GPIO 
ATH9K_INT_CABEND 
ATH9K_INT_TSFOOR 
ATH9K_INT_GENTIMER 
ATH9K_INT_CST 
ATH9K_INT_GTT 
ATH9K_INT_FATAL 
ATH9K_INT_GLOBAL 
ATH9K_INT_BMISC 
ATH9K_INT_COMMON 
ATH9K_INT_NOCARD 

Definition at line 252 of file hw.h.

252  {
253  ATH9K_INT_RX = 0x00000001,
254  ATH9K_INT_RXDESC = 0x00000002,
255  ATH9K_INT_RXHP = 0x00000001,
256  ATH9K_INT_RXLP = 0x00000002,
257  ATH9K_INT_RXNOFRM = 0x00000008,
258  ATH9K_INT_RXEOL = 0x00000010,
259  ATH9K_INT_RXORN = 0x00000020,
260  ATH9K_INT_TX = 0x00000040,
261  ATH9K_INT_TXDESC = 0x00000080,
262  ATH9K_INT_TIM_TIMER = 0x00000100,
263  ATH9K_INT_BB_WATCHDOG = 0x00000400,
264  ATH9K_INT_TXURN = 0x00000800,
265  ATH9K_INT_MIB = 0x00001000,
266  ATH9K_INT_RXPHY = 0x00004000,
267  ATH9K_INT_RXKCM = 0x00008000,
268  ATH9K_INT_SWBA = 0x00010000,
269  ATH9K_INT_BMISS = 0x00040000,
270  ATH9K_INT_BNR = 0x00100000,
271  ATH9K_INT_TIM = 0x00200000,
272  ATH9K_INT_DTIM = 0x00400000,
273  ATH9K_INT_DTIMSYNC = 0x00800000,
274  ATH9K_INT_GPIO = 0x01000000,
275  ATH9K_INT_CABEND = 0x02000000,
276  ATH9K_INT_TSFOOR = 0x04000000,
277  ATH9K_INT_GENTIMER = 0x08000000,
278  ATH9K_INT_CST = 0x10000000,
279  ATH9K_INT_GTT = 0x20000000,
280  ATH9K_INT_FATAL = 0x40000000,
281  ATH9K_INT_GLOBAL = 0x80000000,
293  ATH9K_INT_MIB |
299  ATH9K_INT_NOCARD = 0xffffffff
300 };

◆ ath9k_power_mode

Enumerator
ATH9K_PM_AWAKE 
ATH9K_PM_FULL_SLEEP 
ATH9K_PM_NETWORK_SLEEP 
ATH9K_PM_UNDEFINED 

Definition at line 379 of file hw.h.

◆ ath9k_tp_scale

Enumerator
ATH9K_TP_SCALE_MAX 
ATH9K_TP_SCALE_50 
ATH9K_TP_SCALE_25 
ATH9K_TP_SCALE_12 
ATH9K_TP_SCALE_MIN 

Definition at line 386 of file hw.h.

◆ ser_reg_mode

Enumerator
SER_REG_MODE_OFF 
SER_REG_MODE_ON 
SER_REG_MODE_AUTO 

Definition at line 394 of file hw.h.

394  {
395  SER_REG_MODE_OFF = 0,
396  SER_REG_MODE_ON = 1,
397  SER_REG_MODE_AUTO = 2,
398 };

◆ ath9k_rx_qtype

Enumerator
ATH9K_RX_QUEUE_HP 
ATH9K_RX_QUEUE_LP 
ATH9K_RX_QUEUE_MAX 

Definition at line 400 of file hw.h.

◆ anonymous enum

anonymous enum
Enumerator
ATH9K_RESET_POWER_ON 
ATH9K_RESET_WARM 
ATH9K_RESET_COLD 

Definition at line 428 of file hw.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( BSD2  )

◆ FILE_SECBOOT()

FILE_SECBOOT ( FORBIDDEN  )

◆ ath9k_hw_common()

static struct ath_common* ath9k_hw_common ( struct ath_hw ah)
inlinestatic

◆ ath9k_hw_regulatory()

static struct ath_regulatory* ath9k_hw_regulatory ( struct ath_hw ah)
inlinestatic

◆ ath9k_hw_private_ops()

static struct ath_hw_private_ops* ath9k_hw_private_ops ( struct ath_hw ah)
inlinestatic

◆ ath9k_hw_ops()

static struct ath_hw_ops* ath9k_hw_ops ( struct ath_hw ah)
inlinestatic

◆ get_streams()

static u8 get_streams ( int  mask)
inlinestatic

Definition at line 890 of file hw.h.

891 {
892  return !!(mask & BIT(0)) + !!(mask & BIT(1)) + !!(mask & BIT(2));
893 }
#define BIT(nr)
Definition: ath.h:34

References BIT.

◆ ath9k_hw_probe()

const char* ath9k_hw_probe ( u16  vendorid,
u16  devid 
)

◆ ath9k_hw_deinit()

void ath9k_hw_deinit ( struct ath_hw ah)

Definition at line 852 of file ath9k_hw.c.

853 {
854  struct ath_common *common = ath9k_hw_common(ah);
855 
856  if (common->state < ATH_HW_INITIALIZED)
857  goto free_hw;
858 
860 
861 free_hw:
863 }
static struct ath_common * ath9k_hw_common(struct ath_hw *ah)
Definition: hw.h:870
struct ib_cm_common common
Definition: ib_mad.h:12
static void ath9k_hw_rf_free_ext_banks(struct ath_hw *ah)
Definition: hw-ops.h:163
int ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
Definition: ath9k_hw.c:1534
uint8_t ah
Definition: registers.h:85

References ah, ath9k_hw_common(), ath9k_hw_rf_free_ext_banks(), ath9k_hw_setpower(), ATH9K_PM_FULL_SLEEP, ATH_HW_INITIALIZED, and common.

Referenced by ath9k_deinit_softc(), and ath9k_init_softc().

◆ ath9k_hw_init()

int ath9k_hw_init ( struct ath_hw ah)

Definition at line 571 of file ath9k_hw.c.

572 {
573  int ret;
574  struct ath_common *common = ath9k_hw_common(ah);
575 
576  /* These are all the AR5008/AR9001/AR9002 hardware family of chipsets */
577  switch (ah->hw_version.devid) {
578  case AR5416_DEVID_PCI:
579  case AR5416_DEVID_PCIE:
580  case AR5416_AR9100_DEVID:
581  case AR9160_DEVID_PCI:
582  case AR9280_DEVID_PCI:
583  case AR9280_DEVID_PCIE:
584  case AR9285_DEVID_PCIE:
585  case AR9287_DEVID_PCI:
586  case AR9287_DEVID_PCIE:
587  case AR2427_DEVID_PCIE:
588  case AR9300_DEVID_PCIE:
590  case AR9300_DEVID_AR9340:
591  break;
592  default:
593  if (common->bus_ops->ath_bus_type == ATH_USB)
594  break;
595  DBG("ath9k: Hardware device ID 0x%04x not supported\n",
596  ah->hw_version.devid);
597  return -EOPNOTSUPP;
598  }
599 
600  ret = __ath9k_hw_init(ah);
601  if (ret) {
602  DBG("ath9k: "
603  "Unable to initialize hardware; initialization status: %d\n",
604  ret);
605  return ret;
606  }
607 
608  return 0;
609 }
#define AR5416_AR9100_DEVID
Definition: hw.h:56
#define AR5416_DEVID_PCIE
Definition: hw.h:44
#define AR9300_DEVID_AR9485_PCIE
Definition: hw.h:54
Definition: ath.h:129
#define AR9300_DEVID_PCIE
Definition: hw.h:52
#define AR9287_DEVID_PCI
Definition: hw.h:50
static int __ath9k_hw_init(struct ath_hw *ah)
Definition: ath9k_hw.c:452
#define EOPNOTSUPP
Operation not supported on socket.
Definition: errno.h:605
static struct ath_common * ath9k_hw_common(struct ath_hw *ah)
Definition: hw.h:870
#define AR9280_DEVID_PCIE
Definition: hw.h:47
struct ib_cm_common common
Definition: ib_mad.h:12
#define AR9287_DEVID_PCIE
Definition: hw.h:51
#define AR9160_DEVID_PCI
Definition: hw.h:45
#define AR9280_DEVID_PCI
Definition: hw.h:46
uint8_t ah
Definition: registers.h:85
#define AR9300_DEVID_AR9340
Definition: hw.h:53
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define AR2427_DEVID_PCIE
Definition: hw.h:49
#define AR9285_DEVID_PCIE
Definition: hw.h:48
#define AR5416_DEVID_PCI
Definition: hw.h:43

References __ath9k_hw_init(), ah, AR2427_DEVID_PCIE, AR5416_AR9100_DEVID, AR5416_DEVID_PCI, AR5416_DEVID_PCIE, AR9160_DEVID_PCI, AR9280_DEVID_PCI, AR9280_DEVID_PCIE, AR9285_DEVID_PCIE, AR9287_DEVID_PCI, AR9287_DEVID_PCIE, AR9300_DEVID_AR9340, AR9300_DEVID_AR9485_PCIE, AR9300_DEVID_PCIE, ath9k_hw_common(), ATH_USB, common, DBG, and EOPNOTSUPP.

Referenced by ath9k_init_softc().

◆ ath9k_hw_reset()

int ath9k_hw_reset ( struct ath_hw ah,
struct ath9k_channel chan,
struct ath9k_hw_cal_data caldata,
int  bChannelChange 
)

Definition at line 1218 of file ath9k_hw.c.

1220 {
1221  struct ath_common *common = ath9k_hw_common(ah);
1222  u32 saveLedState;
1223  struct ath9k_channel *curchan = ah->curchan;
1224  u32 saveDefAntenna;
1225  u32 macStaId1;
1226  int i, r;
1227 
1228  ah->txchainmask = common->tx_chainmask;
1229  ah->rxchainmask = common->rx_chainmask;
1230 
1232  return -EIO;
1233 
1234  if (curchan && !ah->chip_fullsleep)
1235  ath9k_hw_getnf(ah, curchan);
1236 
1237  ah->caldata = caldata;
1238  if (caldata &&
1239  (chan->channel != caldata->channel ||
1240  (chan->channelFlags & ~CHANNEL_CW_INT) !=
1241  (caldata->channelFlags & ~CHANNEL_CW_INT))) {
1242  /* Operating channel changed, reset channel calibration data */
1243  memset(caldata, 0, sizeof(*caldata));
1245  }
1246 
1247  if (bChannelChange &&
1248  (ah->chip_fullsleep != 1) &&
1249  (ah->curchan != NULL) &&
1250  (chan->channel != ah->curchan->channel) &&
1251  ((chan->channelFlags & CHANNEL_ALL) ==
1252  (ah->curchan->channelFlags & CHANNEL_ALL)) &&
1253  (!AR_SREV_9280(ah) || AR_DEVID_7010(ah))) {
1254 
1256  ath9k_hw_loadnf(ah, ah->curchan);
1258  if (AR_SREV_9271(ah))
1260  return 0;
1261  }
1262  }
1263 
1264  saveDefAntenna = REG_READ(ah, AR_DEF_ANTENNA);
1265  if (saveDefAntenna == 0)
1266  saveDefAntenna = 1;
1267 
1269 
1270  saveLedState = REG_READ(ah, AR_CFG_LED) &
1273 
1275 
1276  ah->paprd_table_write_done = 0;
1277 
1278  /* Only required on the first reset */
1279  if (AR_SREV_9271(ah) && ah->htc_reset_init) {
1280  REG_WRITE(ah,
1283  udelay(50);
1284  }
1285 
1286  if (!ath9k_hw_chip_reset(ah, chan)) {
1287  DBG("ath9k: Chip reset failed\n");
1288  return -EINVAL;
1289  }
1290 
1291  /* Only required on the first reset */
1292  if (AR_SREV_9271(ah) && ah->htc_reset_init) {
1293  ah->htc_reset_init = 0;
1294  REG_WRITE(ah,
1297  udelay(50);
1298  }
1299 
1302 
1305 
1307  if (r)
1308  return r;
1309 
1310  /* Setup MFP options for CCMP */
1312  /* Mask Retry(b11), PwrMgt(b12), MoreData(b13) to 0 in mgmt
1313  * frames when constructing CCMP AAD. */
1315  0xc7ff);
1316  ah->sw_mgmt_crypto = 0;
1317  } else if (AR_SREV_9160_10_OR_LATER(ah)) {
1318  /* Disable hardware crypto for management frames */
1323  ah->sw_mgmt_crypto = 1;
1324  } else
1325  ah->sw_mgmt_crypto = 1;
1326 
1327  if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan))
1329 
1331  ah->eep_ops->set_board_values(ah, chan);
1332 
1334 
1337  | macStaId1
1339  | (ah->config.
1340  ack_6mb ? AR_STA_ID1_ACKCTS_6MB : 0)
1341  | ah->sta_id1_defaults);
1343  REG_WRITE(ah, AR_DEF_ANTENNA, saveDefAntenna);
1345  REG_WRITE(ah, AR_ISR, ~0);
1347 
1349 
1351 
1353  if (r)
1354  return r;
1355 
1357 
1359 
1360  for (i = 0; i < AR_NUM_DCU; i++)
1361  REG_WRITE(ah, AR_DQCUMASK(i), 1 << i);
1362 
1364 
1365  ah->intr_txqs = 0;
1366  for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
1368 
1371 
1372  if (ah->caps.hw_caps & ATH9K_HW_CAP_RFSILENT)
1373  ath9k_hw_cfg_gpio_input(ah, ah->rfkill_gpio);
1374 
1376 
1377  if (!AR_SREV_9300_20_OR_LATER(ah)) {
1380  }
1381 
1383 
1385 
1386  REG_WRITE(ah, AR_OBS, 8);
1387 
1388  if (ah->config.rx_intr_mitigation) {
1391  }
1392 
1393  if (ah->config.tx_intr_mitigation) {
1396  }
1397 
1399 
1400  if (!ath9k_hw_init_cal(ah, chan))
1401  return -EIO;
1402 
1404 
1406  REG_WRITE(ah, AR_CFG_LED, saveLedState | AR_CFG_SCLK_32KHZ);
1407 
1409 
1410  /*
1411  * For big endian systems turn on swapping for descriptors
1412  */
1413  if (AR_SREV_9100(ah)) {
1414  u32 mask;
1415  mask = REG_READ(ah, AR_CFG);
1416  if (mask & (AR_CFG_SWRB | AR_CFG_SWTB | AR_CFG_SWRG)) {
1417  DBG2("ath9k: "
1418  "CFG Byte Swap Set 0x%x\n", mask);
1419  } else {
1420  mask =
1422  REG_WRITE(ah, AR_CFG, mask);
1423  DBG2("ath9k: "
1424  "Setting CFG 0x%x\n", REG_READ(ah, AR_CFG));
1425  }
1426  } else {
1427  if (common->bus_ops->ath_bus_type == ATH_USB) {
1428  /* Configure AR9271 target WLAN */
1429  if (AR_SREV_9271(ah))
1431  else
1433  }
1434 #if __BYTE_ORDER == __BIG_ENDIAN
1435  else if (AR_SREV_9340(ah))
1437  else
1439 #endif
1440  }
1441 
1444  }
1445 
1447 
1448  return 0;
1449 }
int ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q)
Definition: ath9k_mac.c:285
#define AR_CFG_LED_MODE_SEL
Definition: reg.h:664
#define EINVAL
Invalid argument.
Definition: errno.h:429
u16 channel
Definition: hw.h:334
void ath9k_hw_write_associd(struct ath_hw *ah)
Definition: ath9k_hw.c:1966
#define AR_AES_MUTE_MASK1_FC_MGMT
Definition: reg.h:1859
#define AR_TIMT_LAST
Definition: reg.h:60
void ar9002_hw_enable_async_fifo(struct ath_hw *ah)
#define INIT_RSSI_THR
Definition: hw.h:159
#define AR_AES_MUTE_MASK1
Definition: reg.h:1856
#define AR_SREV_9280_20_OR_LATER(_ah)
Definition: reg.h:825
#define AR_CFG_LED_ASSOC_CTL
Definition: reg.h:678
#define AR_RIMT_LAST
Definition: reg.h:66
#define AR_TIMT
Definition: reg.h:59
#define INIT_CONFIG_STATUS
Definition: hw.h:158
#define CHANNEL_ALL
Definition: ath5k.h:649
void ath9k_hw_init_global_settings(struct ath_hw *ah)
Definition: ath9k_hw.c:814
static void ath9k_hw_ani_cache_ini_regs(struct ath_hw *ah)
Definition: ath9k_hw.c:57
void ath9k_hw_start_nfcal(struct ath_hw *ah, int update)
Definition: ath9k_calib.c:208
#define IS_CHAN_OFDM(_c)
Definition: hw.h:360
#define REG_CLR_BIT(_a, _r, _f)
Definition: hw.h:110
#define REGWRITE_BUFFER_FLUSH(_ah)
Definition: hw.h:96
#define AR_STA_ID1_ACKCTS_6MB
Definition: reg.h:1444
void ath_hw_setbssidmask(struct ath_common *common)
ath_hw_set_bssid_mask - filter out bssids we listen
Definition: ath_hw.c:122
static void ath9k_hw_mark_phy_inactive(struct ath_hw *ah)
Definition: hw-ops.h:213
#define REG_RMW(_ah, _reg, _set, _clr)
Definition: hw.h:87
void ar9002_hw_enable_wep_aggregation(struct ath_hw *ah)
#define AR_SREV_9100(ah)
Definition: reg.h:811
#define AR_OBS
Definition: reg.h:1095
#define AR_CFG_SWRB
Definition: reg.h:36
struct net80211_channel * chan
Definition: hw.h:348
#define AR_NUM_DCU
Definition: reg.h:484
#define REG_RMW_FIELD(_a, _r, _f, _v)
Definition: hw.h:104
#define AR_RIMT
Definition: reg.h:65
#define AR_CFG_LED
Definition: reg.h:655
static u32 get_unaligned_le32(const void *p)
Definition: ath.h:89
Definition: ath.h:129
#define AR_STA_ID1
Definition: reg.h:1433
#define AR_SREV_9300_20_OR_LATER(_ah)
Definition: reg.h:865
void ar9002_hw_update_async_fifo(struct ath_hw *ah)
#define AR_STA_ID1_BASE_RATE_11B
Definition: reg.h:1445
#define AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE
Definition: reg.h:1832
#define AR_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT
Definition: reg.h:1833
static int ath9k_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:259
#define AR_PCU_MISC_MODE2
Definition: reg.h:1831
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:61
void ath9k_hw_loadnf(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_calib.c:226
#define AR_CFG_SWRD
Definition: reg.h:35
#define AR_CFG_SCLK_32KHZ
Definition: reg.h:661
#define AR_STA_ID1_PRESERVE_SEQNUM
Definition: reg.h:1449
#define CHANNEL_CW_INT
Definition: ath5k.h:630
#define AR_SREV_9340(_ah)
Definition: reg.h:879
#define AR9271_RADIO_RF_RST
Definition: reg.h:1429
static void ath9k_hw_init_bb(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:181
static u16 get_unaligned_le16(const void *p)
Definition: ath.h:85
static void ath9k_hw_init_interrupt_masks(struct ath_hw *ah)
Definition: ath9k_hw.c:727
#define AR_SREV_9280(_ah)
Definition: reg.h:823
void ar9003_hw_disable_phy_restart(struct ath_hw *ah)
void ath9k_hw_cfg_gpio_input(struct ath_hw *ah, u32 gpio)
Definition: ath9k_hw.c:1785
static void ath9k_hw_spur_mitigate_freq(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:149
static void ath9k_hw_set_operating_mode(struct ath_hw *ah)
Definition: ath9k_hw.c:956
#define AR_STA_ID0
Definition: reg.h:1432
#define AR_STA_ID1_RTS_USE_DEF
Definition: reg.h:1443
#define ATH9K_NUM_TX_QUEUES
Definition: mac.h:581
static struct ath_common * ath9k_hw_common(struct ath_hw *ah)
Definition: hw.h:870
#define AR_TIMT_FIRST
Definition: reg.h:62
#define AR_CFG_SWRG
Definition: reg.h:37
struct ib_cm_common common
Definition: ib_mad.h:12
#define AR_GPIO_JTAG_DISABLE
Definition: reg.h:1058
static int ath9k_hw_process_ini(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:193
#define REG_READ(_ah, _reg)
Definition: hw.h:81
static void ath9k_hw_set_delta_slope(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:218
static int ath9k_hw_channel_change(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_hw.c:1130
#define REG_SET_BIT(_a, _r, _f)
Definition: hw.h:108
#define AR_CFG_SWTD
Definition: reg.h:33
int ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
Definition: ath9k_hw.c:1534
static int ath9k_hw_rf_set_freq(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw-ops.h:143
static void ath9k_hw_restore_chainmask(struct ath_hw *ah)
Definition: hw-ops.h:234
#define AR_CFG_SWTB
Definition: reg.h:34
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
#define AR_RSSI_THR
Definition: reg.h:1469
#define AR_GPIO_INPUT_EN_VAL
Definition: reg.h:1041
#define EIO
Input/output error.
Definition: errno.h:434
#define AR_RIMT_FIRST
Definition: reg.h:68
#define AR_SREV_9271(_ah)
Definition: reg.h:854
static void ath9k_hw_set_dma(struct ath_hw *ah)
Definition: ath9k_hw.c:887
u32 channelFlags
Definition: hw.h:335
#define AR_DEVID_7010(_ah)
Definition: reg.h:892
#define AR_CFG_LED_BLINK_THRESH_SEL
Definition: reg.h:687
#define AR_ISR
Definition: reg.h:172
static int ath9k_hw_chip_reset(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_hw.c:1111
int ath9k_hw_getnf(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_calib.c:348
uint8_t ah
Definition: registers.h:85
#define AR_SREV_9160_10_OR_LATER(_ah)
Definition: reg.h:818
#define AR9271_GATE_MAC_CTL
Definition: reg.h:1430
#define AR_DEF_ANTENNA
Definition: reg.h:1535
static void ath9k_hw_apply_gpio_override(struct ath_hw *ah)
Definition: ath9k_hw.c:1177
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define AR_CFG
Definition: reg.h:32
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322
#define AR9271_RESET_POWER_DOWN_CONTROL
Definition: reg.h:1428
#define AR_DQCUMASK(_i)
Definition: reg.h:506
uint32_t u32
Definition: stdint.h:24
static void ath9k_hw_set_clockrate(struct ath_hw *ah)
Definition: ath9k_hw.c:70
#define ENABLE_REGWRITE_BUFFER(_ah)
Definition: hw.h:90
#define DBG2(...)
Definition: compiler.h:515
#define AR_CFG_LED_BLINK_SLOW
Definition: reg.h:684
void * memset(void *dest, int character, size_t len) __nonnull
void ar9002_hw_load_ani_reg(struct ath_hw *ah, struct ath9k_channel *chan)
static const uint8_t r[3][4]
MD4 shift amounts.
Definition: md4.c:54
#define IS_CHAN_HT(_c)
Definition: hw.h:377
void ath9k_init_nfcal_hist_buffer(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_calib.c:386

References ah, ar9002_hw_enable_async_fifo(), ar9002_hw_enable_wep_aggregation(), ar9002_hw_load_ani_reg(), ar9002_hw_update_async_fifo(), ar9003_hw_disable_phy_restart(), AR9271_GATE_MAC_CTL, AR9271_RADIO_RF_RST, AR9271_RESET_POWER_DOWN_CONTROL, AR_AES_MUTE_MASK1, AR_AES_MUTE_MASK1_FC_MGMT, AR_CFG, AR_CFG_LED, AR_CFG_LED_ASSOC_CTL, AR_CFG_LED_BLINK_SLOW, AR_CFG_LED_BLINK_THRESH_SEL, AR_CFG_LED_MODE_SEL, AR_CFG_SCLK_32KHZ, AR_CFG_SWRB, AR_CFG_SWRD, AR_CFG_SWRG, AR_CFG_SWTB, AR_CFG_SWTD, AR_DEF_ANTENNA, AR_DEVID_7010, AR_DQCUMASK, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE, AR_ISR, AR_NUM_DCU, AR_OBS, AR_PCU_MISC_MODE2, AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE, AR_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT, AR_RIMT, AR_RIMT_FIRST, AR_RIMT_LAST, AR_RSSI_THR, AR_SREV_9100, AR_SREV_9160_10_OR_LATER, AR_SREV_9271, AR_SREV_9280, AR_SREV_9280_20_OR_LATER, AR_SREV_9300_20_OR_LATER, AR_SREV_9340, AR_STA_ID0, AR_STA_ID1, AR_STA_ID1_ACKCTS_6MB, AR_STA_ID1_BASE_RATE_11B, AR_STA_ID1_PRESERVE_SEQNUM, AR_STA_ID1_RTS_USE_DEF, AR_TIMT, AR_TIMT_FIRST, AR_TIMT_LAST, ath9k_hw_ani_cache_ini_regs(), ath9k_hw_apply_gpio_override(), ATH9K_HW_CAP_RFSILENT, ath9k_hw_cfg_gpio_input(), ath9k_hw_channel_change(), ath9k_hw_chip_reset(), ath9k_hw_common(), ath9k_hw_getnf(), ath9k_hw_init_bb(), ath9k_hw_init_cal(), ath9k_hw_init_global_settings(), ath9k_hw_init_interrupt_masks(), ath9k_hw_loadnf(), ath9k_hw_mark_phy_inactive(), ath9k_hw_process_ini(), ath9k_hw_resettxqueue(), ath9k_hw_restore_chainmask(), ath9k_hw_rf_set_freq(), ath9k_hw_set_clockrate(), ath9k_hw_set_delta_slope(), ath9k_hw_set_dma(), ath9k_hw_set_operating_mode(), ath9k_hw_setpower(), ath9k_hw_spur_mitigate_freq(), ath9k_hw_start_nfcal(), ath9k_hw_write_associd(), ath9k_init_nfcal_hist_buffer(), ATH9K_NUM_TX_QUEUES, ATH9K_PM_AWAKE, ath_hw_setbssidmask(), ATH_USB, ath9k_channel::chan, ath9k_hw_cal_data::channel, CHANNEL_ALL, CHANNEL_CW_INT, ath9k_hw_cal_data::channelFlags, common, DBG, DBG2, EINVAL, EIO, ENABLE_REGWRITE_BUFFER, get_unaligned_le16(), get_unaligned_le32(), INIT_CONFIG_STATUS, INIT_RSSI_THR, IS_CHAN_HT, IS_CHAN_OFDM, memset(), NULL, r, REG_CLR_BIT, REG_READ, REG_RMW, REG_RMW_FIELD, REG_SET_BIT, REG_WRITE, REGWRITE_BUFFER_FLUSH, and udelay().

Referenced by ath9k_start(), ath_radio_disable(), ath_reset(), and ath_set_channel().

◆ ath9k_hw_fill_cap_info()

int ath9k_hw_fill_cap_info ( struct ath_hw ah)

Definition at line 1571 of file ath9k_hw.c.

1572 {
1573  struct ath9k_hw_capabilities *pCap = &ah->caps;
1574  struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
1575  struct ath_common *common = ath9k_hw_common(ah);
1576 
1577  u16 eeval;
1578  u8 ant_div_ctl1, tx_chainmask, rx_chainmask;
1579 
1580  eeval = ah->eep_ops->get_eeprom(ah, EEP_REG_0);
1581  regulatory->current_rd = eeval;
1582 
1583  eeval = ah->eep_ops->get_eeprom(ah, EEP_REG_1);
1585  eeval |= AR9285_RDEXT_DEFAULT;
1586  regulatory->current_rd_ext = eeval;
1587 
1588  if (ah->hw_version.subvendorid == AR_SUBVENDOR_ID_NEW_A) {
1589  if (regulatory->current_rd == 0x64 ||
1590  regulatory->current_rd == 0x65)
1591  regulatory->current_rd += 5;
1592  else if (regulatory->current_rd == 0x41)
1593  regulatory->current_rd = 0x43;
1594  DBG2("ath9k: "
1595  "regdomain mapped to 0x%x\n", regulatory->current_rd);
1596  }
1597 
1598  eeval = ah->eep_ops->get_eeprom(ah, EEP_OP_MODE);
1599  if ((eeval & (AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A)) == 0) {
1600  DBG("ath9k: "
1601  "no band has been marked as supported in EEPROM\n");
1602  return -EINVAL;
1603  }
1604 
1605  if (eeval & AR5416_OPFLAGS_11A)
1606  pCap->hw_caps |= ATH9K_HW_CAP_5GHZ;
1607 
1608  if (eeval & AR5416_OPFLAGS_11G)
1609  pCap->hw_caps |= ATH9K_HW_CAP_2GHZ;
1610 
1611  pCap->tx_chainmask = ah->eep_ops->get_eeprom(ah, EEP_TX_MASK);
1612  /*
1613  * For AR9271 we will temporarilly uses the rx chainmax as read from
1614  * the EEPROM.
1615  */
1616  if ((ah->hw_version.devid == AR5416_DEVID_PCI) &&
1617  !(eeval & AR5416_OPFLAGS_11A) &&
1618  !(AR_SREV_9271(ah)))
1619  /* CB71: GPIO 0 is pulled down to indicate 3 rx chains */
1620  pCap->rx_chainmask = ath9k_hw_gpio_get(ah, 0) ? 0x5 : 0x7;
1621  else if (AR_SREV_9100(ah))
1622  pCap->rx_chainmask = 0x7;
1623  else
1624  /* Use rx_chainmask from EEPROM. */
1625  pCap->rx_chainmask = ah->eep_ops->get_eeprom(ah, EEP_RX_MASK);
1626 
1627  ah->misc_mode |= AR_PCU_MIC_NEW_LOC_ENA;
1628 
1629  /* enable key search for every frame in an aggregate */
1631  ah->misc_mode |= AR_PCU_ALWAYS_PERFORM_KEYSEARCH;
1632 
1633  common->crypt_caps |= ATH_CRYPT_CAP_CIPHER_AESCCM;
1634 
1635  pCap->hw_caps &= ~ATH9K_HW_CAP_HT;
1636 
1637  if (AR_SREV_9271(ah))
1639  else if (AR_DEVID_7010(ah))
1641  else if (AR_SREV_9285_12_OR_LATER(ah))
1643  else if (AR_SREV_9280_20_OR_LATER(ah))
1645  else
1646  pCap->num_gpio_pins = AR_NUM_GPIO;
1647 
1649  pCap->hw_caps |= ATH9K_HW_CAP_CST;
1651  } else {
1652  pCap->rts_aggr_limit = (8 * 1024);
1653  }
1654 
1655  ah->rfsilent = ah->eep_ops->get_eeprom(ah, EEP_RF_SILENT);
1656  if (ah->rfsilent & EEP_RFSILENT_ENABLED) {
1657  ah->rfkill_gpio =
1658  MS(ah->rfsilent, EEP_RFSILENT_GPIO_SEL);
1659  ah->rfkill_polarity =
1660  MS(ah->rfsilent, EEP_RFSILENT_POLARITY);
1661 
1662  pCap->hw_caps |= ATH9K_HW_CAP_RFSILENT;
1663  }
1664 
1665  pCap->hw_caps &= ~ATH9K_HW_CAP_AUTOSLEEP;
1666 
1667  if (AR_SREV_9280(ah) || AR_SREV_9285(ah))
1669  else
1671 
1674  if (!AR_SREV_9485(ah))
1675  pCap->hw_caps |= ATH9K_HW_CAP_LDPC;
1676 
1679  pCap->rx_status_len = sizeof(struct ar9003_rxs);
1680  pCap->tx_desc_len = sizeof(struct ar9003_txc);
1681  pCap->txs_len = sizeof(struct ar9003_txs);
1682  if (!ah->config.paprd_disable &&
1683  ah->eep_ops->get_eeprom(ah, EEP_PAPRD))
1684  pCap->hw_caps |= ATH9K_HW_CAP_PAPRD;
1685  } else {
1686  pCap->tx_desc_len = sizeof(struct ath_desc);
1687  if (AR_SREV_9280_20(ah) &&
1688  ((ah->eep_ops->get_eeprom(ah, EEP_MINOR_REV) <=
1690  ah->eep_ops->get_eeprom(ah, EEP_FSTCLK_5G)))
1692  }
1693 
1696 
1698  ah->ent_mode = REG_READ(ah, AR_ENT_OTP);
1699 
1701  pCap->hw_caps |= ATH9K_HW_CAP_SGI_20;
1702 
1703  if (AR_SREV_9285(ah))
1704  if (ah->eep_ops->get_eeprom(ah, EEP_MODAL_VER) >= 3) {
1705  ant_div_ctl1 =
1706  ah->eep_ops->get_eeprom(ah, EEP_ANT_DIV_CTL1);
1707  if ((ant_div_ctl1 & 0x1) && ((ant_div_ctl1 >> 3) & 0x1))
1709  }
1711  if (ah->eep_ops->get_eeprom(ah, EEP_CHAIN_MASK_REDUCE))
1712  pCap->hw_caps |= ATH9K_HW_CAP_APM;
1713  }
1714 
1715 
1716  if (AR_SREV_9485(ah)) {
1717  ant_div_ctl1 = ah->eep_ops->get_eeprom(ah, EEP_ANT_DIV_CTL1);
1718  /*
1719  * enable the diversity-combining algorithm only when
1720  * both enable_lna_div and enable_fast_div are set
1721  * Table for Diversity
1722  * ant_div_alt_lnaconf bit 0-1
1723  * ant_div_main_lnaconf bit 2-3
1724  * ant_div_alt_gaintb bit 4
1725  * ant_div_main_gaintb bit 5
1726  * enable_ant_div_lnadiv bit 6
1727  * enable_ant_fast_div bit 7
1728  */
1729  if ((ant_div_ctl1 >> 0x6) == 0x3)
1731  }
1732 
1733  if (AR_SREV_9485_10(ah)) {
1734  pCap->pcie_lcr_extsync_en = 1;
1735  pCap->pcie_lcr_offset = 0x80;
1736  }
1737 
1738  tx_chainmask = pCap->tx_chainmask;
1739  rx_chainmask = pCap->rx_chainmask;
1740  while (tx_chainmask || rx_chainmask) {
1741  if (tx_chainmask & BIT(0))
1742  pCap->max_txchains++;
1743  if (rx_chainmask & BIT(0))
1744  pCap->max_rxchains++;
1745 
1746  tx_chainmask >>= 1;
1747  rx_chainmask >>= 1;
1748  }
1749 
1750  return 0;
1751 }
uint16_t u16
Definition: stdint.h:22
#define EINVAL
Invalid argument.
Definition: errno.h:429
#define AR_PCU_MIC_NEW_LOC_ENA
Definition: reg.h:1643
#define AR_SREV_9287_11_OR_LATER(_ah)
Definition: reg.h:837
struct ath_regulatory regulatory
Definition: ath.h:224
#define AR_NUM_GPIO
Definition: reg.h:987
#define AR_SREV_9280_20_OR_LATER(_ah)
Definition: reg.h:825
u16 rts_aggr_limit
Definition: hw.h:201
#define MS(_v, _f)
Definition: hw.h:103
#define AR9285_NUM_GPIO
Definition: reg.h:989
#define AR_SREV_9485(_ah)
Definition: reg.h:868
#define AR_SREV_9100(ah)
Definition: reg.h:811
#define AR_SREV_9485_10(_ah)
Definition: reg.h:870
#define AR_SREV_9285(_ah)
Definition: reg.h:830
#define ATH9K_HW_RX_LP_QDEPTH
Definition: hw.h:165
int pcie_lcr_extsync_en
Definition: hw.h:213
#define EEP_RFSILENT_POLARITY
Definition: eeprom.h:119
Definition: mac.h:241
#define AR_SUBVENDOR_ID_NEW_A
Definition: hw.h:59
#define AR_ENT_OTP
Definition: reg.h:1108
#define AR_SREV_9280_20(_ah)
Definition: reg.h:827
#define AR_SREV_9300_20_OR_LATER(_ah)
Definition: reg.h:865
u16 current_rd_ext
Definition: ath.h:144
#define EEP_RFSILENT_GPIO_SEL
Definition: eeprom.h:121
#define AR5416_EEP_MINOR_VER_16
Definition: eeprom.h:138
#define AR5416_OPFLAGS_11A
Definition: eeprom.h:124
static struct ath_regulatory * ath9k_hw_regulatory(struct ath_hw *ah)
Definition: hw.h:875
u16 current_rd
Definition: ath.h:143
u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio)
Definition: ath9k_hw.c:1804
#define AR9271_NUM_GPIO
Definition: reg.h:991
#define AR_SREV_9280(_ah)
Definition: reg.h:823
u8 tx_chainmask
Definition: ath.h:211
static struct ath_common * ath9k_hw_common(struct ath_hw *ah)
Definition: hw.h:870
#define AR_SREV_9285_12_OR_LATER(_ah)
Definition: reg.h:832
#define EEP_RFSILENT_ENABLED
Definition: eeprom.h:117
struct ib_cm_common common
Definition: ib_mad.h:12
#define REG_READ(_ah, _reg)
Definition: hw.h:81
u8 rx_chainmask
Definition: ath.h:212
#define AR7010_NUM_GPIO
Definition: reg.h:993
#define AR5416_OPFLAGS_11G
Definition: eeprom.h:125
#define ATH9K_HW_RX_HP_QDEPTH
Definition: hw.h:164
#define BIT(nr)
Definition: ath.h:34
#define ATH_AMPDU_LIMIT_MAX
Definition: hw.h:69
#define AR928X_NUM_GPIO
Definition: reg.h:988
u16 pcie_lcr_offset
Definition: hw.h:212
#define AR_SREV_9271(_ah)
Definition: reg.h:854
#define AR_DEVID_7010(_ah)
Definition: reg.h:892
uint8_t ah
Definition: registers.h:85
#define AR_PCU_ALWAYS_PERFORM_KEYSEARCH
Definition: reg.h:1654
#define AR_SREV_9160_10_OR_LATER(_ah)
Definition: reg.h:818
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
uint8_t u8
Definition: stdint.h:20
#define AR5416_DEVID_PCI
Definition: hw.h:43
#define AR9285_RDEXT_DEFAULT
Definition: eeprom.h:100
#define DBG2(...)
Definition: compiler.h:515
if(natsemi->flags &NATSEMI_64BIT) return 1

References ah, AR5416_DEVID_PCI, AR5416_EEP_MINOR_VER_16, AR5416_OPFLAGS_11A, AR5416_OPFLAGS_11G, AR7010_NUM_GPIO, AR9271_NUM_GPIO, AR9285_NUM_GPIO, AR9285_RDEXT_DEFAULT, AR928X_NUM_GPIO, AR_DEVID_7010, AR_ENT_OTP, AR_NUM_GPIO, AR_PCU_ALWAYS_PERFORM_KEYSEARCH, AR_PCU_MIC_NEW_LOC_ENA, AR_SREV_9100, AR_SREV_9160_10_OR_LATER, AR_SREV_9271, AR_SREV_9280, AR_SREV_9280_20, AR_SREV_9280_20_OR_LATER, AR_SREV_9285, AR_SREV_9285_12_OR_LATER, AR_SREV_9287_11_OR_LATER, AR_SREV_9300_20_OR_LATER, AR_SREV_9485, AR_SREV_9485_10, AR_SUBVENDOR_ID_NEW_A, ATH9K_HW_CAP_2GHZ, ATH9K_HW_CAP_4KB_SPLITTRANS, ATH9K_HW_CAP_5GHZ, ATH9K_HW_CAP_ANT_DIV_COMB, ATH9K_HW_CAP_APM, ATH9K_HW_CAP_AUTOSLEEP, ATH9K_HW_CAP_CST, ATH9K_HW_CAP_FASTCLOCK, ATH9K_HW_CAP_HT, ATH9K_HW_CAP_LDPC, ATH9K_HW_CAP_PAPRD, ATH9K_HW_CAP_RAC_SUPPORTED, ATH9K_HW_CAP_RFSILENT, ATH9K_HW_CAP_SGI_20, ath9k_hw_common(), ath9k_hw_gpio_get(), ath9k_hw_regulatory(), ATH9K_HW_RX_HP_QDEPTH, ATH9K_HW_RX_LP_QDEPTH, ATH_AMPDU_LIMIT_MAX, ATH_CRYPT_CAP_CIPHER_AESCCM, BIT, common, ath_regulatory::current_rd, ath_regulatory::current_rd_ext, DBG, DBG2, EEP_ANT_DIV_CTL1, EEP_CHAIN_MASK_REDUCE, EEP_FSTCLK_5G, EEP_MINOR_REV, EEP_MODAL_VER, EEP_OP_MODE, EEP_PAPRD, EEP_REG_0, EEP_REG_1, EEP_RF_SILENT, EEP_RFSILENT_ENABLED, EEP_RFSILENT_GPIO_SEL, EEP_RFSILENT_POLARITY, EEP_RX_MASK, EEP_TX_MASK, EINVAL, ath9k_hw_capabilities::hw_caps, if(), ath9k_hw_capabilities::max_rxchains, ath9k_hw_capabilities::max_txchains, MS, ath9k_hw_capabilities::num_gpio_pins, ath9k_hw_capabilities::pcie_lcr_extsync_en, ath9k_hw_capabilities::pcie_lcr_offset, REG_READ, ath_common::regulatory, ath9k_hw_capabilities::rts_aggr_limit, ath9k_hw_capabilities::rx_chainmask, ath_common::rx_chainmask, ath9k_hw_capabilities::rx_hp_qdepth, ath9k_hw_capabilities::rx_lp_qdepth, ath9k_hw_capabilities::rx_status_len, ath9k_hw_capabilities::tx_chainmask, ath_common::tx_chainmask, ath9k_hw_capabilities::tx_desc_len, and ath9k_hw_capabilities::txs_len.

Referenced by __ath9k_hw_init().

◆ ath9k_regd_get_ctl()

u32 ath9k_regd_get_ctl ( struct ath_regulatory reg,
struct ath9k_channel chan 
)

Definition at line 869 of file ath9k_hw.c.

870 {
871  u32 ctl = ath_regd_get_band_ctl(reg, chan->chan->band);
872 
873  if (IS_CHAN_B(chan))
874  ctl |= CTL_11B;
875  else if (IS_CHAN_G(chan))
876  ctl |= CTL_11G;
877  else
878  ctl |= CTL_11A;
879 
880  return ctl;
881 }
static unsigned int unsigned int reg
Definition: myson.h:162
#define IS_CHAN_B(_c)
Definition: ath5k.h:660
struct net80211_channel * chan
Definition: hw.h:348
u8 band
The band with which this channel is associated.
Definition: net80211.h:388
#define CTL_11A
Definition: eeprom.h:71
#define CTL_11G
Definition: eeprom.h:73
#define IS_CHAN_G(_c)
Definition: hw.h:356
#define CTL_11B
Definition: eeprom.h:72
u32 ath_regd_get_band_ctl(struct ath_regulatory *reg, int band)
Definition: ath_regd.c:586
uint32_t u32
Definition: stdint.h:24

References ath_regd_get_band_ctl(), net80211_channel::band, ath9k_channel::chan, CTL_11A, CTL_11B, CTL_11G, IS_CHAN_B, IS_CHAN_G, and reg.

Referenced by ar5008_hw_process_ini(), ar9003_hw_process_ini(), ath9k_hw_channel_change(), and ath9k_hw_set_txpowerlimit().

◆ ath9k_hw_cfg_gpio_input()

void ath9k_hw_cfg_gpio_input ( struct ath_hw ah,
u32  gpio 
)

Definition at line 1785 of file ath9k_hw.c.

1786 {
1787  u32 gpio_shift;
1788 
1789  if (AR_DEVID_7010(ah)) {
1790  gpio_shift = gpio;
1792  (AR7010_GPIO_OE_AS_INPUT << gpio_shift),
1793  (AR7010_GPIO_OE_MASK << gpio_shift));
1794  return;
1795  }
1796 
1797  gpio_shift = gpio << 1;
1798  REG_RMW(ah,
1800  (AR_GPIO_OE_OUT_DRV_NO << gpio_shift),
1801  (AR_GPIO_OE_OUT_DRV << gpio_shift));
1802 }
#define AR7010_GPIO_OE_AS_INPUT
Definition: reg.h:1024
#define AR7010_GPIO_OE_MASK
Definition: reg.h:1022
#define REG_RMW(_ah, _reg, _set, _clr)
Definition: hw.h:87
pseudo_bit_t gpio[0x00001]
Definition: arbel.h:30
#define AR_GPIO_OE_OUT_DRV_NO
Definition: reg.h:1016
#define AR_GPIO_OE_OUT_DRV
Definition: reg.h:1015
#define AR_DEVID_7010(_ah)
Definition: reg.h:892
uint8_t ah
Definition: registers.h:85
#define AR_GPIO_OE_OUT
Definition: reg.h:1013
A GPIO pin.
Definition: gpio.h:18
#define AR7010_GPIO_OE
Definition: reg.h:1021
uint32_t u32
Definition: stdint.h:24

References ah, AR7010_GPIO_OE, AR7010_GPIO_OE_AS_INPUT, AR7010_GPIO_OE_MASK, AR_DEVID_7010, AR_GPIO_OE_OUT, AR_GPIO_OE_OUT_DRV, AR_GPIO_OE_OUT_DRV_NO, gpio, and REG_RMW.

Referenced by ath9k_hw_reset(), and ath_radio_disable().

◆ ath9k_hw_gpio_get()

u32 ath9k_hw_gpio_get ( struct ath_hw ah,
u32  gpio 
)

Definition at line 1804 of file ath9k_hw.c.

1805 {
1806 #define MS_REG_READ(x, y) \
1807  (MS(REG_READ(ah, AR_GPIO_IN_OUT), x##_GPIO_IN_VAL) & (AR_GPIO_BIT(y)))
1808 
1809  if (gpio >= ah->caps.num_gpio_pins)
1810  return 0xffffffff;
1811 
1812  if (AR_DEVID_7010(ah)) {
1813  u32 val;
1815  return (MS(val, AR7010_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) == 0;
1816  } else if (AR_SREV_9300_20_OR_LATER(ah))
1818  AR_GPIO_BIT(gpio)) != 0;
1819  else if (AR_SREV_9271(ah))
1820  return MS_REG_READ(AR9271, gpio) != 0;
1821  else if (AR_SREV_9287_11_OR_LATER(ah))
1822  return MS_REG_READ(AR9287, gpio) != 0;
1823  else if (AR_SREV_9285_12_OR_LATER(ah))
1824  return MS_REG_READ(AR9285, gpio) != 0;
1825  else if (AR_SREV_9280_20_OR_LATER(ah))
1826  return MS_REG_READ(AR928X, gpio) != 0;
1827  else
1828  return MS_REG_READ(AR, gpio) != 0;
1829 }
#define AR_SREV_9287_11_OR_LATER(_ah)
Definition: reg.h:837
#define AR_SREV_9280_20_OR_LATER(_ah)
Definition: reg.h:825
void __asmcall int val
Definition: setjmp.h:12
#define MS(_v, _f)
Definition: hw.h:103
#define AR_GPIO_BIT(_gpio)
Definition: hw.h:132
#define AR_SREV_9300_20_OR_LATER(_ah)
Definition: reg.h:865
#define AR_GPIO_IN
Definition: reg.h:1009
#define AR_SREV_9285_12_OR_LATER(_ah)
Definition: reg.h:832
#define MS_REG_READ(x, y)
#define REG_READ(_ah, _reg)
Definition: hw.h:81
#define AR7010_GPIO_IN_VAL
Definition: reg.h:1006
#define AR_SREV_9271(_ah)
Definition: reg.h:854
#define AR_DEVID_7010(_ah)
Definition: reg.h:892
#define AR9300_GPIO_IN_VAL
Definition: reg.h:1010
uint8_t ah
Definition: registers.h:85
A GPIO pin.
Definition: gpio.h:18
uint32_t u32
Definition: stdint.h:24
#define AR7010_GPIO_IN
Definition: reg.h:1025

References ah, AR7010_GPIO_IN, AR7010_GPIO_IN_VAL, AR9300_GPIO_IN_VAL, AR_DEVID_7010, AR_GPIO_BIT, AR_GPIO_IN, AR_SREV_9271, AR_SREV_9280_20_OR_LATER, AR_SREV_9285_12_OR_LATER, AR_SREV_9287_11_OR_LATER, AR_SREV_9300_20_OR_LATER, MS, MS_REG_READ, REG_READ, and val.

Referenced by ath9k_hw_fill_cap_info().

◆ ath9k_hw_cfg_output()

void ath9k_hw_cfg_output ( struct ath_hw ah,
u32  gpio,
u32  ah_signal_type 
)

Definition at line 1831 of file ath9k_hw.c.

1833 {
1834  u32 gpio_shift;
1835 
1836  if (AR_DEVID_7010(ah)) {
1837  gpio_shift = gpio;
1839  (AR7010_GPIO_OE_AS_OUTPUT << gpio_shift),
1840  (AR7010_GPIO_OE_MASK << gpio_shift));
1841  return;
1842  }
1843 
1844  ath9k_hw_gpio_cfg_output_mux(ah, gpio, ah_signal_type);
1845  gpio_shift = 2 * gpio;
1846  REG_RMW(ah,
1848  (AR_GPIO_OE_OUT_DRV_ALL << gpio_shift),
1849  (AR_GPIO_OE_OUT_DRV << gpio_shift));
1850 }
#define AR_GPIO_OE_OUT_DRV_ALL
Definition: reg.h:1019
#define AR7010_GPIO_OE_MASK
Definition: reg.h:1022
#define REG_RMW(_ah, _reg, _set, _clr)
Definition: hw.h:87
pseudo_bit_t gpio[0x00001]
Definition: arbel.h:30
#define AR_GPIO_OE_OUT_DRV
Definition: reg.h:1015
#define AR7010_GPIO_OE_AS_OUTPUT
Definition: reg.h:1023
#define AR_DEVID_7010(_ah)
Definition: reg.h:892
uint8_t ah
Definition: registers.h:85
#define AR_GPIO_OE_OUT
Definition: reg.h:1013
A GPIO pin.
Definition: gpio.h:18
static void ath9k_hw_gpio_cfg_output_mux(struct ath_hw *ah, u32 gpio, u32 type)
Definition: ath9k_hw.c:1757
#define AR7010_GPIO_OE
Definition: reg.h:1021
uint32_t u32
Definition: stdint.h:24

References ah, AR7010_GPIO_OE, AR7010_GPIO_OE_AS_OUTPUT, AR7010_GPIO_OE_MASK, AR_DEVID_7010, AR_GPIO_OE_OUT, AR_GPIO_OE_OUT_DRV, AR_GPIO_OE_OUT_DRV_ALL, ath9k_hw_gpio_cfg_output_mux(), gpio, and REG_RMW.

Referenced by ath9k_hw_apply_gpio_override().

◆ ath9k_hw_set_gpio()

void ath9k_hw_set_gpio ( struct ath_hw ah,
u32  gpio,
u32  val 
)

Definition at line 1852 of file ath9k_hw.c.

1853 {
1854  if (AR_DEVID_7010(ah)) {
1855  val = val ? 0 : 1;
1856  REG_RMW(ah, AR7010_GPIO_OUT, ((val&1) << gpio),
1857  AR_GPIO_BIT(gpio));
1858  return;
1859  }
1860 
1861  if (AR_SREV_9271(ah))
1862  val = ~val;
1863 
1864  REG_RMW(ah, AR_GPIO_IN_OUT, ((val & 1) << gpio),
1865  AR_GPIO_BIT(gpio));
1866 }
void __asmcall int val
Definition: setjmp.h:12
#define AR_GPIO_BIT(_gpio)
Definition: hw.h:132
#define REG_RMW(_ah, _reg, _set, _clr)
Definition: hw.h:87
#define AR_GPIO_IN_OUT
Definition: reg.h:995
#define AR7010_GPIO_OUT
Definition: reg.h:1026
#define AR_SREV_9271(_ah)
Definition: reg.h:854
#define AR_DEVID_7010(_ah)
Definition: reg.h:892
uint8_t ah
Definition: registers.h:85
A GPIO pin.
Definition: gpio.h:18

References ah, AR7010_GPIO_OUT, AR_DEVID_7010, AR_GPIO_BIT, AR_GPIO_IN_OUT, AR_SREV_9271, REG_RMW, and val.

Referenced by ath9k_hw_apply_gpio_override(), and ath_radio_disable().

◆ ath9k_hw_getdefantenna()

u32 ath9k_hw_getdefantenna ( struct ath_hw ah)

Definition at line 1868 of file ath9k_hw.c.

1869 {
1870  return REG_READ(ah, AR_DEF_ANTENNA) & 0x7;
1871 }
#define REG_READ(_ah, _reg)
Definition: hw.h:81
uint8_t ah
Definition: registers.h:85
#define AR_DEF_ANTENNA
Definition: reg.h:1535

References ah, AR_DEF_ANTENNA, and REG_READ.

Referenced by ath9k_init_misc().

◆ ath9k_hw_setantenna()

void ath9k_hw_setantenna ( struct ath_hw ah,
u32  antenna 
)

Definition at line 1873 of file ath9k_hw.c.

1874 {
1875  REG_WRITE(ah, AR_DEF_ANTENNA, (antenna & 0x7));
1876 }
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
uint8_t ah
Definition: registers.h:85
#define AR_DEF_ANTENNA
Definition: reg.h:1535

References ah, AR_DEF_ANTENNA, and REG_WRITE.

Referenced by ath_setdefantenna().

◆ ath9k_hw_wait()

int ath9k_hw_wait ( struct ath_hw ah,
u32  reg,
u32  mask,
u32  val,
u32  timeout 
)

Definition at line 95 of file ath9k_hw.c.

96 {
97  unsigned int i;
98 
99  for (i = 0; i < (timeout / AH_TIME_QUANTUM); i++) {
100  if ((REG_READ(ah, reg) & mask) == val)
101  return 1;
102 
104  }
105 
106  DBG("ath9k: "
107  "timeout (%d us) on reg 0x%x: 0x%08x & 0x%08x != 0x%08x\n",
108  timeout, reg, REG_READ(ah, reg), mask, val);
109 
110  return 0;
111 }
static unsigned int unsigned int reg
Definition: myson.h:162
void __asmcall int val
Definition: setjmp.h:12
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:61
#define REG_READ(_ah, _reg)
Definition: hw.h:81
#define AH_TIME_QUANTUM
Definition: hw.h:148
uint8_t ah
Definition: registers.h:85
void timeout(int)
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498

References ah, AH_TIME_QUANTUM, DBG, reg, REG_READ, timeout(), udelay(), and val.

Referenced by ar5008_hw_rfbus_req(), ar9002_hw_init_cal(), ar9003_hw_init_cal(), ar9003_hw_rfbus_req(), ar9003_hw_tx_iq_cal_run(), ar9285_hw_cl_cal(), ar9300_otp_read_word(), ath9k_hw_set_reset(), ath9k_hw_set_reset_power_on(), ath9k_hw_setrxabort(), and ath_pci_eeprom_read().

◆ ath9k_hw_write_array()

void ath9k_hw_write_array ( struct ath_hw ah,
struct ar5416IniArray array,
int  column,
unsigned int *  writecnt 
)

Definition at line 113 of file ath9k_hw.c.

115 {
116  unsigned int r;
117 
119  for (r = 0; r < array->ia_rows; r++) {
120  REG_WRITE(ah, INI_RA(array, r, 0),
121  INI_RA(array, r, column));
122  DO_DELAY(*writecnt);
123  }
125 }
#define DO_DELAY(x)
Definition: hw.h:113
#define INI_RA(iniarray, row, column)
Definition: calib.h:46
#define REGWRITE_BUFFER_FLUSH(_ah)
Definition: hw.h:96
uint32_t array
Array number.
Definition: edd.h:31
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
uint8_t ah
Definition: registers.h:85
#define ENABLE_REGWRITE_BUFFER(_ah)
Definition: hw.h:90
static const uint8_t r[3][4]
MD4 shift amounts.
Definition: md4.c:54

References ah, array, DO_DELAY, ENABLE_REGWRITE_BUFFER, INI_RA, r, REG_WRITE, and REGWRITE_BUFFER_FLUSH.

◆ ath9k_hw_reverse_bits()

u32 ath9k_hw_reverse_bits ( u32  val,
u32  n 
)

Definition at line 127 of file ath9k_hw.c.

128 {
129  u32 retval;
130  unsigned int i;
131 
132  for (i = 0, retval = 0; i < n; i++) {
133  retval = (retval << 1) | (val & 1);
134  val >>= 1;
135  }
136  return retval;
137 }
void __asmcall int val
Definition: setjmp.h:12
unsigned long retval
Definition: xen.h:46
uint32_t u32
Definition: stdint.h:24

References retval, and val.

Referenced by ar5008_hw_force_bias(), ar5008_hw_phy_modify_rx_buffer(), ar5008_hw_set_channel(), and ar9002_hw_get_radiorev().

◆ ath9k_hw_computetxtime()

u16 ath9k_hw_computetxtime ( struct ath_hw ah,
u8  phy,
int  kbps,
u32  frameLen,
u16  rateix,
int  shortPreamble 
)

Definition at line 139 of file ath9k_hw.c.

143 {
144  u32 bitsPerSymbol, numBits, numSymbols, phyTime, txTime;
145 
146  if (kbps == 0)
147  return 0;
148 
149  switch (phy) {
150  case CHANNEL_CCK:
151  phyTime = CCK_PREAMBLE_BITS + CCK_PLCP_BITS;
152  if (shortPreamble)
153  phyTime >>= 1;
154  numBits = frameLen << 3;
155  txTime = CCK_SIFS_TIME + phyTime + ((numBits * 1000) / kbps);
156  break;
157  case CHANNEL_OFDM:
158  if (ah->curchan && IS_CHAN_QUARTER_RATE(ah->curchan)) {
159  bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_QUARTER) / 1000;
160  numBits = OFDM_PLCP_BITS + (frameLen << 3);
161  numSymbols = DIV_ROUND_UP(numBits, bitsPerSymbol);
162  txTime = OFDM_SIFS_TIME_QUARTER
164  + (numSymbols * OFDM_SYMBOL_TIME_QUARTER);
165  } else if (ah->curchan &&
166  IS_CHAN_HALF_RATE(ah->curchan)) {
167  bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_HALF) / 1000;
168  numBits = OFDM_PLCP_BITS + (frameLen << 3);
169  numSymbols = DIV_ROUND_UP(numBits, bitsPerSymbol);
170  txTime = OFDM_SIFS_TIME_HALF +
172  + (numSymbols * OFDM_SYMBOL_TIME_HALF);
173  } else {
174  bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME) / 1000;
175  numBits = OFDM_PLCP_BITS + (frameLen << 3);
176  numSymbols = DIV_ROUND_UP(numBits, bitsPerSymbol);
178  + (numSymbols * OFDM_SYMBOL_TIME);
179  }
180  break;
181  default:
182  DBG("ath9k: "
183  "Unknown phy %d (rate ix %d)\n", phy, rateix);
184  txTime = 0;
185  break;
186  }
187 
188  return txTime;
189 }
#define OFDM_SYMBOL_TIME_QUARTER
Definition: mac.h:69
#define OFDM_SIFS_TIME_HALF
Definition: mac.h:61
#define OFDM_SIFS_TIME
Definition: mac.h:56
#define IS_CHAN_HALF_RATE(_c)
Definition: hw.h:363
#define OFDM_SIFS_TIME_QUARTER
Definition: mac.h:66
#define IS_CHAN_QUARTER_RATE(_c)
Definition: hw.h:364
#define CHANNEL_CCK
Definition: ath5k.h:632
#define OFDM_PREAMBLE_TIME
Definition: mac.h:57
#define OFDM_PREAMBLE_TIME_HALF
Definition: mac.h:62
#define CHANNEL_OFDM
Definition: ath5k.h:633
#define OFDM_PLCP_BITS
Definition: ath9k_xmit.c:28
#define CCK_PREAMBLE_BITS
Definition: mac.h:53
#define CCK_SIFS_TIME
Definition: mac.h:52
#define OFDM_PREAMBLE_TIME_QUARTER
Definition: mac.h:67
#define OFDM_SYMBOL_TIME_HALF
Definition: mac.h:64
#define CCK_PLCP_BITS
Definition: mac.h:54
uint8_t ah
Definition: registers.h:85
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define OFDM_SYMBOL_TIME
Definition: mac.h:59
uint32_t u32
Definition: stdint.h:24
#define DIV_ROUND_UP(n, d)
Definition: ath.h:31

References ah, CCK_PLCP_BITS, CCK_PREAMBLE_BITS, CCK_SIFS_TIME, CHANNEL_CCK, CHANNEL_OFDM, DBG, DIV_ROUND_UP, IS_CHAN_HALF_RATE, IS_CHAN_QUARTER_RATE, OFDM_PLCP_BITS, OFDM_PREAMBLE_TIME, OFDM_PREAMBLE_TIME_HALF, OFDM_PREAMBLE_TIME_QUARTER, OFDM_SIFS_TIME, OFDM_SIFS_TIME_HALF, OFDM_SIFS_TIME_QUARTER, OFDM_SYMBOL_TIME, OFDM_SYMBOL_TIME_HALF, and OFDM_SYMBOL_TIME_QUARTER.

Referenced by ath_buf_set_rate().

◆ ath9k_hw_get_channel_centers()

void ath9k_hw_get_channel_centers ( struct ath_hw ah,
struct ath9k_channel chan,
struct chan_centers centers 
)

◆ ath9k_hw_getrxfilter()

u32 ath9k_hw_getrxfilter ( struct ath_hw ah)

Definition at line 1882 of file ath9k_hw.c.

1883 {
1885  u32 phybits = REG_READ(ah, AR_PHY_ERR);
1886 
1887  if (phybits & AR_PHY_ERR_RADAR)
1891 
1892  return bits;
1893 }
#define AR_PHY_ERR_RADAR
Definition: reg.h:1631
#define AR_PHY_ERR_CCK_TIMING
Definition: reg.h:1633
#define AR_RX_FILTER
Definition: reg.h:1491
#define AR_PHY_ERR
Definition: reg.h:1628
#define REG_READ(_ah, _reg)
Definition: hw.h:81
static volatile void * bits
Definition: bitops.h:28
uint8_t ah
Definition: registers.h:85
#define AR_PHY_ERR_OFDM_TIMING
Definition: reg.h:1632
uint32_t u32
Definition: stdint.h:24

References ah, AR_PHY_ERR, AR_PHY_ERR_CCK_TIMING, AR_PHY_ERR_OFDM_TIMING, AR_PHY_ERR_RADAR, AR_RX_FILTER, ATH9K_RX_FILTER_PHYERR, ATH9K_RX_FILTER_PHYRADAR, bits, and REG_READ.

Referenced by ath9k_ani_reset_old(), and ath_calcrxfilter().

◆ ath9k_hw_setrxfilter()

void ath9k_hw_setrxfilter ( struct ath_hw ah,
u32  bits 
)

Definition at line 1895 of file ath9k_hw.c.

1896 {
1897  u32 phybits;
1898 
1900 
1902 
1903  phybits = 0;
1905  phybits |= AR_PHY_ERR_RADAR;
1908  REG_WRITE(ah, AR_PHY_ERR, phybits);
1909 
1910  if (phybits)
1912  else
1914 
1916 }
#define REG_CLR_BIT(_a, _r, _f)
Definition: hw.h:110
#define REGWRITE_BUFFER_FLUSH(_ah)
Definition: hw.h:96
#define AR_PHY_ERR_RADAR
Definition: reg.h:1631
#define AR_PHY_ERR_CCK_TIMING
Definition: reg.h:1633
#define AR_RX_FILTER
Definition: reg.h:1491
#define AR_RXCFG
Definition: reg.h:100
#define AR_RXCFG_ZLFDMA
Definition: reg.h:102
#define AR_PHY_ERR
Definition: reg.h:1628
#define REG_SET_BIT(_a, _r, _f)
Definition: hw.h:108
static volatile void * bits
Definition: bitops.h:28
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
uint8_t ah
Definition: registers.h:85
#define AR_PHY_ERR_OFDM_TIMING
Definition: reg.h:1632
uint32_t u32
Definition: stdint.h:24
#define ENABLE_REGWRITE_BUFFER(_ah)
Definition: hw.h:90

References ah, AR_PHY_ERR, AR_PHY_ERR_CCK_TIMING, AR_PHY_ERR_OFDM_TIMING, AR_PHY_ERR_RADAR, AR_RX_FILTER, AR_RXCFG, AR_RXCFG_ZLFDMA, ATH9K_RX_FILTER_PHYERR, ATH9K_RX_FILTER_PHYRADAR, bits, ENABLE_REGWRITE_BUFFER, REG_CLR_BIT, REG_SET_BIT, REG_WRITE, and REGWRITE_BUFFER_FLUSH.

Referenced by ath9k_ani_reset_old(), ath_opmode_init(), and ath_stoprecv().

◆ ath9k_hw_phy_disable()

int ath9k_hw_phy_disable ( struct ath_hw ah)

Definition at line 1918 of file ath9k_hw.c.

1919 {
1921  return 0;
1922 
1924  return 1;
1925 }
static void ath9k_hw_init_pll(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_hw.c:623
static int ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type)
Definition: ath9k_hw.c:1090
uint8_t ah
Definition: registers.h:85
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322

References ah, ath9k_hw_init_pll(), ath9k_hw_set_reset_reg(), ATH9K_RESET_WARM, and NULL.

Referenced by ath9k_stop(), and ath_radio_disable().

◆ ath9k_hw_disable()

int ath9k_hw_disable ( struct ath_hw ah)

Definition at line 1927 of file ath9k_hw.c.

1928 {
1930  return 0;
1931 
1933  return 0;
1934 
1936  return 1;
1937 }
static void ath9k_hw_init_pll(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: ath9k_hw.c:623
static int ath9k_hw_set_reset_reg(struct ath_hw *ah, u32 type)
Definition: ath9k_hw.c:1090
int ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode)
Definition: ath9k_hw.c:1534
uint8_t ah
Definition: registers.h:85
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322

References ah, ath9k_hw_init_pll(), ath9k_hw_set_reset_reg(), ath9k_hw_setpower(), ATH9K_PM_AWAKE, ATH9K_RESET_COLD, and NULL.

Referenced by ath9k_stop().

◆ ath9k_hw_set_txpowerlimit()

void ath9k_hw_set_txpowerlimit ( struct ath_hw ah,
u32  limit,
int  test 
)

Definition at line 1939 of file ath9k_hw.c.

1940 {
1941  struct ath_regulatory *regulatory = ath9k_hw_regulatory(ah);
1942  struct ath9k_channel *chan = ah->curchan;
1943  struct net80211_channel *channel = chan->chan;
1944 
1945  regulatory->power_limit = min(limit, (u32) MAX_RATE_POWER);
1946 
1947  ah->eep_ops->set_txpower(ah, chan,
1948  ath9k_regd_get_ctl(regulatory, chan),
1949  0,
1950  channel->maxpower * 2,
1952  (u32) regulatory->power_limit), test);
1953 }
#define min(x, y)
Definition: ath.h:36
struct net80211_channel * chan
Definition: hw.h:348
u32 ath9k_regd_get_ctl(struct ath_regulatory *reg, struct ath9k_channel *chan)
Definition: ath9k_hw.c:869
static struct ath_regulatory * ath9k_hw_regulatory(struct ath_hw *ah)
Definition: hw.h:875
int16_t power_limit
Definition: ath.h:145
uint32_t channel
RNDIS channel.
Definition: netvsc.h:14
uint16_t limit
Limit.
Definition: librm.h:136
An 802.11 RF channel.
Definition: net80211.h:385
uint8_t ah
Definition: registers.h:85
static int test
Definition: epic100.c:73
#define MAX_RATE_POWER
Definition: hw.h:145
uint32_t u32
Definition: stdint.h:24

References ah, ath9k_hw_regulatory(), ath9k_regd_get_ctl(), ath9k_channel::chan, channel, limit, MAX_RATE_POWER, min, ath_regulatory::power_limit, and test.

Referenced by ath9k_cmn_update_txpow(), and ath9k_init_band_txpower().

◆ ath9k_hw_setopmode()

void ath9k_hw_setopmode ( struct ath_hw ah)

Definition at line 1955 of file ath9k_hw.c.

1956 {
1958 }
static void ath9k_hw_set_operating_mode(struct ath_hw *ah)
Definition: ath9k_hw.c:956
uint8_t ah
Definition: registers.h:85

References ah, and ath9k_hw_set_operating_mode().

Referenced by ath_opmode_init().

◆ ath9k_hw_setmcastfilter()

void ath9k_hw_setmcastfilter ( struct ath_hw ah,
u32  filter0,
u32  filter1 
)

Definition at line 1960 of file ath9k_hw.c.

1961 {
1962  REG_WRITE(ah, AR_MCAST_FIL0, filter0);
1963  REG_WRITE(ah, AR_MCAST_FIL1, filter1);
1964 }
#define AR_MCAST_FIL1
Definition: reg.h:1494
#define AR_MCAST_FIL0
Definition: reg.h:1493
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
uint8_t ah
Definition: registers.h:85

References ah, AR_MCAST_FIL0, AR_MCAST_FIL1, and REG_WRITE.

Referenced by ath_opmode_init().

◆ ath9k_hw_setbssidmask()

void ath9k_hw_setbssidmask ( struct ath_hw ah)

◆ ath9k_hw_write_associd()

void ath9k_hw_write_associd ( struct ath_hw ah)

Definition at line 1966 of file ath9k_hw.c.

1967 {
1968  struct ath_common *common = ath9k_hw_common(ah);
1969 
1971  REG_WRITE(ah, AR_BSS_ID1, get_unaligned_le16(common->curbssid + 4) |
1972  ((common->curaid & 0x3fff) << AR_BSS_ID1_AID_S));
1973 }
static u32 get_unaligned_le32(const void *p)
Definition: ath.h:89
static u16 get_unaligned_le16(const void *p)
Definition: ath.h:85
static struct ath_common * ath9k_hw_common(struct ath_hw *ah)
Definition: hw.h:870
#define AR_BSS_ID1
Definition: reg.h:1454
struct ib_cm_common common
Definition: ib_mad.h:12
#define AR_BSS_ID1_AID_S
Definition: reg.h:1457
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
uint8_t ah
Definition: registers.h:85
#define AR_BSS_ID0
Definition: reg.h:1453

References ah, AR_BSS_ID0, AR_BSS_ID1, AR_BSS_ID1_AID_S, ath9k_hw_common(), common, get_unaligned_le16(), get_unaligned_le32(), and REG_WRITE.

Referenced by ath9k_bss_iter(), ath9k_config_bss(), and ath9k_hw_reset().

◆ ath9k_hw_init_global_settings()

void ath9k_hw_init_global_settings ( struct ath_hw ah)

Definition at line 814 of file ath9k_hw.c.

815 {
816  int acktimeout;
817  int slottime;
818  int sifstime;
819 
820  DBG2("ath9k: ah->misc_mode 0x%x\n",
821  ah->misc_mode);
822 
823  if (ah->misc_mode != 0)
824  REG_SET_BIT(ah, AR_PCU_MISC, ah->misc_mode);
825 
826  if ((ah->dev->channels + ah->dev->channel)->band == NET80211_BAND_5GHZ)
827  sifstime = 16;
828  else
829  sifstime = 10;
830 
831  /* As defined by IEEE 802.11-2007 17.3.8.6 */
832  slottime = ah->slottime + 3 * ah->coverage_class;
833  acktimeout = slottime + sifstime;
834 
835  /*
836  * Workaround for early ACK timeouts, add an offset to match the
837  * initval's 64us ack timeout value.
838  * This was initially only meant to work around an issue with delayed
839  * BA frames in some implementations, but it has been found to fix ACK
840  * timeout issues in other cases as well.
841  */
842  if ((ah->dev->channels + ah->dev->channel)->band == NET80211_BAND_2GHZ)
843  acktimeout += 64 - sifstime - ah->slottime;
844 
845  ath9k_hw_setslottime(ah, ah->slottime);
846  ath9k_hw_set_ack_timeout(ah, acktimeout);
847  ath9k_hw_set_cts_timeout(ah, acktimeout);
848  if (ah->globaltxtimeout != (u32) -1)
849  ath9k_hw_set_global_txtimeout(ah, ah->globaltxtimeout);
850 }
static int ath9k_hw_set_global_txtimeout(struct ath_hw *ah, u32 tu)
Definition: ath9k_hw.c:800
static void ath9k_hw_set_ack_timeout(struct ath_hw *ah, u32 us)
Definition: ath9k_hw.c:786
static void ath9k_hw_setslottime(struct ath_hw *ah, u32 us)
Definition: ath9k_hw.c:779
#define NET80211_BAND_2GHZ
The 2.4 GHz ISM band, unlicensed in most countries.
Definition: net80211.h:45
static void ath9k_hw_set_cts_timeout(struct ath_hw *ah, u32 us)
Definition: ath9k_hw.c:793
#define AR_PCU_MISC
Definition: reg.h:1641
#define NET80211_BAND_5GHZ
The band from 4.9 GHz to 5.7 GHz, which tends to be more restricted.
Definition: net80211.h:47
#define REG_SET_BIT(_a, _r, _f)
Definition: hw.h:108
uint8_t ah
Definition: registers.h:85
uint32_t u32
Definition: stdint.h:24
#define DBG2(...)
Definition: compiler.h:515

References ah, AR_PCU_MISC, ath9k_hw_set_ack_timeout(), ath9k_hw_set_cts_timeout(), ath9k_hw_set_global_txtimeout(), ath9k_hw_setslottime(), DBG2, NET80211_BAND_2GHZ, NET80211_BAND_5GHZ, and REG_SET_BIT.

Referenced by ath9k_bss_info_changed(), and ath9k_hw_reset().

◆ ar9003_get_pll_sqsum_dvc()

u32 ar9003_get_pll_sqsum_dvc ( struct ath_hw ah)

Definition at line 611 of file ath9k_hw.c.

612 {
614  udelay(100);
616 
617  while ((REG_READ(ah, PLL4) & PLL4_MEAS_DONE) == 0)
618  udelay(100);
619 
620  return (REG_READ(ah, PLL3) & SQSUM_DVC_MASK) >> 3;
621 }
#define REG_CLR_BIT(_a, _r, _f)
Definition: hw.h:110
#define PLL4
Definition: reg.h:1192
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
Definition: timer.c:61
#define PLL3_DO_MEAS_MASK
Definition: reg.h:1191
#define PLL3
Definition: reg.h:1190
#define REG_READ(_ah, _reg)
Definition: hw.h:81
#define REG_SET_BIT(_a, _r, _f)
Definition: hw.h:108
uint8_t ah
Definition: registers.h:85
#define PLL4_MEAS_DONE
Definition: reg.h:1193
#define SQSUM_DVC_MASK
Definition: reg.h:1194

References ah, PLL3, PLL3_DO_MEAS_MASK, PLL4, PLL4_MEAS_DONE, REG_CLR_BIT, REG_READ, REG_SET_BIT, SQSUM_DVC_MASK, and udelay().

Referenced by ath_hw_pll_work().

◆ ath9k_hw_set11nmac2040()

void ath9k_hw_set11nmac2040 ( struct ath_hw ah)

Definition at line 1975 of file ath9k_hw.c.

1976 {
1977  u32 macmode;
1978 
1979  macmode = 0;
1980 
1981  REG_WRITE(ah, AR_2040_MODE, macmode);
1982 }
#define AR_2040_MODE
Definition: reg.h:1818
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
uint8_t ah
Definition: registers.h:85
uint32_t u32
Definition: stdint.h:24

References ah, AR_2040_MODE, and REG_WRITE.

Referenced by ar5008_hw_set_channel_regs(), and ar9003_hw_set_channel_regs().

◆ ath9k_hw_check_alive()

int ath9k_hw_check_alive ( struct ath_hw ah)

Definition at line 1191 of file ath9k_hw.c.

1192 {
1193  int count = 50;
1194  u32 reg;
1195 
1197  return 1;
1198 
1199  do {
1201 
1202  if ((reg & 0x7E7FFFEF) == 0x00702400)
1203  continue;
1204 
1205  switch (reg & 0x7E000B00) {
1206  case 0x1E000000:
1207  case 0x52000B00:
1208  case 0x18000B00:
1209  continue;
1210  default:
1211  return 1;
1212  }
1213  } while (count-- > 0);
1214 
1215  return 0;
1216 }
static unsigned int unsigned int reg
Definition: myson.h:162
#define AR_OBS_BUS_1
Definition: reg.h:1559
static unsigned int count
Number of entries.
Definition: dwmac.h:225
#define AR_SREV_9285_12_OR_LATER(_ah)
Definition: reg.h:832
#define REG_READ(_ah, _reg)
Definition: hw.h:81
uint8_t ah
Definition: registers.h:85
uint32_t u32
Definition: stdint.h:24

References ah, AR_OBS_BUS_1, AR_SREV_9285_12_OR_LATER, count, reg, and REG_READ.

Referenced by ath_hw_check(), and ath_set_channel().

◆ ath9k_hw_setpower()

int ath9k_hw_setpower ( struct ath_hw ah,
enum ath9k_power_mode  mode 
)

Definition at line 1534 of file ath9k_hw.c.

1535 {
1536  int status = 1, setChip = 1;
1537  static const char *modes[] = {
1538  "AWAKE",
1539  "FULL-SLEEP",
1540  "NETWORK SLEEP",
1541  "UNDEFINED"
1542  };
1543 
1544  if (ah->power_mode == mode)
1545  return status;
1546 
1547  DBG2("ath9k: %s -> %s\n",
1548  modes[ah->power_mode], modes[mode]);
1549 
1550  switch (mode) {
1551  case ATH9K_PM_AWAKE:
1552  status = ath9k_hw_set_power_awake(ah, setChip);
1553  break;
1554  case ATH9K_PM_FULL_SLEEP:
1555  ath9k_set_power_sleep(ah, setChip);
1556  ah->chip_fullsleep = 1;
1557  break;
1558  default:
1559  DBG("ath9k: Unknown power mode %d\n", mode);
1560  return 0;
1561  }
1562  ah->power_mode = mode;
1563 
1564  return status;
1565 }
uint16_t mode
Acceleration mode.
Definition: ena.h:26
static int ath9k_hw_set_power_awake(struct ath_hw *ah, int setChip)
Definition: ath9k_hw.c:1484
static void ath9k_set_power_sleep(struct ath_hw *ah, int setChip)
Definition: ath9k_hw.c:1459
uint8_t status
Status.
Definition: ena.h:16
uint8_t ah
Definition: registers.h:85
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define DBG2(...)
Definition: compiler.h:515

References ah, ath9k_hw_set_power_awake(), ATH9K_PM_AWAKE, ATH9K_PM_FULL_SLEEP, ath9k_set_power_sleep(), DBG, DBG2, mode, and status.

Referenced by __ath9k_hw_init(), ath9k_hw_chip_reset(), ath9k_hw_deinit(), ath9k_hw_disable(), ath9k_hw_reset(), and ath9k_setpower().

◆ ath9k_hw_name()

void ath9k_hw_name ( struct ath_hw ah,
char *  hw_name,
size_t  len 
)

Definition at line 2047 of file ath9k_hw.c.

2048 {
2049  int used;
2050 
2051  /* chipsets >= AR9280 are single-chip */
2053  used = snprintf(hw_name, len,
2054  "Atheros AR%s Rev:%x",
2055  ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
2056  ah->hw_version.macRev);
2057  }
2058  else {
2059  used = snprintf(hw_name, len,
2060  "Atheros AR%s MAC/BB Rev:%x AR%s RF Rev:%x",
2061  ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
2062  ah->hw_version.macRev,
2063  ath9k_hw_rf_name((ah->hw_version.analog5GhzRev &
2065  ah->hw_version.phyRev);
2066  }
2067 
2068  hw_name[used] = '\0';
2069 }
#define AR_SREV_9280_20_OR_LATER(_ah)
Definition: reg.h:825
static const char * ath9k_hw_mac_bb_name(u32 mac_bb_version)
Definition: ath9k_hw.c:2017
static const char * ath9k_hw_rf_name(u16 rf_version)
Definition: ath9k_hw.c:2034
ring len
Length.
Definition: dwmac.h:231
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:383
uint8_t ah
Definition: registers.h:85
#define AR_RADIO_SREV_MAJOR
Definition: reg.h:896

References ah, AR_RADIO_SREV_MAJOR, AR_SREV_9280_20_OR_LATER, ath9k_hw_mac_bb_name(), ath9k_hw_rf_name(), len, and snprintf().

Referenced by ath_pci_probe().

◆ ath9k_hw_htc_resetinit()

void ath9k_hw_htc_resetinit ( struct ath_hw ah)

◆ ath9k_hw_get_delta_slope_vals()

void ath9k_hw_get_delta_slope_vals ( struct ath_hw ah,
u32  coef_scaled,
u32 coef_mantissa,
u32 coef_exponent 
)

◆ ar9002_hw_cck_chan14_spread()

void ar9002_hw_cck_chan14_spread ( struct ath_hw ah)

Definition at line 189 of file ath9k_ar9002_hw.c.

190 {
192  INIT_INI_ARRAY(&ah->iniCckfirNormal,
195  2);
196  INIT_INI_ARRAY(&ah->iniCckfirJapan2484,
199  2);
200  }
201 }
#define AR_SREV_9287_11_OR_LATER(_ah)
Definition: reg.h:837
#define ARRAY_SIZE(x)
Definition: efx_common.h:43
static __unused const u32 ar9287Common_normal_cck_fir_coeff_9287_1_1[][2]
#define INIT_INI_ARRAY(iniarray, array, rows, columns)
Definition: calib.h:40
uint8_t ah
Definition: registers.h:85
static __unused const u32 ar9287Common_japan_2484_cck_fir_coeff_9287_1_1[][2]

References ah, ar9287Common_japan_2484_cck_fir_coeff_9287_1_1, ar9287Common_normal_cck_fir_coeff_9287_1_1, AR_SREV_9287_11_OR_LATER, ARRAY_SIZE, and INIT_INI_ARRAY.

Referenced by __ath9k_hw_init().

◆ ar9002_hw_rf_claim()

int ar9002_hw_rf_claim ( struct ath_hw ah)

Definition at line 465 of file ath9k_ar9002_hw.c.

466 {
467  u32 val;
468 
469  REG_WRITE(ah, AR_PHY(0), 0x00000007);
470 
472  switch (val & AR_RADIO_SREV_MAJOR) {
473  case 0:
475  break;
480  break;
481  default:
482  DBG("ath9k: "
483  "Radio Chip Rev 0x%02X not supported\n",
485  return -EOPNOTSUPP;
486  }
487 
488  ah->hw_version.analog5GhzRev = val;
489 
490  return 0;
491 }
#define AR_PHY(_n)
Definition: phy.h:28
#define AR_RAD5133_SREV_MAJOR
Definition: reg.h:897
#define AR_RAD5122_SREV_MAJOR
Definition: reg.h:899
void __asmcall int val
Definition: setjmp.h:12
static int ar9002_hw_get_radiorev(struct ath_hw *ah)
#define AR_RAD2122_SREV_MAJOR
Definition: reg.h:900
#define AR_RAD2133_SREV_MAJOR
Definition: reg.h:898
#define EOPNOTSUPP
Operation not supported on socket.
Definition: errno.h:605
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
uint8_t ah
Definition: registers.h:85
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define AR_RADIO_SREV_MAJOR
Definition: reg.h:896
uint32_t u32
Definition: stdint.h:24

References ah, ar9002_hw_get_radiorev(), AR_PHY, AR_RAD2122_SREV_MAJOR, AR_RAD2133_SREV_MAJOR, AR_RAD5122_SREV_MAJOR, AR_RAD5133_SREV_MAJOR, AR_RADIO_SREV_MAJOR, DBG, EOPNOTSUPP, REG_WRITE, and val.

Referenced by ath9k_hw_post_init().

◆ ar9002_hw_enable_async_fifo()

void ar9002_hw_enable_async_fifo ( struct ath_hw ah)

Definition at line 493 of file ath9k_ar9002_hw.c.

494 {
503  }
504 }
#define REG_CLR_BIT(_a, _r, _f)
Definition: hw.h:110
#define AR_PHY_MODE_ASYNCFIFO
Definition: ar9002_phy.h:398
#define REG_SET_BIT(_a, _r, _f)
Definition: hw.h:108
#define AR_MAC_PCU_ASYNC_FIFO_REG3
Definition: reg.h:1846
#define AR_SREV_9287_13_OR_LATER(_ah)
Definition: reg.h:849
uint8_t ah
Definition: registers.h:85
#define AR_MAC_PCU_ASYNC_FIFO_REG3_DATAPATH_SEL
Definition: reg.h:1847
#define AR_PHY_MODE
Definition: ar9002_phy.h:397
#define AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET
Definition: reg.h:1848

References ah, AR_MAC_PCU_ASYNC_FIFO_REG3, AR_MAC_PCU_ASYNC_FIFO_REG3_DATAPATH_SEL, AR_MAC_PCU_ASYNC_FIFO_REG3_SOFT_RESET, AR_PHY_MODE, AR_PHY_MODE_ASYNCFIFO, AR_SREV_9287_13_OR_LATER, REG_CLR_BIT, and REG_SET_BIT.

Referenced by ath9k_hw_reset().

◆ ar9002_hw_update_async_fifo()

void ar9002_hw_update_async_fifo ( struct ath_hw ah)

Definition at line 513 of file ath9k_ar9002_hw.c.

514 {
522 
525 
530  }
531 }
#define AR_D_GBL_IFS_EIFS_ASYNC_FIFO_DUR
Definition: reg.h:627
#define AR_TIME_OUT_ACK_CTS_ASYNC_FIFO_DUR
Definition: reg.h:1467
#define AR_D_GBL_IFS_SLOT_ASYNC_FIFO_DUR
Definition: reg.h:622
#define AR_D_GBL_IFS_SIFS
Definition: reg.h:604
#define AR_AHB_MODE
Definition: reg.h:902
#define AR_AHB_CUSTOM_BURST_EN
Definition: reg.h:911
#define REG_RMW_FIELD(_a, _r, _f, _v)
Definition: hw.h:104
#define AR_TIME_OUT
Definition: reg.h:1462
#define AR_D_GBL_IFS_SIFS_ASYNC_FIFO_DUR
Definition: reg.h:606
#define AR_USEC
Definition: reg.h:1477
#define AR_D_GBL_IFS_EIFS
Definition: reg.h:624
#define AR_MAC_PCU_LOGIC_ANALYZER
Definition: reg.h:1814
#define REG_SET_BIT(_a, _r, _f)
Definition: hw.h:108
#define AR_USEC_ASYNC_FIFO_DUR
Definition: reg.h:1483
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
#define AR_SREV_9287_13_OR_LATER(_ah)
Definition: reg.h:849
uint8_t ah
Definition: registers.h:85
#define AR_MAC_PCU_LOGIC_ANALYZER_DISBUG20768
Definition: reg.h:1815
#define AR_AHB_CUSTOM_BURST_ASYNC_FIFO_VAL
Definition: reg.h:913
#define AR_D_GBL_IFS_SLOT
Definition: reg.h:619

References ah, AR_AHB_CUSTOM_BURST_ASYNC_FIFO_VAL, AR_AHB_CUSTOM_BURST_EN, AR_AHB_MODE, AR_D_GBL_IFS_EIFS, AR_D_GBL_IFS_EIFS_ASYNC_FIFO_DUR, AR_D_GBL_IFS_SIFS, AR_D_GBL_IFS_SIFS_ASYNC_FIFO_DUR, AR_D_GBL_IFS_SLOT, AR_D_GBL_IFS_SLOT_ASYNC_FIFO_DUR, AR_MAC_PCU_LOGIC_ANALYZER, AR_MAC_PCU_LOGIC_ANALYZER_DISBUG20768, AR_SREV_9287_13_OR_LATER, AR_TIME_OUT, AR_TIME_OUT_ACK_CTS_ASYNC_FIFO_DUR, AR_USEC, AR_USEC_ASYNC_FIFO_DUR, REG_RMW_FIELD, REG_SET_BIT, and REG_WRITE.

Referenced by ath9k_hw_reset().

◆ ar9002_hw_enable_wep_aggregation()

void ar9002_hw_enable_wep_aggregation ( struct ath_hw ah)

Definition at line 537 of file ath9k_ar9002_hw.c.

538 {
542  }
543 }
#define AR_PCU_MISC_MODE2_ENABLE_AGGWEP
Definition: reg.h:1841
#define AR_PCU_MISC_MODE2
Definition: reg.h:1831
#define REG_SET_BIT(_a, _r, _f)
Definition: hw.h:108
#define AR_SREV_9287_13_OR_LATER(_ah)
Definition: reg.h:849
uint8_t ah
Definition: registers.h:85

References ah, AR_PCU_MISC_MODE2, AR_PCU_MISC_MODE2_ENABLE_AGGWEP, AR_SREV_9287_13_OR_LATER, and REG_SET_BIT.

Referenced by ath9k_hw_reset().

◆ ar9003_hw_disable_phy_restart()

void ar9003_hw_disable_phy_restart ( struct ath_hw ah)

Definition at line 1272 of file ath9k_ar9003_phy.c.

1273 {
1274  u32 val;
1275 
1277  val &= ~AR_PHY_RESTART_ENA;
1278 
1280 }
void __asmcall int val
Definition: setjmp.h:12
#define AR_PHY_RESTART
Definition: ar9002_phy.h:265
#define AR_PHY_RESTART_ENA
Definition: ar9003_phy.h:411
#define REG_READ(_ah, _reg)
Definition: hw.h:81
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
uint8_t ah
Definition: registers.h:85
uint32_t u32
Definition: stdint.h:24

References ah, AR_PHY_RESTART, AR_PHY_RESTART_ENA, REG_READ, REG_WRITE, and val.

Referenced by ath9k_hw_reset().

◆ ar5008_hw_attach_phy_ops()

void ar5008_hw_attach_phy_ops ( struct ath_hw ah)

Definition at line 1620 of file ath9k_ar5008_phy.c.

1621 {
1622  struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
1623  static const u32 ar5416_cca_regs[6] = {
1624  AR_PHY_CCA,
1630  };
1631 
1632  priv_ops->rf_set_freq = ar5008_hw_set_channel;
1634 
1637  priv_ops->set_rf_regs = ar5008_hw_set_rf_regs;
1639  priv_ops->init_bb = ar5008_hw_init_bb;
1640  priv_ops->process_ini = ar5008_hw_process_ini;
1641  priv_ops->set_rfmode = ar5008_hw_set_rfmode;
1644  priv_ops->rfbus_req = ar5008_hw_rfbus_req;
1645  priv_ops->rfbus_done = ar5008_hw_rfbus_done;
1647  priv_ops->set_diversity = ar5008_set_diversity;
1648  priv_ops->do_getnf = ar5008_hw_do_getnf;
1650 
1651  if (modparam_force_new_ani) {
1654  } else
1656 
1657  if (AR_SREV_9100(ah))
1659  else if (AR_SREV_9160_10_OR_LATER(ah))
1661  else
1663 
1666  memcpy(ah->nf_regs, ar5416_cca_regs, sizeof(ah->nf_regs));
1667 }
void(* set_delta_slope)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:578
static int ar5008_hw_ani_control_new(struct ath_hw *ah, enum ath9k_ani_cmd cmd, int param)
#define AR_PHY_CH1_CCA
Definition: ar9002_phy.h:570
void(* init_bb)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:572
static int ar5008_hw_rfbus_req(struct ath_hw *ah)
void(* rf_free_ext_banks)(struct ath_hw *ah)
Definition: hw.h:567
void(* spur_mitigate_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:564
int(* rf_alloc_ext_banks)(struct ath_hw *ah)
Definition: hw.h:566
static void ar5008_restore_chainmask(struct ath_hw *ah)
void(* rfbus_done)(struct ath_hw *ah)
Definition: hw.h:580
static int ar5008_hw_set_rf_regs(struct ath_hw *ah, struct ath9k_channel *chan, u16 modesIndex)
static void ar5008_hw_mark_phy_inactive(struct ath_hw *ah)
struct ath_hw_private_ops - callbacks used internally by hardware code
Definition: hw.h:551
static void ar5008_hw_set_channel_regs(struct ath_hw *ah, struct ath9k_channel *chan)
#define AR_SREV_9100(ah)
Definition: reg.h:811
static void ar5008_hw_init_bb(struct ath_hw *ah, struct ath9k_channel *chan)
static u32 ar5008_hw_compute_pll_control(struct ath_hw *ah __unused, struct ath9k_channel *chan)
static void ar5008_hw_set_nf_limits(struct ath_hw *ah)
void(* mark_phy_inactive)(struct ath_hw *ah)
Definition: hw.h:577
#define AR_PHY_EXT_CCA
Definition: ar9002_phy.h:332
static void ar5008_hw_set_rfmode(struct ath_hw *ah, struct ath9k_channel *chan)
void * memcpy(void *dest, const void *src, size_t len) __nonnull
int(* process_ini)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:574
static int ar5008_hw_ani_control_old(struct ath_hw *ah, enum ath9k_ani_cmd cmd, int param)
static int ar5008_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
ar5008_hw_set_channel - tune to a channel on the external AR2133/AR5133 radios @ah: atheros hardware ...
int(* set_rf_regs)(struct ath_hw *ah, struct ath9k_channel *chan, u16 modesIndex)
Definition: hw.h:568
void(* ani_cache_ini_regs)(struct ath_hw *ah)
Definition: hw.h:592
static void ar5008_hw_rf_free_ext_banks(struct ath_hw *ah)
ar5008_hw_rf_free_ext_banks - Free memory for analog bank scratch buffers @ah: atheros hardware strut...
static int ar5008_hw_process_ini(struct ath_hw *ah, struct ath9k_channel *chan)
static void ar5008_hw_set_radar_conf(struct ath_hw *ah)
static int ar5008_hw_rf_alloc_ext_banks(struct ath_hw *ah)
ar5008_hw_rf_alloc_ext_banks - allocates banks for external radio programming @ah: atheros hardware s...
#define AR_PHY_CH2_EXT_CCA
Definition: ar9002_phy.h:586
static u32 ar9160_hw_compute_pll_control(struct ath_hw *ah __unused, struct ath9k_channel *chan)
#define AR_PHY_CH1_EXT_CCA
Definition: ar9002_phy.h:580
static void ar5008_hw_do_getnf(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
static void ar5008_hw_spur_mitigate(struct ath_hw *ah, struct ath9k_channel *chan)
ar5008_hw_spur_mitigate - convert baseband spur frequency for external radios @ah: atheros hardware s...
#define AR_PHY_CH2_CCA
Definition: ar9002_phy.h:576
static u32 ar9100_hw_compute_pll_control(struct ath_hw *ah __unused, struct ath9k_channel *chan)
void(* set_rfmode)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:576
void(* set_diversity)(struct ath_hw *ah, int value)
Definition: hw.h:582
#define AR_PHY_CCA
Definition: ar9002_phy.h:130
int(* rfbus_req)(struct ath_hw *ah)
Definition: hw.h:579
int modparam_force_new_ani
static void ar5008_hw_ani_cache_ini_regs(struct ath_hw *ah)
int(* ani_control)(struct ath_hw *ah, enum ath9k_ani_cmd cmd, int param)
Definition: hw.h:585
int(* rf_set_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:562
static void ar5008_hw_set_delta_slope(struct ath_hw *ah, struct ath9k_channel *chan)
void(* set_channel_regs)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:571
uint8_t ah
Definition: registers.h:85
u32(* compute_pll_control)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:583
#define AR_SREV_9160_10_OR_LATER(_ah)
Definition: reg.h:818
void(* set_radar_params)(struct ath_hw *ah, struct ath_hw_radar_conf *conf)
Definition: hw.h:588
static struct ath_hw_private_ops * ath9k_hw_private_ops(struct ath_hw *ah)
Definition: hw.h:880
void(* do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
Definition: hw.h:587
void(* restore_chainmask)(struct ath_hw *ah)
Definition: hw.h:581
static void ar5008_hw_rfbus_done(struct ath_hw *ah)
uint32_t u32
Definition: stdint.h:24
static void ar5008_hw_set_radar_params(struct ath_hw *ah, struct ath_hw_radar_conf *conf)
static void ar5008_set_diversity(struct ath_hw *ah, int value)

References ah, ath_hw_private_ops::ani_cache_ini_regs, ath_hw_private_ops::ani_control, ar5008_hw_ani_cache_ini_regs(), ar5008_hw_ani_control_new(), ar5008_hw_ani_control_old(), ar5008_hw_compute_pll_control(), ar5008_hw_do_getnf(), ar5008_hw_init_bb(), ar5008_hw_mark_phy_inactive(), ar5008_hw_process_ini(), ar5008_hw_rf_alloc_ext_banks(), ar5008_hw_rf_free_ext_banks(), ar5008_hw_rfbus_done(), ar5008_hw_rfbus_req(), ar5008_hw_set_channel(), ar5008_hw_set_channel_regs(), ar5008_hw_set_delta_slope(), ar5008_hw_set_nf_limits(), ar5008_hw_set_radar_conf(), ar5008_hw_set_radar_params(), ar5008_hw_set_rf_regs(), ar5008_hw_set_rfmode(), ar5008_hw_spur_mitigate(), ar5008_restore_chainmask(), ar5008_set_diversity(), ar9100_hw_compute_pll_control(), ar9160_hw_compute_pll_control(), AR_PHY_CCA, AR_PHY_CH1_CCA, AR_PHY_CH1_EXT_CCA, AR_PHY_CH2_CCA, AR_PHY_CH2_EXT_CCA, AR_PHY_EXT_CCA, AR_SREV_9100, AR_SREV_9160_10_OR_LATER, ath9k_hw_private_ops(), ath_hw_private_ops::compute_pll_control, ath_hw_private_ops::do_getnf, ath_hw_private_ops::init_bb, ath_hw_private_ops::mark_phy_inactive, memcpy(), modparam_force_new_ani, ath_hw_private_ops::process_ini, ath_hw_private_ops::restore_chainmask, ath_hw_private_ops::rf_alloc_ext_banks, ath_hw_private_ops::rf_free_ext_banks, ath_hw_private_ops::rf_set_freq, ath_hw_private_ops::rfbus_done, ath_hw_private_ops::rfbus_req, ath_hw_private_ops::set_channel_regs, ath_hw_private_ops::set_delta_slope, ath_hw_private_ops::set_diversity, ath_hw_private_ops::set_radar_params, ath_hw_private_ops::set_rf_regs, ath_hw_private_ops::set_rfmode, and ath_hw_private_ops::spur_mitigate_freq.

Referenced by ar9002_hw_attach_ops().

◆ ar9002_hw_attach_phy_ops()

void ar9002_hw_attach_phy_ops ( struct ath_hw ah)

Definition at line 563 of file ath9k_ar9002_phy.c.

564 {
565  struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
566  struct ath_hw_ops *ops = ath9k_hw_ops(ah);
567 
568  priv_ops->set_rf_regs = NULL;
569  priv_ops->rf_alloc_ext_banks = NULL;
570  priv_ops->rf_free_ext_banks = NULL;
573  priv_ops->olc_init = ar9002_olc_init;
575  priv_ops->do_getnf = ar9002_hw_do_getnf;
576 
579 
581 }
void(* rf_free_ext_banks)(struct ath_hw *ah)
Definition: hw.h:567
void(* spur_mitigate_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:564
int(* rf_alloc_ext_banks)(struct ath_hw *ah)
Definition: hw.h:566
static u32 ar9002_hw_compute_pll_control(struct ath_hw *ah, struct ath9k_channel *chan)
void(* olc_init)(struct ath_hw *ah)
Definition: hw.h:575
struct ath_hw_private_ops - callbacks used internally by hardware code
Definition: hw.h:551
void(* antdiv_comb_conf_set)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition: hw.h:642
static int ar9002_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
DOC: Programming Atheros 802.11n analog front end radios.
static void ar9002_hw_set_nf_limits(struct ath_hw *ah)
static void ar9002_hw_do_getnf(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
int(* set_rf_regs)(struct ath_hw *ah, struct ath9k_channel *chan, u16 modesIndex)
Definition: hw.h:568
static void ar9002_hw_spur_mitigate(struct ath_hw *ah, struct ath9k_channel *chan)
ar9002_hw_spur_mitigate - convert baseband spur frequency @ah: atheros hardware structure @chan:
struct ath_hw_ops - callbacks used by hardware code and driver code
Definition: hw.h:604
static void ar9002_olc_init(struct ath_hw *ah)
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition: hw.h:885
static void ar9002_hw_antdiv_comb_conf_set(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
void(* antdiv_comb_conf_get)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition: hw.h:640
int(* rf_set_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:562
static void ar9002_hw_antdiv_comb_conf_get(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
uint8_t ah
Definition: registers.h:85
u32(* compute_pll_control)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:583
static struct ath_hw_private_ops * ath9k_hw_private_ops(struct ath_hw *ah)
Definition: hw.h:880
void(* do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
Definition: hw.h:587
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322

References ah, ath_hw_ops::antdiv_comb_conf_get, ath_hw_ops::antdiv_comb_conf_set, ar9002_hw_antdiv_comb_conf_get(), ar9002_hw_antdiv_comb_conf_set(), ar9002_hw_compute_pll_control(), ar9002_hw_do_getnf(), ar9002_hw_set_channel(), ar9002_hw_set_nf_limits(), ar9002_hw_spur_mitigate(), ar9002_olc_init(), ath9k_hw_ops(), ath9k_hw_private_ops(), ath_hw_private_ops::compute_pll_control, ath_hw_private_ops::do_getnf, NULL, ath_hw_private_ops::olc_init, ath_hw_private_ops::rf_alloc_ext_banks, ath_hw_private_ops::rf_free_ext_banks, ath_hw_private_ops::rf_set_freq, ath_hw_private_ops::set_rf_regs, and ath_hw_private_ops::spur_mitigate_freq.

Referenced by ar9002_hw_attach_ops().

◆ ar9003_hw_attach_phy_ops()

void ar9003_hw_attach_phy_ops ( struct ath_hw ah)

Definition at line 1234 of file ath9k_ar9003_phy.c.

1235 {
1236  struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
1237  struct ath_hw_ops *ops = ath9k_hw_ops(ah);
1238  static const u32 ar9300_cca_regs[6] = {
1239  AR_PHY_CCA_0,
1240  AR_PHY_CCA_1,
1241  AR_PHY_CCA_2,
1245  };
1246 
1247  priv_ops->rf_set_freq = ar9003_hw_set_channel;
1251  priv_ops->init_bb = ar9003_hw_init_bb;
1252  priv_ops->process_ini = ar9003_hw_process_ini;
1253  priv_ops->set_rfmode = ar9003_hw_set_rfmode;
1256  priv_ops->rfbus_req = ar9003_hw_rfbus_req;
1257  priv_ops->rfbus_done = ar9003_hw_rfbus_done;
1259  priv_ops->ani_control = ar9003_hw_ani_control;
1260  priv_ops->do_getnf = ar9003_hw_do_getnf;
1263 
1266 
1269  memcpy(ah->nf_regs, ar9300_cca_regs, sizeof(ah->nf_regs));
1270 }
void(* set_delta_slope)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:578
static u32 ar9003_hw_compute_pll_control(struct ath_hw *ah __unused, struct ath9k_channel *chan)
void(* init_bb)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:572
static void ar9003_hw_set_radar_conf(struct ath_hw *ah)
static void ar9003_hw_do_getnf(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
static void ar9003_hw_set_delta_slope(struct ath_hw *ah, struct ath9k_channel *chan)
void(* spur_mitigate_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:564
static void ar9003_hw_mark_phy_inactive(struct ath_hw *ah)
void(* rfbus_done)(struct ath_hw *ah)
Definition: hw.h:580
static void ar9003_hw_set_channel_regs(struct ath_hw *ah, struct ath9k_channel *chan)
#define AR_PHY_EXT_CCA_1
Definition: ar9003_phy.h:804
struct ath_hw_private_ops - callbacks used internally by hardware code
Definition: hw.h:551
static void ar9003_hw_set_nf_limits(struct ath_hw *ah)
static void ar9003_hw_set_rfmode(struct ath_hw *ah, struct ath9k_channel *chan)
void(* antdiv_comb_conf_set)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition: hw.h:642
void(* mark_phy_inactive)(struct ath_hw *ah)
Definition: hw.h:577
static void ar9003_hw_ani_cache_ini_regs(struct ath_hw *ah)
#define AR_PHY_EXT_CCA
Definition: ar9002_phy.h:332
void * memcpy(void *dest, const void *src, size_t len) __nonnull
int(* process_ini)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:574
static void ar9003_hw_antdiv_comb_conf_get(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
void(* ani_cache_ini_regs)(struct ath_hw *ah)
Definition: hw.h:592
static void ar9003_hw_init_bb(struct ath_hw *ah, struct ath9k_channel *chan)
static void ar9003_hw_spur_mitigate(struct ath_hw *ah, struct ath9k_channel *chan)
struct ath_hw_ops - callbacks used by hardware code and driver code
Definition: hw.h:604
static void ar9003_hw_rfbus_done(struct ath_hw *ah)
static int ar9003_hw_process_ini(struct ath_hw *ah, struct ath9k_channel *chan)
static void ar9003_hw_set_diversity(struct ath_hw *ah, int value)
#define AR_PHY_CCA_1
Definition: ar9003_phy.h:825
static int ar9003_hw_rfbus_req(struct ath_hw *ah)
static int ar9003_hw_ani_control(struct ath_hw *ah, enum ath9k_ani_cmd cmd, int param)
void(* set_rfmode)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:576
void(* set_diversity)(struct ath_hw *ah, int value)
Definition: hw.h:582
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition: hw.h:885
int(* rfbus_req)(struct ath_hw *ah)
Definition: hw.h:579
int(* ani_control)(struct ath_hw *ah, enum ath9k_ani_cmd cmd, int param)
Definition: hw.h:585
void(* antdiv_comb_conf_get)(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
Definition: hw.h:640
int(* rf_set_freq)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:562
void(* set_channel_regs)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:571
uint8_t ah
Definition: registers.h:85
u32(* compute_pll_control)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:583
void(* set_radar_params)(struct ath_hw *ah, struct ath_hw_radar_conf *conf)
Definition: hw.h:588
static struct ath_hw_private_ops * ath9k_hw_private_ops(struct ath_hw *ah)
Definition: hw.h:880
void(* do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS])
Definition: hw.h:587
static void ar9003_hw_antdiv_comb_conf_set(struct ath_hw *ah, struct ath_hw_antcomb_conf *antconf)
static void ar9003_hw_set_radar_params(struct ath_hw *ah, struct ath_hw_radar_conf *conf)
#define AR_PHY_EXT_CCA_2
Definition: ar9003_phy.h:860
uint32_t u32
Definition: stdint.h:24
#define AR_PHY_CCA_2
Definition: ar9003_phy.h:880
#define AR_PHY_CCA_0
Definition: ar9003_phy.h:262
static int ar9003_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
ar9003_hw_set_channel - set channel on single-chip device @ah: atheros hardware structure @chan:

References ah, ath_hw_private_ops::ani_cache_ini_regs, ath_hw_private_ops::ani_control, ath_hw_ops::antdiv_comb_conf_get, ath_hw_ops::antdiv_comb_conf_set, ar9003_hw_ani_cache_ini_regs(), ar9003_hw_ani_control(), ar9003_hw_antdiv_comb_conf_get(), ar9003_hw_antdiv_comb_conf_set(), ar9003_hw_compute_pll_control(), ar9003_hw_do_getnf(), ar9003_hw_init_bb(), ar9003_hw_mark_phy_inactive(), ar9003_hw_process_ini(), ar9003_hw_rfbus_done(), ar9003_hw_rfbus_req(), ar9003_hw_set_channel(), ar9003_hw_set_channel_regs(), ar9003_hw_set_delta_slope(), ar9003_hw_set_diversity(), ar9003_hw_set_nf_limits(), ar9003_hw_set_radar_conf(), ar9003_hw_set_radar_params(), ar9003_hw_set_rfmode(), ar9003_hw_spur_mitigate(), AR_PHY_CCA_0, AR_PHY_CCA_1, AR_PHY_CCA_2, AR_PHY_EXT_CCA, AR_PHY_EXT_CCA_1, AR_PHY_EXT_CCA_2, ath9k_hw_ops(), ath9k_hw_private_ops(), ath_hw_private_ops::compute_pll_control, ath_hw_private_ops::do_getnf, ath_hw_private_ops::init_bb, ath_hw_private_ops::mark_phy_inactive, memcpy(), ath_hw_private_ops::process_ini, ath_hw_private_ops::rf_set_freq, ath_hw_private_ops::rfbus_done, ath_hw_private_ops::rfbus_req, ath_hw_private_ops::set_channel_regs, ath_hw_private_ops::set_delta_slope, ath_hw_private_ops::set_diversity, ath_hw_private_ops::set_radar_params, ath_hw_private_ops::set_rfmode, and ath_hw_private_ops::spur_mitigate_freq.

Referenced by ar9003_hw_attach_ops().

◆ ar9002_hw_attach_calib_ops()

void ar9002_hw_attach_calib_ops ( struct ath_hw ah)

Definition at line 989 of file ath9k_ar9002_calib.c.

990 {
991  struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
992  struct ath_hw_ops *ops = ath9k_hw_ops(ah);
993 
995  priv_ops->init_cal = ar9002_hw_init_cal;
997 
999 }
static int ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
void(* init_cal_settings)(struct ath_hw *ah)
Definition: hw.h:553
struct ath_hw_private_ops - callbacks used internally by hardware code
Definition: hw.h:551
static void ar9002_hw_setup_calibration(struct ath_hw *ah, struct ath9k_cal_list *currCal)
void(* setup_calibration)(struct ath_hw *ah, struct ath9k_cal_list *currCal)
Definition: hw.h:558
static int ar9002_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan, u8 rxchainmask, int longcal)
struct ath_hw_ops - callbacks used by hardware code and driver code
Definition: hw.h:604
int(* calibrate)(struct ath_hw *ah, struct ath9k_channel *chan, u8 rxchainmask, int longcal)
Definition: hw.h:611
static void ar9002_hw_init_cal_settings(struct ath_hw *ah)
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition: hw.h:885
uint8_t ah
Definition: registers.h:85
static struct ath_hw_private_ops * ath9k_hw_private_ops(struct ath_hw *ah)
Definition: hw.h:880
int(* init_cal)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:554

References ah, ar9002_hw_calibrate(), ar9002_hw_init_cal(), ar9002_hw_init_cal_settings(), ar9002_hw_setup_calibration(), ath9k_hw_ops(), ath9k_hw_private_ops(), ath_hw_ops::calibrate, ath_hw_private_ops::init_cal, ath_hw_private_ops::init_cal_settings, and ath_hw_private_ops::setup_calibration.

Referenced by ar9002_hw_attach_ops().

◆ ar9003_hw_attach_calib_ops()

void ar9003_hw_attach_calib_ops ( struct ath_hw ah)

Definition at line 924 of file ath9k_ar9003_calib.c.

925 {
926  struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
927  struct ath_hw_ops *ops = ath9k_hw_ops(ah);
928 
930  priv_ops->init_cal = ar9003_hw_init_cal;
932 
934 }
static void ar9003_hw_setup_calibration(struct ath_hw *ah, struct ath9k_cal_list *currCal)
void(* init_cal_settings)(struct ath_hw *ah)
Definition: hw.h:553
struct ath_hw_private_ops - callbacks used internally by hardware code
Definition: hw.h:551
void(* setup_calibration)(struct ath_hw *ah, struct ath9k_cal_list *currCal)
Definition: hw.h:558
static void ar9003_hw_init_cal_settings(struct ath_hw *ah)
struct ath_hw_ops - callbacks used by hardware code and driver code
Definition: hw.h:604
int(* calibrate)(struct ath_hw *ah, struct ath9k_channel *chan, u8 rxchainmask, int longcal)
Definition: hw.h:611
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition: hw.h:885
static int ar9003_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan, u8 rxchainmask, int longcal)
uint8_t ah
Definition: registers.h:85
static struct ath_hw_private_ops * ath9k_hw_private_ops(struct ath_hw *ah)
Definition: hw.h:880
static int ar9003_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan __unused)
int(* init_cal)(struct ath_hw *ah, struct ath9k_channel *chan)
Definition: hw.h:554

References ah, ar9003_hw_calibrate(), ar9003_hw_init_cal(), ar9003_hw_init_cal_settings(), ar9003_hw_setup_calibration(), ath9k_hw_ops(), ath9k_hw_private_ops(), ath_hw_ops::calibrate, ath_hw_private_ops::init_cal, ath_hw_private_ops::init_cal_settings, and ath_hw_private_ops::setup_calibration.

Referenced by ar9003_hw_attach_ops().

◆ ar9002_hw_attach_ops()

void ar9002_hw_attach_ops ( struct ath_hw ah)

Definition at line 546 of file ath9k_ar9002_hw.c.

547 {
548  struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
549  struct ath_hw_ops *ops = ath9k_hw_ops(ah);
550 
553 
555 
559 
562 }
void ar5008_hw_attach_phy_ops(struct ath_hw *ah)
#define AR_SREV_9280_20_OR_LATER(_ah)
Definition: reg.h:825
struct ath_hw_private_ops - callbacks used internally by hardware code
Definition: hw.h:551
void ar9002_hw_attach_calib_ops(struct ath_hw *ah)
void ar9002_hw_attach_mac_ops(struct ath_hw *ah)
static void ar9002_hw_init_mode_regs(struct ath_hw *ah)
void(* init_mode_regs)(struct ath_hw *ah)
Definition: hw.h:556
static void ar9002_hw_init_mode_gain_regs(struct ath_hw *ah)
struct ath_hw_ops - callbacks used by hardware code and driver code
Definition: hw.h:604
void(* config_pci_powersave)(struct ath_hw *ah, int restore, int power_off)
Definition: hw.h:605
void(* init_mode_gain_regs)(struct ath_hw *ah)
Definition: hw.h:557
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition: hw.h:885
static void ar9002_hw_configpcipowersave(struct ath_hw *ah, int restore, int power_off)
uint8_t ah
Definition: registers.h:85
static struct ath_hw_private_ops * ath9k_hw_private_ops(struct ath_hw *ah)
Definition: hw.h:880
void ar9002_hw_attach_phy_ops(struct ath_hw *ah)

References ah, ar5008_hw_attach_phy_ops(), ar9002_hw_attach_calib_ops(), ar9002_hw_attach_mac_ops(), ar9002_hw_attach_phy_ops(), ar9002_hw_configpcipowersave(), ar9002_hw_init_mode_gain_regs(), ar9002_hw_init_mode_regs(), AR_SREV_9280_20_OR_LATER, ath9k_hw_ops(), ath9k_hw_private_ops(), ath_hw_ops::config_pci_powersave, ath_hw_private_ops::init_mode_gain_regs, and ath_hw_private_ops::init_mode_regs.

Referenced by ath9k_hw_attach_ops().

◆ ar9003_hw_attach_ops()

void ar9003_hw_attach_ops ( struct ath_hw ah)

Definition at line 398 of file ath9k_ar9003_hw.c.

399 {
400  struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah);
401  struct ath_hw_ops *ops = ath9k_hw_ops(ah);
402 
405 
407 
411 }
static void ar9003_hw_init_mode_gain_regs(struct ath_hw *ah)
static void ar9003_hw_configpcipowersave(struct ath_hw *ah, int restore, int power_off)
void ar9003_hw_attach_phy_ops(struct ath_hw *ah)
struct ath_hw_private_ops - callbacks used internally by hardware code
Definition: hw.h:551
void(* init_mode_regs)(struct ath_hw *ah)
Definition: hw.h:556
static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
struct ath_hw_ops - callbacks used by hardware code and driver code
Definition: hw.h:604
void(* config_pci_powersave)(struct ath_hw *ah, int restore, int power_off)
Definition: hw.h:605
void(* init_mode_gain_regs)(struct ath_hw *ah)
Definition: hw.h:557
void ar9003_hw_attach_calib_ops(struct ath_hw *ah)
static struct ath_hw_ops * ath9k_hw_ops(struct ath_hw *ah)
Definition: hw.h:885
void ar9003_hw_attach_mac_ops(struct ath_hw *hw)
uint8_t ah
Definition: registers.h:85
static struct ath_hw_private_ops * ath9k_hw_private_ops(struct ath_hw *ah)
Definition: hw.h:880

References ah, ar9003_hw_attach_calib_ops(), ar9003_hw_attach_mac_ops(), ar9003_hw_attach_phy_ops(), ar9003_hw_configpcipowersave(), ar9003_hw_init_mode_gain_regs(), ar9003_hw_init_mode_regs(), ath9k_hw_ops(), ath9k_hw_private_ops(), ath_hw_ops::config_pci_powersave, ath_hw_private_ops::init_mode_gain_regs, and ath_hw_private_ops::init_mode_regs.

Referenced by ath9k_hw_attach_ops().

◆ ar9002_hw_load_ani_reg()

void ar9002_hw_load_ani_reg ( struct ath_hw ah,
struct ath9k_channel chan 
)

Definition at line 564 of file ath9k_ar9002_hw.c.

565 {
566  u32 modesIndex;
567  unsigned int i;
568 
569  switch (chan->chanmode) {
570  case CHANNEL_A:
571  case CHANNEL_A_HT20:
572  modesIndex = 1;
573  break;
574  case CHANNEL_A_HT40PLUS:
575  case CHANNEL_A_HT40MINUS:
576  modesIndex = 2;
577  break;
578  case CHANNEL_G:
579  case CHANNEL_G_HT20:
580  case CHANNEL_B:
581  modesIndex = 4;
582  break;
583  case CHANNEL_G_HT40PLUS:
584  case CHANNEL_G_HT40MINUS:
585  modesIndex = 3;
586  break;
587 
588  default:
589  return;
590  }
591 
593 
594  for (i = 0; i < ah->iniModes_9271_ANI_reg.ia_rows; i++) {
595  u32 reg = INI_RA(&ah->iniModes_9271_ANI_reg, i, 0);
596  u32 val = INI_RA(&ah->iniModes_9271_ANI_reg, i, modesIndex);
597  u32 val_orig;
598 
599  if (reg == AR_PHY_CCK_DETECT) {
600  val_orig = REG_READ(ah, reg);
603 
604  REG_WRITE(ah, reg, val|val_orig);
605  } else
606  REG_WRITE(ah, reg, val);
607  }
608 
610 }
u32 chanmode
Definition: hw.h:352
static unsigned int unsigned int reg
Definition: myson.h:162
void __asmcall int val
Definition: setjmp.h:12
#define INI_RA(iniarray, row, column)
Definition: calib.h:46
#define REGWRITE_BUFFER_FLUSH(_ah)
Definition: hw.h:96
#define CHANNEL_A_HT40MINUS
Definition: hw.h:323
#define CHANNEL_A
Definition: ath5k.h:640
#define CHANNEL_G
Definition: ath5k.h:642
#define AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK
Definition: ar9002_phy.h:415
#define CHANNEL_A_HT20
Definition: hw.h:319
#define AR_PHY_CCK_DETECT
Definition: ar9002_phy.h:414
#define REG_READ(_ah, _reg)
Definition: hw.h:81
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
#define CHANNEL_A_HT40PLUS
Definition: hw.h:322
uint8_t ah
Definition: registers.h:85
#define CHANNEL_G_HT20
Definition: hw.h:318
#define CHANNEL_B
Definition: ath5k.h:641
#define CHANNEL_G_HT40PLUS
Definition: hw.h:320
#define CHANNEL_G_HT40MINUS
Definition: hw.h:321
uint32_t u32
Definition: stdint.h:24
#define ENABLE_REGWRITE_BUFFER(_ah)
Definition: hw.h:90

References ah, AR_PHY_CCK_DETECT, AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK, ath9k_channel::chanmode, CHANNEL_A, CHANNEL_A_HT20, CHANNEL_A_HT40MINUS, CHANNEL_A_HT40PLUS, CHANNEL_B, CHANNEL_G, CHANNEL_G_HT20, CHANNEL_G_HT40MINUS, CHANNEL_G_HT40PLUS, ENABLE_REGWRITE_BUFFER, INI_RA, reg, REG_READ, REG_WRITE, REGWRITE_BUFFER_FLUSH, and val.

Referenced by ath9k_hw_reset().

◆ ath9k_ani_reset()

void ath9k_ani_reset ( struct ath_hw ah,
int  is_scanning 
)

Definition at line 468 of file ath9k_ani.c.

469 {
470  struct ar5416AniState *aniState = &ah->curchan->ani;
471  struct ath9k_channel *chan = ah->curchan;
472 
473  if (!DO_ANI(ah))
474  return;
475 
476  if (!use_new_ani(ah))
477  return ath9k_ani_reset_old(ah);
478 
479  ah->stats.ast_ani_reset++;
480 
481  /* always allow mode (on/off) to be controlled */
482  ah->ani_function |= ATH9K_ANI_MODE;
483 
484  if (is_scanning) {
485  /*
486  * If we're scanning or in AP mode, the defaults (ini)
487  * should be in place. For an AP we assume the historical
488  * levels for this channel are probably outdated so start
489  * from defaults instead.
490  */
491  if (aniState->ofdmNoiseImmunityLevel !=
493  aniState->cckNoiseImmunityLevel !=
495  DBG("ath9k: "
496  "Restore defaults: chan %d Mhz/0x%x is_scanning=%d ofdm:%d cck:%d\n",
497  chan->channel,
498  chan->channelFlags,
499  is_scanning,
500  aniState->ofdmNoiseImmunityLevel,
501  aniState->cckNoiseImmunityLevel);
502 
505  }
506  } else {
507  /*
508  * restore historical levels for this channel
509  */
510  DBG2("ath9k: "
511  "Restore history: chan %d Mhz/0x%x is_scanning=%d ofdm:%d cck:%d\n",
512  chan->channel,
513  chan->channelFlags,
514  is_scanning,
515  aniState->ofdmNoiseImmunityLevel,
516  aniState->cckNoiseImmunityLevel);
517 
519  aniState->ofdmNoiseImmunityLevel);
521  aniState->cckNoiseImmunityLevel);
522  }
523 
524  /*
525  * enable phy counters if hw supports or if not, enable phy
526  * interrupts (so we can count each one)
527  */
529 
531 
534 
536 }
static void ath9k_hw_set_cck_nil(struct ath_hw *ah, uint8_t immunityLevel)
Definition: ath9k_ani.c:298
#define AR_PHY_ERR_MASK_2
Definition: reg.h:1671
#define REGWRITE_BUFFER_FLUSH(_ah)
Definition: hw.h:96
#define ATH9K_ANI_OFDM_DEF_LEVEL
Definition: ath9k_ani.c:59
#define AR_PHY_ERR_CCK_TIMING
Definition: reg.h:1633
u8 cckNoiseImmunityLevel
Definition: ani.h:124
#define ATH9K_ANI_CCK_DEF_LEVEL
Definition: ath9k_ani.c:107
struct net80211_channel * chan
Definition: hw.h:348
#define DO_ANI(ah)
Definition: ani.h:28
static void ath9k_ani_restart(struct ath_hw *ah)
Definition: ath9k_ani.c:125
static int use_new_ani(struct ath_hw *ah)
Definition: ath9k_ani.c:110
#define REG_WRITE(_ah, _reg, _val)
Definition: hw.h:78
#define AR_PHY_ERR_MASK_1
Definition: reg.h:1667
uint8_t ah
Definition: registers.h:85
static void ath9k_ani_reset_old(struct ath_hw *ah)
Definition: ath9k_ani.c:426
#define AR_PHY_ERR_OFDM_TIMING
Definition: reg.h:1632
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
static void ath9k_hw_set_ofdm_nil(struct ath_hw *ah, u8 immunityLevel)
Definition: ath9k_ani.c:246
u8 ofdmNoiseImmunityLevel
Definition: ani.h:123
#define ENABLE_REGWRITE_BUFFER(_ah)
Definition: hw.h:90
#define DBG2(...)
Definition: compiler.h:515

References ah, AR_PHY_ERR_CCK_TIMING, AR_PHY_ERR_MASK_1, AR_PHY_ERR_MASK_2, AR_PHY_ERR_OFDM_TIMING, ATH9K_ANI_CCK_DEF_LEVEL, ATH9K_ANI_MODE, ATH9K_ANI_OFDM_DEF_LEVEL, ath9k_ani_reset_old(), ath9k_ani_restart(), ath9k_hw_set_cck_nil(), ath9k_hw_set_ofdm_nil(), ar5416AniState::cckNoiseImmunityLevel, ath9k_channel::chan, DBG, DBG2, DO_ANI, ENABLE_REGWRITE_BUFFER, ar5416AniState::ofdmNoiseImmunityLevel, REG_WRITE, REGWRITE_BUFFER_FLUSH, and use_new_ani().

Referenced by ath9k_hw_startpcureceive().

◆ ath9k_hw_proc_mib_event()

void ath9k_hw_proc_mib_event ( struct ath_hw ah)

◆ ath9k_hw_ani_monitor()

void ath9k_hw_ani_monitor ( struct ath_hw ah,
struct ath9k_channel chan 
)

Variable Documentation

◆ modparam_force_new_ani

int modparam_force_new_ani

Definition at line 29 of file ath9k_ar9002_hw.c.

Referenced by ar5008_hw_attach_phy_ops(), and use_new_ani().