diff options
author | Mohammed Shafi Shajakhan <mshajakhan@atheros.com> | 2011-05-13 10:59:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-16 14:10:42 -0400 |
commit | 69de3721750ea4fae504be9e67f140cafe1c7a89 (patch) | |
tree | 83aa51c87a04646b881c4f95a8375727d5022380 /drivers/net | |
parent | bd2281b85d929af0bd192f05135f70dd05f4fd85 (diff) |
ath9k_hw: make antenna diversity modules chip specific
this is necessary to support Antenna diversity and combining in new chip
sets such as AR9485, previously Antenna diversity support is available
only in AR9285
Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com>
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com>
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9002_phy.c | 42 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw-ops.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 9 |
3 files changed, 39 insertions, 24 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_phy.c b/drivers/net/wireless/ath/ath9k/ar9002_phy.c index 7d68d61e406..b4a0c1d3b11 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_phy.c | |||
@@ -517,23 +517,7 @@ static void ar9002_hw_set_nf_limits(struct ath_hw *ah) | |||
517 | } | 517 | } |
518 | } | 518 | } |
519 | 519 | ||
520 | void ar9002_hw_attach_phy_ops(struct ath_hw *ah) | 520 | static void ar9002_hw_antdiv_comb_conf_get(struct ath_hw *ah, |
521 | { | ||
522 | struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah); | ||
523 | |||
524 | priv_ops->set_rf_regs = NULL; | ||
525 | priv_ops->rf_alloc_ext_banks = NULL; | ||
526 | priv_ops->rf_free_ext_banks = NULL; | ||
527 | priv_ops->rf_set_freq = ar9002_hw_set_channel; | ||
528 | priv_ops->spur_mitigate_freq = ar9002_hw_spur_mitigate; | ||
529 | priv_ops->olc_init = ar9002_olc_init; | ||
530 | priv_ops->compute_pll_control = ar9002_hw_compute_pll_control; | ||
531 | priv_ops->do_getnf = ar9002_hw_do_getnf; | ||
532 | |||
533 | ar9002_hw_set_nf_limits(ah); | ||
534 | } | ||
535 | |||
536 | void ath9k_hw_antdiv_comb_conf_get(struct ath_hw *ah, | ||
537 | struct ath_hw_antcomb_conf *antconf) | 521 | struct ath_hw_antcomb_conf *antconf) |
538 | { | 522 | { |
539 | u32 regval; | 523 | u32 regval; |
@@ -546,9 +530,8 @@ void ath9k_hw_antdiv_comb_conf_get(struct ath_hw *ah, | |||
546 | antconf->fast_div_bias = (regval & AR_PHY_9285_FAST_DIV_BIAS) >> | 530 | antconf->fast_div_bias = (regval & AR_PHY_9285_FAST_DIV_BIAS) >> |
547 | AR_PHY_9285_FAST_DIV_BIAS_S; | 531 | AR_PHY_9285_FAST_DIV_BIAS_S; |
548 | } | 532 | } |
549 | EXPORT_SYMBOL(ath9k_hw_antdiv_comb_conf_get); | ||
550 | 533 | ||
551 | void ath9k_hw_antdiv_comb_conf_set(struct ath_hw *ah, | 534 | static void ar9002_hw_antdiv_comb_conf_set(struct ath_hw *ah, |
552 | struct ath_hw_antcomb_conf *antconf) | 535 | struct ath_hw_antcomb_conf *antconf) |
553 | { | 536 | { |
554 | u32 regval; | 537 | u32 regval; |
@@ -566,4 +549,23 @@ void ath9k_hw_antdiv_comb_conf_set(struct ath_hw *ah, | |||
566 | 549 | ||
567 | REG_WRITE(ah, AR_PHY_MULTICHAIN_GAIN_CTL, regval); | 550 | REG_WRITE(ah, AR_PHY_MULTICHAIN_GAIN_CTL, regval); |
568 | } | 551 | } |
569 | EXPORT_SYMBOL(ath9k_hw_antdiv_comb_conf_set); | 552 | |
553 | void ar9002_hw_attach_phy_ops(struct ath_hw *ah) | ||
554 | { | ||
555 | struct ath_hw_private_ops *priv_ops = ath9k_hw_private_ops(ah); | ||
556 | struct ath_hw_ops *ops = ath9k_hw_ops(ah); | ||
557 | |||
558 | priv_ops->set_rf_regs = NULL; | ||
559 | priv_ops->rf_alloc_ext_banks = NULL; | ||
560 | priv_ops->rf_free_ext_banks = NULL; | ||
561 | priv_ops->rf_set_freq = ar9002_hw_set_channel; | ||
562 | priv_ops->spur_mitigate_freq = ar9002_hw_spur_mitigate; | ||
563 | priv_ops->olc_init = ar9002_olc_init; | ||
564 | priv_ops->compute_pll_control = ar9002_hw_compute_pll_control; | ||
565 | priv_ops->do_getnf = ar9002_hw_do_getnf; | ||
566 | |||
567 | ops->antdiv_comb_conf_get = ar9002_hw_antdiv_comb_conf_get; | ||
568 | ops->antdiv_comb_conf_set = ar9002_hw_antdiv_comb_conf_set; | ||
569 | |||
570 | ar9002_hw_set_nf_limits(ah); | ||
571 | } | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw-ops.h b/drivers/net/wireless/ath/ath9k/hw-ops.h index 99f8334d1df..8b8f0445aef 100644 --- a/drivers/net/wireless/ath/ath9k/hw-ops.h +++ b/drivers/net/wireless/ath/ath9k/hw-ops.h | |||
@@ -121,6 +121,18 @@ static inline void ath9k_hw_set_clrdmask(struct ath_hw *ah, void *ds, bool val) | |||
121 | ath9k_hw_ops(ah)->set_clrdmask(ah, ds, val); | 121 | ath9k_hw_ops(ah)->set_clrdmask(ah, ds, val); |
122 | } | 122 | } |
123 | 123 | ||
124 | static inline void ath9k_hw_antdiv_comb_conf_get(struct ath_hw *ah, | ||
125 | struct ath_hw_antcomb_conf *antconf) | ||
126 | { | ||
127 | ath9k_hw_ops(ah)->antdiv_comb_conf_get(ah, antconf); | ||
128 | } | ||
129 | |||
130 | static inline void ath9k_hw_antdiv_comb_conf_set(struct ath_hw *ah, | ||
131 | struct ath_hw_antcomb_conf *antconf) | ||
132 | { | ||
133 | ath9k_hw_ops(ah)->antdiv_comb_conf_set(ah, antconf); | ||
134 | } | ||
135 | |||
124 | /* Private hardware call ops */ | 136 | /* Private hardware call ops */ |
125 | 137 | ||
126 | /* PHY ops */ | 138 | /* PHY ops */ |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index b2248bba25a..67cca10bf4c 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -629,6 +629,11 @@ struct ath_hw_ops { | |||
629 | void (*set11n_aggr_last)(struct ath_hw *ah, void *ds); | 629 | void (*set11n_aggr_last)(struct ath_hw *ah, void *ds); |
630 | void (*clr11n_aggr)(struct ath_hw *ah, void *ds); | 630 | void (*clr11n_aggr)(struct ath_hw *ah, void *ds); |
631 | void (*set_clrdmask)(struct ath_hw *ah, void *ds, bool val); | 631 | void (*set_clrdmask)(struct ath_hw *ah, void *ds, bool val); |
632 | void (*antdiv_comb_conf_get)(struct ath_hw *ah, | ||
633 | struct ath_hw_antcomb_conf *antconf); | ||
634 | void (*antdiv_comb_conf_set)(struct ath_hw *ah, | ||
635 | struct ath_hw_antcomb_conf *antconf); | ||
636 | |||
632 | }; | 637 | }; |
633 | 638 | ||
634 | struct ath_nf_limits { | 639 | struct ath_nf_limits { |
@@ -904,10 +909,6 @@ void ath9k_hw_cfg_output(struct ath_hw *ah, u32 gpio, | |||
904 | void ath9k_hw_set_gpio(struct ath_hw *ah, u32 gpio, u32 val); | 909 | void ath9k_hw_set_gpio(struct ath_hw *ah, u32 gpio, u32 val); |
905 | u32 ath9k_hw_getdefantenna(struct ath_hw *ah); | 910 | u32 ath9k_hw_getdefantenna(struct ath_hw *ah); |
906 | void ath9k_hw_setantenna(struct ath_hw *ah, u32 antenna); | 911 | void ath9k_hw_setantenna(struct ath_hw *ah, u32 antenna); |
907 | void ath9k_hw_antdiv_comb_conf_get(struct ath_hw *ah, | ||
908 | struct ath_hw_antcomb_conf *antconf); | ||
909 | void ath9k_hw_antdiv_comb_conf_set(struct ath_hw *ah, | ||
910 | struct ath_hw_antcomb_conf *antconf); | ||
911 | 912 | ||
912 | /* General Operation */ | 913 | /* General Operation */ |
913 | bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout); | 914 | bool ath9k_hw_wait(struct ath_hw *ah, u32 reg, u32 mask, u32 val, u32 timeout); |