Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
hw.c File Reference
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <asm/unaligned.h>
#include "hw.h"
#include "hw-ops.h"
#include "rc.h"
#include "ar9003_mac.h"
#include "ar9003_mci.h"
#include "ar9003_phy.h"
#include "debug.h"
#include "ath9k.h"

Go to the source code of this file.

Macros

#define DCU_COMPLETE_STATE   1
 
#define DCU_COMPLETE_STATE_MASK   0x3
 
#define NUM_STATUS_READS   50
 
#define MS_REG_READ(x, y)   (MS(REG_READ(ah, AR_GPIO_IN_OUT), x##_GPIO_IN_VAL) & (AR_GPIO_BIT(y)))
 
#define ATH9K_MAX_TSF_READ   10
 

Functions

 MODULE_AUTHOR ("Atheros Communications")
 
 MODULE_DESCRIPTION ("Support for Atheros 802.11n wireless LAN cards.")
 
 MODULE_SUPPORTED_DEVICE ("Atheros 802.11n WLAN cards")
 
 MODULE_LICENSE ("Dual BSD/GPL")
 
 module_init (ath9k_init)
 
 module_exit (ath9k_exit)
 
bool ath9k_hw_wait (struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout)
 
 EXPORT_SYMBOL (ath9k_hw_wait)
 
void ath9k_hw_synth_delay (struct ath_hw *ah, struct ath9k_channel *chan, int hw_delay)
 
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, bool shortPreamble)
 
 EXPORT_SYMBOL (ath9k_hw_computetxtime)
 
void ath9k_hw_get_channel_centers (struct ath_hw *ah, struct ath9k_channel *chan, struct chan_centers *centers)
 
int ath9k_hw_init (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath9k_hw_init)
 
u32 ar9003_get_pll_sqsum_dvc (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ar9003_get_pll_sqsum_dvc)
 
void ath9k_hw_init_global_settings (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath9k_hw_init_global_settings)
 
void ath9k_hw_deinit (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath9k_hw_deinit)
 
u32 ath9k_regd_get_ctl (struct ath_regulatory *reg, struct ath9k_channel *chan)
 
void ath9k_hw_get_delta_slope_vals (struct ath_hw *ah, u32 coef_scaled, u32 *coef_mantissa, u32 *coef_exponent)
 
bool ath9k_hw_check_alive (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath9k_hw_check_alive)
 
int ath9k_hw_reset (struct ath_hw *ah, struct ath9k_channel *chan, struct ath9k_hw_cal_data *caldata, bool fastcc)
 
 EXPORT_SYMBOL (ath9k_hw_reset)
 
bool ath9k_hw_setpower (struct ath_hw *ah, enum ath9k_power_mode mode)
 
 EXPORT_SYMBOL (ath9k_hw_setpower)
 
void ath9k_hw_beaconinit (struct ath_hw *ah, u32 next_beacon, u32 beacon_period)
 
 EXPORT_SYMBOL (ath9k_hw_beaconinit)
 
void ath9k_hw_set_sta_beacon_timers (struct ath_hw *ah, const struct ath9k_beacon_state *bs)
 
 EXPORT_SYMBOL (ath9k_hw_set_sta_beacon_timers)
 
int ath9k_hw_fill_cap_info (struct ath_hw *ah)
 
void ath9k_hw_cfg_gpio_input (struct ath_hw *ah, u32 gpio)
 
 EXPORT_SYMBOL (ath9k_hw_cfg_gpio_input)
 
u32 ath9k_hw_gpio_get (struct ath_hw *ah, u32 gpio)
 
 EXPORT_SYMBOL (ath9k_hw_gpio_get)
 
void ath9k_hw_cfg_output (struct ath_hw *ah, u32 gpio, u32 ah_signal_type)
 
 EXPORT_SYMBOL (ath9k_hw_cfg_output)
 
void ath9k_hw_set_gpio (struct ath_hw *ah, u32 gpio, u32 val)
 
 EXPORT_SYMBOL (ath9k_hw_set_gpio)
 
void ath9k_hw_setantenna (struct ath_hw *ah, u32 antenna)
 
 EXPORT_SYMBOL (ath9k_hw_setantenna)
 
u32 ath9k_hw_getrxfilter (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath9k_hw_getrxfilter)
 
void ath9k_hw_setrxfilter (struct ath_hw *ah, u32 bits)
 
 EXPORT_SYMBOL (ath9k_hw_setrxfilter)
 
bool ath9k_hw_phy_disable (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath9k_hw_phy_disable)
 
bool ath9k_hw_disable (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath9k_hw_disable)
 
void ath9k_hw_apply_txpower (struct ath_hw *ah, struct ath9k_channel *chan, bool test)
 
void ath9k_hw_set_txpowerlimit (struct ath_hw *ah, u32 limit, bool test)
 
 EXPORT_SYMBOL (ath9k_hw_set_txpowerlimit)
 
void ath9k_hw_setopmode (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath9k_hw_setopmode)
 
void ath9k_hw_setmcastfilter (struct ath_hw *ah, u32 filter0, u32 filter1)
 
 EXPORT_SYMBOL (ath9k_hw_setmcastfilter)
 
void ath9k_hw_write_associd (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath9k_hw_write_associd)
 
u64 ath9k_hw_gettsf64 (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath9k_hw_gettsf64)
 
void ath9k_hw_settsf64 (struct ath_hw *ah, u64 tsf64)
 
 EXPORT_SYMBOL (ath9k_hw_settsf64)
 
void ath9k_hw_reset_tsf (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath9k_hw_reset_tsf)
 
void ath9k_hw_set_tsfadjust (struct ath_hw *ah, bool set)
 
 EXPORT_SYMBOL (ath9k_hw_set_tsfadjust)
 
void ath9k_hw_set11nmac2040 (struct ath_hw *ah)
 
u32 ath9k_hw_gettsf32 (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath9k_hw_gettsf32)
 
struct ath_gen_timerath_gen_timer_alloc (struct ath_hw *ah, void(*trigger)(void *), void(*overflow)(void *), void *arg, u8 timer_index)
 
 EXPORT_SYMBOL (ath_gen_timer_alloc)
 
void ath9k_hw_gen_timer_start (struct ath_hw *ah, struct ath_gen_timer *timer, u32 trig_timeout, u32 timer_period)
 
 EXPORT_SYMBOL (ath9k_hw_gen_timer_start)
 
void ath9k_hw_gen_timer_stop (struct ath_hw *ah, struct ath_gen_timer *timer)
 
 EXPORT_SYMBOL (ath9k_hw_gen_timer_stop)
 
void ath_gen_timer_free (struct ath_hw *ah, struct ath_gen_timer *timer)
 
 EXPORT_SYMBOL (ath_gen_timer_free)
 
void ath_gen_timer_isr (struct ath_hw *ah)
 
 EXPORT_SYMBOL (ath_gen_timer_isr)
 
void ath9k_hw_name (struct ath_hw *ah, char *hw_name, size_t len)
 
 EXPORT_SYMBOL (ath9k_hw_name)
 

Macro Definition Documentation

#define ATH9K_MAX_TSF_READ   10

Definition at line 2886 of file hw.c.

#define DCU_COMPLETE_STATE   1

Definition at line 1605 of file hw.c.

#define DCU_COMPLETE_STATE_MASK   0x3

Definition at line 1606 of file hw.c.

#define MS_REG_READ (   x,
  y 
)    (MS(REG_READ(ah, AR_GPIO_IN_OUT), x##_GPIO_IN_VAL) & (AR_GPIO_BIT(y)))
#define NUM_STATUS_READS   50

Definition at line 1607 of file hw.c.

Function Documentation

u32 ar9003_get_pll_sqsum_dvc ( struct ath_hw ah)

Definition at line 781 of file hw.c.

void ath9k_hw_apply_txpower ( struct ath_hw ah,
struct ath9k_channel chan,
bool  test 
)

Definition at line 2821 of file hw.c.

void ath9k_hw_beaconinit ( struct ath_hw ah,
u32  next_beacon,
u32  beacon_period 
)

Definition at line 2233 of file hw.c.

void ath9k_hw_cfg_gpio_input ( struct ath_hw ah,
u32  gpio 
)

Definition at line 2642 of file hw.c.

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

Definition at line 2692 of file hw.c.

bool ath9k_hw_check_alive ( struct ath_hw ah)

Definition at line 1656 of file hw.c.

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

Definition at line 237 of file hw.c.

void ath9k_hw_deinit ( struct ath_hw ah)

Definition at line 1151 of file hw.c.

bool ath9k_hw_disable ( struct ath_hw ah)

Definition at line 2796 of file hw.c.

int ath9k_hw_fill_cap_info ( struct ath_hw ah)

Definition at line 2383 of file hw.c.

void ath9k_hw_gen_timer_start ( struct ath_hw ah,
struct ath_gen_timer timer,
u32  trig_timeout,
u32  timer_period 
)

Definition at line 3028 of file hw.c.

void ath9k_hw_gen_timer_stop ( struct ath_hw ah,
struct ath_gen_timer timer 
)

Definition at line 3079 of file hw.c.

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

Definition at line 290 of file hw.c.

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

Definition at line 1281 of file hw.c.

u32 ath9k_hw_getrxfilter ( struct ath_hw ah)

Definition at line 2741 of file hw.c.

u32 ath9k_hw_gettsf32 ( struct ath_hw ah)

Definition at line 2993 of file hw.c.

u64 ath9k_hw_gettsf64 ( struct ath_hw ah)

Definition at line 2888 of file hw.c.

u32 ath9k_hw_gpio_get ( struct ath_hw ah,
u32  gpio 
)

Definition at line 2664 of file hw.c.

int ath9k_hw_init ( struct ath_hw ah)

Definition at line 713 of file hw.c.

void ath9k_hw_init_global_settings ( struct ath_hw ah)

Definition at line 1050 of file hw.c.

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

Definition at line 3231 of file hw.c.

bool ath9k_hw_phy_disable ( struct ath_hw ah)

Definition at line 2782 of file hw.c.

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

Definition at line 1756 of file hw.c.

void ath9k_hw_reset_tsf ( struct ath_hw ah)

Definition at line 2915 of file hw.c.

u32 ath9k_hw_reverse_bits ( u32  val,
u32  n 
)

Definition at line 225 of file hw.c.

void ath9k_hw_set11nmac2040 ( struct ath_hw ah)

Definition at line 2935 of file hw.c.

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

Definition at line 2714 of file hw.c.

void ath9k_hw_set_sta_beacon_timers ( struct ath_hw ah,
const struct ath9k_beacon_state bs 
)

Definition at line 2274 of file hw.c.

void ath9k_hw_set_tsfadjust ( struct ath_hw ah,
bool  set 
)

Definition at line 2926 of file hw.c.

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

Definition at line 2846 of file hw.c.

void ath9k_hw_setantenna ( struct ath_hw ah,
u32  antenna 
)

Definition at line 2731 of file hw.c.

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

Definition at line 2869 of file hw.c.

void ath9k_hw_setopmode ( struct ath_hw ah)

Definition at line 2863 of file hw.c.

bool ath9k_hw_setpower ( struct ath_hw ah,
enum ath9k_power_mode  mode 
)

Definition at line 2179 of file hw.c.

void ath9k_hw_setrxfilter ( struct ath_hw ah,
u32  bits 
)

Definition at line 2755 of file hw.c.

void ath9k_hw_settsf64 ( struct ath_hw ah,
u64  tsf64 
)

Definition at line 2908 of file hw.c.

void ath9k_hw_synth_delay ( struct ath_hw ah,
struct ath9k_channel chan,
int  hw_delay 
)

Definition at line 195 of file hw.c.

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

Definition at line 174 of file hw.c.

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

Definition at line 211 of file hw.c.

void ath9k_hw_write_associd ( struct ath_hw ah)

Definition at line 2876 of file hw.c.

u32 ath9k_regd_get_ctl ( struct ath_regulatory reg,
struct ath9k_channel chan 
)

Definition at line 1169 of file hw.c.

struct ath_gen_timer* ath_gen_timer_alloc ( struct ath_hw ah,
void(*)(void *)  trigger,
void(*)(void *)  overflow,
void arg,
u8  timer_index 
)
read

Definition at line 2999 of file hw.c.

void ath_gen_timer_free ( struct ath_hw ah,
struct ath_gen_timer timer 
)

Definition at line 3111 of file hw.c.

void ath_gen_timer_isr ( struct ath_hw ah)

Definition at line 3124 of file hw.c.

EXPORT_SYMBOL ( ath9k_hw_wait  )
EXPORT_SYMBOL ( ath9k_hw_computetxtime  )
EXPORT_SYMBOL ( ath9k_hw_init  )
EXPORT_SYMBOL ( ar9003_get_pll_sqsum_dvc  )
EXPORT_SYMBOL ( ath9k_hw_init_global_settings  )
EXPORT_SYMBOL ( ath9k_hw_deinit  )
EXPORT_SYMBOL ( ath9k_hw_check_alive  )
EXPORT_SYMBOL ( ath9k_hw_reset  )
EXPORT_SYMBOL ( ath9k_hw_setpower  )
EXPORT_SYMBOL ( ath9k_hw_beaconinit  )
EXPORT_SYMBOL ( ath9k_hw_set_sta_beacon_timers  )
EXPORT_SYMBOL ( ath9k_hw_cfg_gpio_input  )
EXPORT_SYMBOL ( ath9k_hw_gpio_get  )
EXPORT_SYMBOL ( ath9k_hw_cfg_output  )
EXPORT_SYMBOL ( ath9k_hw_set_gpio  )
EXPORT_SYMBOL ( ath9k_hw_setantenna  )
EXPORT_SYMBOL ( ath9k_hw_getrxfilter  )
EXPORT_SYMBOL ( ath9k_hw_setrxfilter  )
EXPORT_SYMBOL ( ath9k_hw_phy_disable  )
EXPORT_SYMBOL ( ath9k_hw_disable  )
EXPORT_SYMBOL ( ath9k_hw_set_txpowerlimit  )
EXPORT_SYMBOL ( ath9k_hw_setopmode  )
EXPORT_SYMBOL ( ath9k_hw_setmcastfilter  )
EXPORT_SYMBOL ( ath9k_hw_write_associd  )
EXPORT_SYMBOL ( ath9k_hw_gettsf64  )
EXPORT_SYMBOL ( ath9k_hw_settsf64  )
EXPORT_SYMBOL ( ath9k_hw_reset_tsf  )
EXPORT_SYMBOL ( ath9k_hw_set_tsfadjust  )
EXPORT_SYMBOL ( ath9k_hw_gettsf32  )
EXPORT_SYMBOL ( ath_gen_timer_alloc  )
EXPORT_SYMBOL ( ath9k_hw_gen_timer_start  )
EXPORT_SYMBOL ( ath9k_hw_gen_timer_stop  )
EXPORT_SYMBOL ( ath_gen_timer_free  )
EXPORT_SYMBOL ( ath_gen_timer_isr  )
EXPORT_SYMBOL ( ath9k_hw_name  )
MODULE_AUTHOR ( "Atheros Communications"  )
MODULE_DESCRIPTION ( "Support for Atheros 802.11n wireless LAN cards."  )
module_exit ( ath9k_exit  )
module_init ( ath9k_init  )
MODULE_LICENSE ( "Dual BSD/GPL"  )
MODULE_SUPPORTED_DEVICE ( "Atheros 802.11n WLAN cards"  )

Variable Documentation

const char* name

Definition at line 3165 of file hw.c.

u16 version

Definition at line 3164 of file hw.c.