ath9k: Add information about antenna diversity
PATCH 1/11 ath9k: Add information about antenna diversity
From: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/antenna.c | 52 ++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
drivers/net/wireless/ath/ath9k/antenna.c +52 -0
@@ -16,6 +16,58 @@#include "ath9k.h" +/* +* AR9285 +* ====== +* +* EEPROM has 2 4-bit fields containing the card configuration. +* +* antdiv_ctl1: +* ------------ +* bb_enable_ant_div_lnadiv : 1 +* bb_ant_div_alt_gaintb : 1 +* bb_ant_div_main_gaintb : 1 +* bb_enable_ant_fast_div : 1 +* +* antdiv_ctl2: +* ----------- +* bb_ant_div_alt_lnaconf : 2 +* bb_ant_div_main_lnaconf : 2 +* +* The EEPROM bits are used as follows: +* ------------------------------------ +* +* bb_enable_ant_div_lnadiv - Enable LNA path rx antenna diversity/combining. +* Set in AR_PHY_MULTICHAIN_GAIN_CTL. +* +* bb_ant_div_[alt/main]_gaintb - 0 -> Antenna config Alt/Main uses gaintable 0 +* 1 -> Antenna config Alt/Main uses gaintable 1 +* Set in AR_PHY_MULTICHAIN_GAIN_CTL. +* +* bb_enable_ant_fast_div - Enable fast antenna diversity. +* Set in AR_PHY_CCK_DETECT. +* +* bb_ant_div_[alt/main]_lnaconf - Alt/Main LNA diversity/combining input config. +* Set in AR_PHY_MULTICHAIN_GAIN_CTL. +* 10=LNA1 +* 01=LNA2 +* 11=LNA1+LNA2 +* 00=LNA1-LNA2 +* +* AR9485 / AR9565 / AR9331 +* ======================== +* +* The same bits are present in the EEPROM, but the location in the +* EEPROM is different (ant_div_control in ar9300_BaseExtension_1). +* +* ant_div_alt_lnaconf ==> bit 0~1 +* ant_div_main_lnaconf ==> bit 2~3 +* ant_div_alt_gaintb ==> bit 4 +* ant_div_main_gaintb ==> bit 5 +* enable_ant_div_lnadiv ==> bit 6 +* enable_ant_fast_div ==> bit 7 +*/ +static inline bool ath_is_alt_ant_ratio_better (int alt_ratio,int maxdelta,int mindelta,int main_rssi_avg,int alt_rssi_avg,int pkt_count)
Signature · 1 line
1.8.3.4
PATCH 2/11 ath9k: Print LNA combining mode during init
From: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/hw.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +9 -15
@@ -2559,34 +2559,28 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)if (AR_SREV_9287_11_OR_LATER (ah) ||AR_SREV_9271 (ah)) pCap->hw_caps |=ATH9K_HW_CAP_SGI_20 ; -if (AR_SREV_9285 (ah)) +if (AR_SREV_9285 (ah)) {if (ah->eep_ops->get_eeprom (ah,EEP_MODAL_VER ) >=3 ) { ant_div_ctl1 = ah->eep_ops->get_eeprom (ah,EEP_ANT_DIV_CTL1 ); -if ((ant_div_ctl1 &0x1 ) && ((ant_div_ctl1 >>3 ) &0x1 )) +if ((ant_div_ctl1 &0x1 ) && ((ant_div_ctl1 >>3 ) &0x1 )) { pCap->hw_caps |=ATH9K_HW_CAP_ANT_DIV_COMB ; +ath_info (common,"Enable LNA combining\n" ); + } } + } +if (AR_SREV_9300_20_OR_LATER (ah)) {if (ah->eep_ops->get_eeprom (ah,EEP_CHAIN_MASK_REDUCE )) pCap->hw_caps |=ATH9K_HW_CAP_APM ; } -if (AR_SREV_9330 (ah) ||AR_SREV_9485 (ah) ||AR_SREV_9565 (ah)) { ant_div_ctl1 = ah->eep_ops->get_eeprom (ah,EEP_ANT_DIV_CTL1 ); -/* -* enable the diversity-combining algorithm only when -* both enable_lna_div and enable_fast_div are set -* Table for Diversity -* ant_div_alt_lnaconf bit 0-1 -* ant_div_main_lnaconf bit 2-3 -* ant_div_alt_gaintb bit 4 -* ant_div_main_gaintb bit 5 -* enable_ant_div_lnadiv bit 6 -* enable_ant_fast_div bit 7 -*/ -if ((ant_div_ctl1 >>0x6 ) ==0x3 ) +if ((ant_div_ctl1 >>0x6 ) ==0x3 ) { pCap->hw_caps |=ATH9K_HW_CAP_ANT_DIV_COMB ; +ath_info (common,"Enable LNA combining\n" ); + } }if (ath9k_hw_dfs_tested (ah))
Signature · 1 line
1.8.3.4
PATCH 3/11 ath9k: Fix antenna diversity for CUS198
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
CUS198/CUS230 need a few tweaks in the antenna diversity algorithm to accomodate RSSI variation. Add a couple of knobs to control low RSSI threshold and fast antenna diversity bias values.
--- drivers/net/wireless/ath/ath9k/antenna.c | 73 ++++++++++++++++++++------------ drivers/net/wireless/ath/ath9k/ath9k.h | 10 +++++ drivers/net/wireless/ath/ath9k/init.c | 2 + 3 files changed, 59 insertions(+), 26 deletions(-)
drivers/net/wireless/ath/ath9k/antenna.c +47 -26
@@ -68,16 +68,27 @@* enable_ant_fast_div ==> bit 7 */ -static inline bool ath_is_alt_ant_ratio_better (int alt_ratio,int maxdelta, +static inline bool ath_is_alt_ant_ratio_better (struct ath_ant_comb *antcomb, +int alt_ratio,int maxdelta,int mindelta,int main_rssi_avg,int alt_rssi_avg,int pkt_count) { -return (((alt_ratio >=ATH_ANT_DIV_COMB_ALT_ANT_RATIO2 ) && - (alt_rssi_avg > main_rssi_avg + maxdelta)) || - (alt_rssi_avg > main_rssi_avg + mindelta)) && (pkt_count >50 ); +if (pkt_count <=50 ) +return false; + +if (alt_rssi_avg > main_rssi_avg + mindelta) +return true; + +if (alt_ratio >= antcomb->ant_ratio2 && + alt_rssi_avg >= antcomb->low_rssi_thresh && + (alt_rssi_avg > main_rssi_avg + maxdelta)) +return true; + +return false; }static inline bool ath_ant_div_comb_alt_check (struct ath_hw_antcomb_conf *conf, +struct ath_ant_comb *antcomb,int alt_ratio,int alt_rssi_avg,int main_rssi_avg) {
@@ -100,20 +111,22 @@ static inline bool ath_ant_div_comb_alt_check(struct ath_hw_antcomb_conf *conf,break ;case 1 :case 2 : -if (alt_rssi_avg <4 ) +if (alt_rssi_avg <4 || alt_rssi_avg < antcomb->low_rssi_thresh)break ;if ((set1 && (alt_rssi_avg >= (main_rssi_avg -5 ))) || - (set2 && (alt_rssi_avg >= (main_rssi_avg -2 )))) + (set2 && (alt_rssi_avg >= (main_rssi_avg -2 ))) || + (alt_ratio > antcomb->ant_ratio)) result = true;break ;case 3 : -if (alt_rssi_avg <4 ) +if (alt_rssi_avg <4 || alt_rssi_avg < antcomb->low_rssi_thresh)break ;if ((set1 && (alt_rssi_avg >= (main_rssi_avg -3 ))) || - (set2 && (alt_rssi_avg >= (main_rssi_avg +3 )))) + (set2 && (alt_rssi_avg >= (main_rssi_avg +3 ))) || + (alt_ratio > antcomb->ant_ratio)) result = true;break ;
@@ -266,7 +279,7 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb,if (antcomb->main_conf ==ATH_ANT_DIV_COMB_LNA1 ) {/* main is LNA1 */ - if (ath_is_alt_ant_ratio_better(alt_ratio, + if (ath_is_alt_ant_ratio_better(antcomb, alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_HI, ATH_ANT_DIV_COMB_LNA1_DELTA_LOW, main_rssi_avg, alt_rssi_avg,
@@ -275,7 +288,7 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb,else antcomb->first_ratio = false; }else if (antcomb->main_conf ==ATH_ANT_DIV_COMB_LNA2 ) { - if (ath_is_alt_ant_ratio_better(alt_ratio, + if (ath_is_alt_ant_ratio_better(antcomb, alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_MID, ATH_ANT_DIV_COMB_LNA1_DELTA_LOW, main_rssi_avg, alt_rssi_avg,
@@ -284,7 +297,7 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb,else antcomb->first_ratio = false; }else { - if (ath_is_alt_ant_ratio_better(alt_ratio, + if (ath_is_alt_ant_ratio_better(antcomb, alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_HI, 0, main_rssi_avg, alt_rssi_avg,
@@ -325,7 +338,7 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb, div_ant_conf->main_lna_conf =ATH_ANT_DIV_COMB_LNA1 ;if (antcomb->main_conf ==ATH_ANT_DIV_COMB_LNA1 ) { - if (ath_is_alt_ant_ratio_better(alt_ratio, + if (ath_is_alt_ant_ratio_better(antcomb, alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_HI, ATH_ANT_DIV_COMB_LNA1_DELTA_LOW, main_rssi_avg, alt_rssi_avg,
@@ -334,7 +347,7 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb,else antcomb->second_ratio = false; }else if (antcomb->main_conf ==ATH_ANT_DIV_COMB_LNA2 ) { - if (ath_is_alt_ant_ratio_better(alt_ratio, + if (ath_is_alt_ant_ratio_better(antcomb, alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_MID, ATH_ANT_DIV_COMB_LNA1_DELTA_LOW, main_rssi_avg, alt_rssi_avg,
@@ -343,7 +356,7 @@ static void ath_select_ant_div_from_quick_scan(struct ath_ant_comb *antcomb,else antcomb->second_ratio = false; }else { - if (ath_is_alt_ant_ratio_better(alt_ratio, + if (ath_is_alt_ant_ratio_better(antcomb, alt_ratio, ATH_ANT_DIV_COMB_LNA1_DELTA_HI, 0, main_rssi_avg, alt_rssi_avg,
@@ -484,8 +497,7 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf, ant_conf->fast_div_bias =0x1 ;break ;case 0x10 :/* LNA2 A-B */ -if (!(antcomb->scan) && - (alt_ratio >ATH_ANT_DIV_COMB_ALT_ANT_RATIO )) +if (!antcomb->scan && (alt_ratio > antcomb->ant_ratio)) ant_conf->fast_div_bias =0x1 ;else ant_conf->fast_div_bias =0x2 ;
@@ -494,15 +506,13 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf, ant_conf->fast_div_bias =0x1 ;break ;case 0x13 :/* LNA2 A+B */ -if (!(antcomb->scan) && - (alt_ratio >ATH_ANT_DIV_COMB_ALT_ANT_RATIO )) +if (!antcomb->scan && (alt_ratio > antcomb->ant_ratio)) ant_conf->fast_div_bias =0x1 ;else ant_conf->fast_div_bias =0x2 ;break ;case 0x20 :/* LNA1 A-B */ -if (!(antcomb->scan) && - (alt_ratio >ATH_ANT_DIV_COMB_ALT_ANT_RATIO )) +if (!antcomb->scan && (alt_ratio > antcomb->ant_ratio)) ant_conf->fast_div_bias =0x1 ;else ant_conf->fast_div_bias =0x2 ;
@@ -511,8 +521,7 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf, ant_conf->fast_div_bias =0x1 ;break ;case 0x23 :/* LNA1 A+B */ -if (!(antcomb->scan) && - (alt_ratio >ATH_ANT_DIV_COMB_ALT_ANT_RATIO )) +if (!antcomb->scan && (alt_ratio > antcomb->ant_ratio)) ant_conf->fast_div_bias =0x1 ;else ant_conf->fast_div_bias =0x2 ;
@@ -529,6 +538,9 @@ static void ath_ant_div_conf_fast_divbias(struct ath_hw_antcomb_conf *ant_conf,default :break ; } + +if (antcomb->fast_div_bias) + ant_conf->fast_div_bias = antcomb->fast_div_bias; }else if (ant_conf->div_group ==3 ) {switch ((ant_conf->main_lna_conf <<4 ) | ant_conf->alt_lna_conf) {
@@ -668,13 +680,14 @@ static void ath_ant_try_scan(struct ath_ant_comb *antcomb, }static bool ath_ant_try_switch (struct ath_hw_antcomb_conf *div_ant_conf, +struct ath_ant_comb *antcomb,int alt_ratio,int alt_rssi_avg,int main_rssi_avg,int curr_main_set,int curr_alt_set) {bool ret = false; -if (ath_ant_div_comb_alt_check (div_ant_conf, alt_ratio, +if (ath_ant_div_comb_alt_check (div_ant_conf, antcomb, alt_ratio, alt_rssi_avg, main_rssi_avg)) {if (curr_alt_set ==ATH_ANT_DIV_COMB_LNA2 ) {/*
@@ -718,7 +731,7 @@ static bool ath_ant_short_scan_check(struct ath_ant_comb *antcomb)if (antcomb->total_pkt_count ==ATH_ANT_DIV_COMB_SHORT_SCAN_PKTCOUNT ) { alt_ratio = ((antcomb->alt_recv_cnt *100 ) / antcomb->total_pkt_count); -if (alt_ratio <ATH_ANT_DIV_COMB_ALT_ANT_RATIO ) +if (alt_ratio < antcomb->ant_ratio)return true; }
@@ -741,6 +754,14 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) main_ant_conf = (rs->rs_rssi_ctl2 >>ATH_ANT_RX_MAIN_SHIFT ) &ATH_ANT_RX_MASK ; +if (alt_rssi >= antcomb->low_rssi_thresh) { + antcomb->ant_ratio =ATH_ANT_DIV_COMB_ALT_ANT_RATIO ; + antcomb->ant_ratio2 =ATH_ANT_DIV_COMB_ALT_ANT_RATIO2 ; + }else { + antcomb->ant_ratio =ATH_ANT_DIV_COMB_ALT_ANT_RATIO_LOW_RSSI ; + antcomb->ant_ratio2 =ATH_ANT_DIV_COMB_ALT_ANT_RATIO2_LOW_RSSI ; + } +/* Record packet only when both main_rssi and alt_rssi is positive */ if (main_rssi >0 && alt_rssi >0 ) { antcomb->total_pkt_count++;
@@ -783,7 +804,7 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) antcomb->count++;if (antcomb->count ==ATH_ANT_DIV_COMB_MAX_COUNT ) { -if (alt_ratio >ATH_ANT_DIV_COMB_ALT_ANT_RATIO ) { +if (alt_ratio > antcomb->ant_ratio) {ath_lnaconf_alt_good_scan (antcomb, div_ant_conf, main_rssi_avg); antcomb->alt_good = true;
@@ -797,7 +818,7 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs) }if (!antcomb->scan) { - ret =ath_ant_try_switch (&div_ant_conf, alt_ratio, + ret =ath_ant_try_switch (&div_ant_conf, antcomb, alt_ratio, alt_rssi_avg, main_rssi_avg, curr_main_set, curr_alt_set);if (ret)
drivers/net/wireless/ath/ath9k/ath9k.h +10 -0
@@ -585,6 +585,8 @@ static inline void ath_fill_led_pin(struct ath_softc *sc)#define ATH_ANT_DIV_COMB_MAX_COUNT 100#define ATH_ANT_DIV_COMB_ALT_ANT_RATIO 30#define ATH_ANT_DIV_COMB_ALT_ANT_RATIO2 20 +#define ATH_ANT_DIV_COMB_ALT_ANT_RATIO_LOW_RSSI 50 +#define ATH_ANT_DIV_COMB_ALT_ANT_RATIO2_LOW_RSSI 50#define ATH_ANT_DIV_COMB_LNA1_LNA2_SWITCH_DELTA -1#define ATH_ANT_DIV_COMB_LNA1_DELTA_HI -4
@@ -607,6 +609,8 @@ struct ath_ant_comb {int rssi_first;int rssi_second;int rssi_third; +int ant_ratio; +int ant_ratio2;bool alt_good;int quick_scan_cnt;enum ath9k_ant_div_comb_lna_conf main_conf;
@@ -615,6 +619,12 @@ struct ath_ant_comb {bool first_ratio;bool second_ratio;unsigned long scan_start_time; + +/* +* Card-specific config values. +*/ +int low_rssi_thresh; +int fast_div_bias; };void ath_ant_comb_scan (struct ath_softc *sc,struct ath_rx_status *rs);
drivers/net/wireless/ath/ath9k/init.c +2 -0
@@ -525,6 +525,8 @@ static void ath9k_init_platform(struct ath_softc *sc) ATH9K_PCI_CUS230)) { ah->config.xlna_gpio =9 ; ah->config.xatten_margin_cfg = true; + sc->ant_comb.low_rssi_thresh =20 ; + sc->ant_comb.fast_div_bias =3 ; ath_info(common, "Set parameters for %s\n", (sc->driver_data & ATH9K_PCI_CUS198) ?
Signature · 1 line
1.8.3.4
PATCH 4/11 ath9k: Cleanup WLAN/BT RX diversity
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
For single-chain WLAN+BT cards, the BT antenna can be used for WLAN RX when the BT interface is disabled. Rename the modparam "antenna_diversity" to "bt_ant_diversity" to clarify this.
--- drivers/net/wireless/ath/ath.h | 2 +- drivers/net/wireless/ath/ath9k/antenna.c | 2 +- drivers/net/wireless/ath/ath9k/debug.c | 38 +++++++++++++++----------------- drivers/net/wireless/ath/ath9k/init.c | 12 +++++----- 4 files changed, 26 insertions(+), 28 deletions(-)
drivers/net/wireless/ath/ath.h +1 -1
@@ -159,7 +159,7 @@ struct ath_common {bool btcoex_enabled;bool disable_ani; -bool antenna_diversity; +bool bt_ant_diversity; }; struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
drivers/net/wireless/ath/ath9k/antenna.c +1 -1
@@ -887,6 +887,6 @@ void ath_ant_comb_update(struct ath_softc *sc)ath9k_hw_antdiv_comb_conf_set (ah, &div_ant_conf); -if (common->antenna_diversity) +if (common->bt_ant_diversity)ath9k_hw_antctrl_shared_chain_lnadiv (ah, true); }
drivers/net/wireless/ath/ath9k/debug.c +18 -20
@@ -270,25 +270,26 @@ static const struct file_operations fops_ani = { .llseek = default_llseek, }; -static ssize_t read_file_ant_diversity (struct file *file,char __user *user_buf, -size_t count,loff_t *ppos) +static ssize_t read_file_bt_ant_diversity (struct file *file, +char __user *user_buf, +size_t count,loff_t *ppos) {struct ath_softc *sc = file->private_data;struct ath_common *common =ath9k_hw_common (sc->sc_ah);char buf[32 ];unsigned int len; - len =sprintf (buf,"%d\n" , common->antenna_diversity); + len =sprintf (buf,"%d\n" , common->bt_ant_diversity);return simple_read_from_buffer (user_buf, count, ppos, buf, len); } -static ssize_t write_file_ant_diversity (struct file *file, -const char __user *user_buf, -size_t count,loff_t *ppos) +static ssize_t write_file_bt_ant_diversity (struct file *file, +const char __user *user_buf, +size_t count,loff_t *ppos) {struct ath_softc *sc = file->private_data;struct ath_common *common =ath9k_hw_common (sc->sc_ah); -unsigned long antenna_diversity; +unsigned long bt_ant_diversity;char buf[32 ];ssize_t len;
@@ -296,26 +297,23 @@ static ssize_t write_file_ant_diversity(struct file *file,if (copy_from_user (buf, user_buf, len))return -EFAULT ; -if (!AR_SREV_9565 (sc->sc_ah)) - goto exit; - buf[len] ='\0' ; -if (kstrtoul (buf,0 , &antenna_diversity)) +if (kstrtoul (buf,0 , &bt_ant_diversity))return -EINVAL ; - common->antenna_diversity = !!antenna_diversity; + common->bt_ant_diversity = !!bt_ant_diversity;ath9k_ps_wakeup (sc);ath_ant_comb_update (sc); -ath_dbg (common,CONFIG ,"Antenna diversity: %d\n" , - common->antenna_diversity); +ath_dbg (common,CONFIG ,"Enable WLAN/BT RX Antenna diversity: %d\n" , + common->bt_ant_diversity);ath9k_ps_restore (sc); -exit: +return count; } -static const struct file_operations fops_ant_diversity = { - .read = read_file_ant_diversity, - .write = write_file_ant_diversity, +static const struct file_operations fops_bt_ant_diversity = { + .read = read_file_bt_ant_diversity, + .write = write_file_bt_ant_diversity, .open = simple_open, .owner =THIS_MODULE , .llseek = default_llseek,
@@ -1933,8 +1931,8 @@ int ath9k_init_debug(struct ath_hw *ah) sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask);debugfs_create_u32 ("gpio_val" ,S_IRUSR |S_IWUSR , sc->debug.debugfs_phy, &sc->sc_ah->gpio_val); -debugfs_create_file ("diversity" ,S_IRUSR |S_IWUSR , - sc->debug.debugfs_phy, sc, &fops_ant_diversity); +debugfs_create_file ("bt_ant_diversity" ,S_IRUSR |S_IWUSR , + sc->debug.debugfs_phy, sc, &fops_bt_ant_diversity);debugfs_create_file ("antenna_diversity" ,S_IRUSR , sc->debug.debugfs_phy, sc, &fops_antenna_diversity);#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
drivers/net/wireless/ath/ath9k/init.c +6 -6
@@ -53,9 +53,9 @@ static int ath9k_btcoex_enable;module_param_named (btcoex_enable, ath9k_btcoex_enable, int,0444 );MODULE_PARM_DESC (btcoex_enable,"Enable wifi-BT coexistence" ); -static int ath9k_enable_diversity; -module_param_named (enable_diversity, ath9k_enable_diversity, int,0444 ); -MODULE_PARM_DESC (enable_diversity,"Enable Antenna diversity for AR9565" ); +static int ath9k_bt_ant_diversity; +module_param_named (bt_ant_diversity, ath9k_bt_ant_diversity, int,0444 ); +MODULE_PARM_DESC (bt_ant_diversity,"Enable WLAN/BT RX antenna diversity" );bool is_ath9k_unloaded;/* We use the hw_value as an index into our private channel structure */
@@ -633,11 +633,11 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,ath9k_init_platform (sc);/* -* Enable Antenna diversity only when BTCOEX is disabled +* Enable WLAN/BT RX Antenna diversity only when BTCOEX is enabled * and the user manually requests the feature. */ -if (!common->btcoex_enabled && ath9k_enable_diversity) - common->antenna_diversity =1 ; +if (common->btcoex_enabled && ath9k_bt_ant_diversity) + common->bt_ant_diversity =1 ;spin_lock_init (&common->cc_lock);
Signature · 1 line
1.8.3.4
PATCH 5/11 ath9k: Add a HW capability for WLAN/BT RX diversity
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
Make use of this capability to restrict the usage of the debugfs file and modparam using which this feature can be enabled.
--- drivers/net/wireless/ath/ath9k/ath9k.h | 9 +++++---- drivers/net/wireless/ath/ath9k/debug.c | 6 +++++- drivers/net/wireless/ath/ath9k/hw.h | 1 + drivers/net/wireless/ath/ath9k/init.c | 21 +++++++++++++++++---- 4 files changed, 28 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +5 -4
@@ -634,10 +634,11 @@ void ath_ant_comb_update(struct ath_softc *sc);/* Main driver core */ /********************/ -#define ATH9K_PCI_CUS198 0x0001 -#define ATH9K_PCI_CUS230 0x0002 -#define ATH9K_PCI_CUS217 0x0004 -#define ATH9K_PCI_WOW 0x0008 +#define ATH9K_PCI_CUS198 0x0001 +#define ATH9K_PCI_CUS230 0x0002 +#define ATH9K_PCI_CUS217 0x0004 +#define ATH9K_PCI_WOW 0x0008 +#define ATH9K_PCI_BT_ANT_DIV 0x0010/* * Default cache line size, in bytes.
drivers/net/wireless/ath/ath9k/debug.c +5 -1
@@ -289,6 +289,7 @@ static ssize_t write_file_bt_ant_diversity(struct file *file, {struct ath_softc *sc = file->private_data;struct ath_common *common =ath9k_hw_common (sc->sc_ah); +struct ath9k_hw_capabilities *pCap = &sc->sc_ah->caps;unsigned long bt_ant_diversity;char buf[32 ];ssize_t len;
@@ -297,6 +298,9 @@ static ssize_t write_file_bt_ant_diversity(struct file *file,if (copy_from_user (buf, user_buf, len))return -EFAULT ; +if (!(pCap->hw_caps &ATH9K_HW_CAP_BT_ANT_DIV )) + goto exit; + buf[len] ='\0' ;if (kstrtoul (buf,0 , &bt_ant_diversity))return -EINVAL ;
@@ -307,7 +311,7 @@ static ssize_t write_file_bt_ant_diversity(struct file *file,ath_dbg (common,CONFIG ,"Enable WLAN/BT RX Antenna diversity: %d\n" , common->bt_ant_diversity);ath9k_ps_restore (sc); - +exit:return count; }
drivers/net/wireless/ath/ath9k/hw.h +1 -0
@@ -248,6 +248,7 @@ enum ath9k_hw_caps {ATH9K_HW_WOW_DEVICE_CAPABLE =BIT (17 ),ATH9K_HW_CAP_PAPRD =BIT (18 ),ATH9K_HW_CAP_FCC_BAND_SWITCH =BIT (19 ), + ATH9K_HW_CAP_BT_ANT_DIV = BIT(20), };/*
drivers/net/wireless/ath/ath9k/init.c +17 -4
@@ -516,6 +516,7 @@ static void ath9k_init_misc(struct ath_softc *sc)static void ath9k_init_platform (struct ath_softc *sc) {struct ath_hw *ah = sc->sc_ah; +struct ath9k_hw_capabilities *pCap = &ah->caps;struct ath_common *common =ath9k_hw_common (ah);if (common->bus_ops->ath_bus_type !=ATH_PCI )
@@ -531,8 +532,14 @@ static void ath9k_init_platform(struct ath_softc *sc)ath_info (common,"Set parameters for %s\n" , (sc->driver_data &ATH9K_PCI_CUS198 ) ?"CUS198" :"CUS230" ); - }else if (sc->driver_data &ATH9K_PCI_CUS217 ) { + } + +if (sc->driver_data &ATH9K_PCI_CUS217 )ath_info (common,"CUS217 card detected\n" ); + +if (sc->driver_data &ATH9K_PCI_BT_ANT_DIV ) { + pCap->hw_caps |=ATH9K_HW_CAP_BT_ANT_DIV ; +ath_info (common,"Set BT/WLAN RX diversity capability\n" ); } }
@@ -586,6 +593,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, {struct ath9k_platform_data *pdata = sc->dev->platform_data;struct ath_hw *ah =NULL ; +struct ath9k_hw_capabilities *pCap;struct ath_common *common;int ret =0 , i;int csz =0 ;
@@ -602,6 +610,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, ah->reg_ops.rmw = ath9k_reg_rmw;atomic_set (&ah->intr_ref_cnt,-1 ); sc->sc_ah = ah; + pCap = &ah->caps; sc->dfs_detector =dfs_pattern_detector_init (ah,NL80211_DFS_UNSET );
@@ -633,10 +642,14 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,ath9k_init_platform (sc);/* -* Enable WLAN/BT RX Antenna diversity only when BTCOEX is enabled -* and the user manually requests the feature. +* Enable WLAN/BT RX Antenna diversity only when: +* +* - BTCOEX is enabled +* - the user manually requests the feature. +* - the HW cap is set using the platform data. */ -if (common->btcoex_enabled && ath9k_bt_ant_diversity) +if (common->btcoex_enabled && ath9k_bt_ant_diversity && + (pCap->hw_caps &ATH9K_HW_CAP_BT_ANT_DIV )) common->bt_ant_diversity =1 ;spin_lock_init (&common->cc_lock);
Signature · 1 line
1.8.3.4
PATCH 6/11 ath9k: Rename ath9k_hw_antctrl_shared_chain_lnadiv
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
Use "ath9k_hw_set_bt_ant_diversity" instead.
--- drivers/net/wireless/ath/ath9k/antenna.c | 2 +- drivers/net/wireless/ath/ath9k/ar9003_phy.c | 5 ++--- drivers/net/wireless/ath/ath9k/hw-ops.h | 7 +++---- drivers/net/wireless/ath/ath9k/hw.h | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath9k/antenna.c +1 -1
@@ -888,5 +888,5 @@ void ath_ant_comb_update(struct ath_softc *sc)ath9k_hw_antdiv_comb_conf_set (ah, &div_ant_conf);if (common->bt_ant_diversity) -ath9k_hw_antctrl_shared_chain_lnadiv (ah, true); +ath9k_hw_set_bt_ant_diversity (ah, true); }
drivers/net/wireless/ath/ath9k/ar9003_phy.c +2 -3
@@ -1412,8 +1412,7 @@ static void ar9003_hw_antdiv_comb_conf_set(struct ath_hw *ah,REG_WRITE (ah,AR_PHY_MC_GAIN_CTRL , regval); } -static void ar9003_hw_antctrl_shared_chain_lnadiv (struct ath_hw *ah, -bool enable) +static void ar9003_hw_set_bt_ant_diversity (struct ath_hw *ah,bool enable) {u8 ant_div_ctl1;u32 regval;
@@ -1646,7 +1645,7 @@ void ar9003_hw_attach_phy_ops(struct ath_hw *ah) ops->antdiv_comb_conf_get = ar9003_hw_antdiv_comb_conf_get; ops->antdiv_comb_conf_set = ar9003_hw_antdiv_comb_conf_set; - ops->antctrl_shared_chain_lnadiv = ar9003_hw_antctrl_shared_chain_lnadiv; + ops->set_bt_ant_diversity = ar9003_hw_set_bt_ant_diversity; ops->spectral_scan_config = ar9003_hw_spectral_scan_config; ops->spectral_scan_trigger = ar9003_hw_spectral_scan_trigger; ops->spectral_scan_wait = ar9003_hw_spectral_scan_wait;
drivers/net/wireless/ath/ath9k/hw-ops.h +3 -4
@@ -78,11 +78,10 @@ static inline void ath9k_hw_antdiv_comb_conf_set(struct ath_hw *ah,ath9k_hw_ops (ah)->antdiv_comb_conf_set (ah, antconf); } -static inline void ath9k_hw_antctrl_shared_chain_lnadiv (struct ath_hw *ah, -bool enable) +static inline void ath9k_hw_set_bt_ant_diversity (struct ath_hw *ah,bool enable) { -if (ath9k_hw_ops (ah)->antctrl_shared_chain_lnadiv) -ath9k_hw_ops (ah)->antctrl_shared_chain_lnadiv (ah, enable); +if (ath9k_hw_ops (ah)->set_bt_ant_diversity) +ath9k_hw_ops (ah)->set_bt_ant_diversity (ah, enable); }/* Private hardware call ops */
drivers/net/wireless/ath/ath9k/hw.h +1 -1
@@ -718,7 +718,7 @@ struct ath_hw_ops { struct ath_hw_antcomb_conf *antconf);void (*antdiv_comb_conf_set)(struct ath_hw *ah,struct ath_hw_antcomb_conf *antconf); -void (*antctrl_shared_chain_lnadiv)(struct ath_hw *hw,bool enable); +void (*set_bt_ant_diversity)(struct ath_hw *hw,bool enable);void (*spectral_scan_config)(struct ath_hw *ah,struct ath_spec_scan *param);void (*spectral_scan_trigger)(struct ath_hw *ah);
Signature · 1 line
1.8.3.4
PATCH 7/11 ath9k: Enable WLAN/BT Ant Diversity for WB225/WB195
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
A custom solution for Asus is WB195 based and supports WLAN/BT Rx diversity. Identify this card and set the capability.
CUS198/CUS230, which are based on WB225 also support WLAN/BT Rx diversity.
--- drivers/net/wireless/ath/ath9k/pci.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath9k/pci.c +13 -5
@@ -29,6 +29,14 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = { { PCI_VDEVICE(ATHEROS, 0x0027) }, /* PCI */ { PCI_VDEVICE(ATHEROS, 0x0029) }, /* PCI */ { PCI_VDEVICE(ATHEROS, 0x002A) }, /* PCI-E */ + +/* AR9285 card for Asus */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, +0x002B , +PCI_VENDOR_ID_AZWAVE , +0x2C37 ), + .driver_data = ATH9K_PCI_BT_ANT_DIV }, + { PCI_VDEVICE(ATHEROS, 0x002B) }, /* PCI-E */ { PCI_VDEVICE(ATHEROS, 0x002C) }, /* PCI-E 802.11n bonded out */ { PCI_VDEVICE(ATHEROS, 0x002D) }, /* PCI */
@@ -40,29 +48,29 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = { 0x0032, PCI_VENDOR_ID_AZWAVE, 0x2086), - .driver_data = ATH9K_PCI_CUS198 }, + .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, {PCI_DEVICE_SUB (PCI_VENDOR_ID_ATHEROS ,0x0032 ,PCI_VENDOR_ID_AZWAVE , 0x1237), - .driver_data = ATH9K_PCI_CUS198 }, + .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 0x0032, PCI_VENDOR_ID_AZWAVE, 0x2126), - .driver_data = ATH9K_PCI_CUS198 }, + .driver_data = ATH9K_PCI_CUS198 | ATH9K_PCI_BT_ANT_DIV }, /* PCI-E CUS230 */ { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 0x0032, PCI_VENDOR_ID_AZWAVE, 0x2152), - .driver_data = ATH9K_PCI_CUS230 }, + .driver_data = ATH9K_PCI_CUS230 | ATH9K_PCI_BT_ANT_DIV }, { PCI_DEVICE_SUB(PCI_VENDOR_ID_ATHEROS, 0x0032, PCI_VENDOR_ID_FOXCONN, 0xE075), - .driver_data = ATH9K_PCI_CUS230 }, + .driver_data = ATH9K_PCI_CUS230 | ATH9K_PCI_BT_ANT_DIV }, { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */ { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */
Signature · 1 line
1.8.3.4
PATCH 8/11 ath9k: Program HW for WB195 diversity
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
The MC_GAIN_CTL/CCK_DETECT registers have to be programmed with the correct configuration values if WLAN/BT RX diversity is enabled. Add this and also take care of the BTCOEX mode when fast diversity is enabled/disabled.
--- drivers/net/wireless/ath/ath9k/ar9002_phy.c | 60 +++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/ar9002_phy.h | 6 +++ 2 files changed, 66 insertions(+)
drivers/net/wireless/ath/ath9k/ar9002_phy.c +60 -0
@@ -555,6 +555,65 @@ static void ar9002_hw_antdiv_comb_conf_set(struct ath_hw *ah,REG_WRITE (ah,AR_PHY_MULTICHAIN_GAIN_CTL , regval); } +static void ar9002_hw_set_bt_ant_diversity (struct ath_hw *ah,bool enable) +{ +struct ath_btcoex_hw *btcoex = &ah->btcoex_hw; +u8 antdiv_ctrl1, antdiv_ctrl2; +u32 regval; + +if (enable) { + antdiv_ctrl1 =ATH_BT_COEX_ANTDIV_CONTROL1_ENABLE ; + antdiv_ctrl2 =ATH_BT_COEX_ANTDIV_CONTROL2_ENABLE ; + +/* +* Don't disable BT ant to allow BB to control SWCOM. +*/ + btcoex->bt_coex_mode2 &= (~(AR_BT_DISABLE_BT_ANT )); +REG_WRITE (ah,AR_BT_COEX_MODE2 , btcoex->bt_coex_mode2); + +REG_WRITE (ah,AR_PHY_SWITCH_COM ,ATH_BT_COEX_ANT_DIV_SWITCH_COM ); +REG_RMW (ah,AR_PHY_SWITCH_CHAIN_0 ,0 ,0xf0000000 ); + }else { +/* +* Disable antenna diversity, use LNA1 only. +*/ + antdiv_ctrl1 =ATH_BT_COEX_ANTDIV_CONTROL1_FIXED_A ; + antdiv_ctrl2 =ATH_BT_COEX_ANTDIV_CONTROL2_FIXED_A ; + +/* +* Disable BT Ant. to allow concurrent BT and WLAN receive. +*/ + btcoex->bt_coex_mode2 |=AR_BT_DISABLE_BT_ANT ; +REG_WRITE (ah,AR_BT_COEX_MODE2 , btcoex->bt_coex_mode2); + +/* +* Program SWCOM table to make sure RF switch always parks +* at BT side. +*/ +REG_WRITE (ah,AR_PHY_SWITCH_COM ,0 ); +REG_RMW (ah,AR_PHY_SWITCH_CHAIN_0 ,0 ,0xf0000000 ); + } + + regval =REG_READ (ah,AR_PHY_MULTICHAIN_GAIN_CTL ); + regval &= (~(AR_PHY_9285_ANT_DIV_CTL_ALL )); +/* +* Clear ant_fast_div_bias [14:9] since for WB195, +* the main LNA is always LNA1. +*/ + regval &= (~(AR_PHY_9285_FAST_DIV_BIAS )); + regval |=SM (antdiv_ctrl1,AR_PHY_9285_ANT_DIV_CTL ); + regval |=SM (antdiv_ctrl2,AR_PHY_9285_ANT_DIV_ALT_LNACONF ); + regval |=SM ((antdiv_ctrl2 >>2 ),AR_PHY_9285_ANT_DIV_MAIN_LNACONF ); + regval |=SM ((antdiv_ctrl1 >>1 ),AR_PHY_9285_ANT_DIV_ALT_GAINTB ); + regval |=SM ((antdiv_ctrl1 >>2 ),AR_PHY_9285_ANT_DIV_MAIN_GAINTB ); +REG_WRITE (ah,AR_PHY_MULTICHAIN_GAIN_CTL , regval); + + regval =REG_READ (ah,AR_PHY_CCK_DETECT ); + regval &= (~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV ); + regval |=SM ((antdiv_ctrl1 >>3 ),AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV ); +REG_WRITE (ah,AR_PHY_CCK_DETECT , regval); +} +static void ar9002_hw_spectral_scan_config (struct ath_hw *ah,struct ath_spec_scan *param) {
@@ -630,6 +689,7 @@ void ar9002_hw_attach_phy_ops(struct ath_hw *ah) ops->antdiv_comb_conf_get = ar9002_hw_antdiv_comb_conf_get; ops->antdiv_comb_conf_set = ar9002_hw_antdiv_comb_conf_set; + ops->set_bt_ant_diversity = ar9002_hw_set_bt_ant_diversity; ops->spectral_scan_config = ar9002_hw_spectral_scan_config; ops->spectral_scan_trigger = ar9002_hw_spectral_scan_trigger; ops->spectral_scan_wait = ar9002_hw_spectral_scan_wait;
drivers/net/wireless/ath/ath9k/ar9002_phy.h +6 -0
@@ -320,6 +320,12 @@#define AR_PHY_9285_ANT_DIV_GAINTB_0 0#define AR_PHY_9285_ANT_DIV_GAINTB_1 1 +#define ATH_BT_COEX_ANTDIV_CONTROL1_ENABLE 0x0b +#define ATH_BT_COEX_ANTDIV_CONTROL2_ENABLE 0x09 +#define ATH_BT_COEX_ANTDIV_CONTROL1_FIXED_A 0x04 +#define ATH_BT_COEX_ANTDIV_CONTROL2_FIXED_A 0x09 +#define ATH_BT_COEX_ANT_DIV_SWITCH_COM 0x66666666 +#define AR_PHY_EXT_CCA0 0x99b8#define AR_PHY_EXT_CCA0_THRESH62 0x000000FF#define AR_PHY_EXT_CCA0_THRESH62_S 0
Signature · 1 line
1.8.3.4
PATCH 9/11 ath9k: Remove "shared_chain_lnadiv"
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
This variable is redundant since we can use common->bt_ant_diversity to determine if diversity has to be enabled/disabled.
--- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 3 ++- drivers/net/wireless/ath/ath9k/ar9003_phy.c | 1 - drivers/net/wireless/ath/ath9k/hw.c | 2 +- drivers/net/wireless/ath/ath9k/hw.h | 1 - 4 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +2 -1
@@ -3561,6 +3561,7 @@ static u16 ar9003_hw_ant_ctrl_chain_get(struct ath_hw *ah, int chain,static void ar9003_hw_ant_ctrl_apply (struct ath_hw *ah,bool is2ghz) { +struct ath_common *common =ath9k_hw_common (ah);struct ath9k_hw_capabilities *pCap = &ah->caps;int chain;u32 regval, value, gpio;
@@ -3646,7 +3647,7 @@ static void ar9003_hw_ant_ctrl_apply(struct ath_hw *ah, bool is2ghz) regval |= ((value >>6 ) &0x1 ) <<AR_PHY_ANT_DIV_LNADIV_S ;if (AR_SREV_9565 (ah)) { -if (ah->shared_chain_lnadiv) { +if (common->bt_ant_diversity) { regval |= (1 <<AR_PHY_ANT_SW_RX_PROT_S ); }else { regval &= ~(1 <<AR_PHY_ANT_DIV_LNADIV_S );
drivers/net/wireless/ath/ath9k/ar9003_phy.c +0 -1
@@ -1420,7 +1420,6 @@ static void ar9003_hw_set_bt_ant_diversity(struct ath_hw *ah, bool enable)if (!AR_SREV_9565 (ah))return ; - ah->shared_chain_lnadiv = enable; ant_div_ctl1 = ah->eep_ops->get_eeprom (ah,EEP_ANT_DIV_CTL1 ); regval =REG_READ (ah,AR_PHY_MC_GAIN_CTRL );
drivers/net/wireless/ath/ath9k/hw.c +1 -1
@@ -2056,7 +2056,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,ath9k_hw_apply_gpio_override (ah); -if (AR_SREV_9565 (ah) && ah->shared_chain_lnadiv) +if (AR_SREV_9565 (ah) && common->bt_ant_diversity)REG_SET_BIT (ah,AR_BTCOEX_WL_LNADIV ,AR_BTCOEX_WL_LNADIV_FORCE_ON );return 0 ;
drivers/net/wireless/ath/ath9k/hw.h +0 -1
@@ -767,7 +767,6 @@ struct ath_hw {bool aspm_enabled;bool is_monitoring;bool need_an_top2_fixup; -bool shared_chain_lnadiv;u16 tx_trig_level;u32 nf_regs[6 ];
Signature · 1 line
1.8.3.4
PATCH 10/11 ath9k: Set SWCOM value for CUS198
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
CUS198/CUS230 cards require a custom value to be programmed into the SWCOM register. Assign this during init time.
--- drivers/net/wireless/ath/ath9k/hw.h | 1 + drivers/net/wireless/ath/ath9k/init.c | 1 + 2 files changed, 2 insertions(+)
drivers/net/wireless/ath/ath9k/hw.h +1 -0
@@ -312,6 +312,7 @@ struct ath9k_ops_config {/* Platform specific config */ u32 xlna_gpio; +u32 ant_ctrl_comm2g_switch_enable;bool xatten_margin_cfg; };
drivers/net/wireless/ath/ath9k/init.c +1 -0
@@ -526,6 +526,7 @@ static void ath9k_init_platform(struct ath_softc *sc) ATH9K_PCI_CUS230)) { ah->config.xlna_gpio =9 ; ah->config.xatten_margin_cfg = true; + ah->config.ant_ctrl_comm2g_switch_enable =0x000BBB88 ; sc->ant_comb.low_rssi_thresh =20 ; sc->ant_comb.fast_div_bias =3 ;
Signature · 1 line
1.8.3.4
PATCH 11/11 ath9k: Support ANT diversity for WB225
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
WB225 based cards like CUS198 and CUS230 support both fast antenna diversity and LNA combining. Add support for this and also program the SWCOM register with the correct "ant_ctrl_comm2g_switch_enable" value.
--- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 5 +- drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 2 + drivers/net/wireless/ath/ath9k/ar9003_phy.c | 120 +++++++++++++++++-------- 3 files changed, 86 insertions(+), 41 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +2 -3
@@ -3541,13 +3541,12 @@ static u16 ar9003_switch_com_spdt_get(struct ath_hw *ah, bool is2ghz)return le16_to_cpu (ar9003_modal_header (ah, is2ghz)->switchcomspdt); } - -static u32 ar9003_hw_ant_ctrl_common_get (struct ath_hw *ah,bool is2ghz) +u32 ar9003_hw_ant_ctrl_common_get (struct ath_hw *ah,bool is2ghz) {return le32_to_cpu (ar9003_modal_header (ah, is2ghz)->antCtrlCommon); } -static u32 ar9003_hw_ant_ctrl_common_2_get (struct ath_hw *ah,bool is2ghz) +u32 ar9003_hw_ant_ctrl_common_2_get (struct ath_hw *ah,bool is2ghz) {return le32_to_cpu (ar9003_modal_header (ah, is2ghz)->antCtrlCommon2); }
drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +2 -0
@@ -334,6 +334,8 @@ struct ar9300_eeprom {s32 ar9003_hw_get_tx_gain_idx (struct ath_hw *ah);s32 ar9003_hw_get_rx_gain_idx (struct ath_hw *ah); +u32 ar9003_hw_ant_ctrl_common_get (struct ath_hw *ah,bool is2ghz); +u32 ar9003_hw_ant_ctrl_common_2_get (struct ath_hw *ah,bool is2ghz);u8 *ar9003_get_spur_chan_ptr (struct ath_hw *ah,bool is_2ghz);
drivers/net/wireless/ath/ath9k/ar9003_phy.c +82 -38
140 lines not on this page · raw message
Signature · 1 line
1.8.3.4