diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/wireless/ath/ath.h | 1 | ||||
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/antenna.c | 4 | ||||
| -rw-r--r-- | drivers/net/wireless/ath/ath9k/init.c | 12 |
3 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h index 6169fbd23ed1..4521342c62cc 100644 --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h | |||
| @@ -159,6 +159,7 @@ struct ath_common { | |||
| 159 | 159 | ||
| 160 | bool btcoex_enabled; | 160 | bool btcoex_enabled; |
| 161 | bool disable_ani; | 161 | bool disable_ani; |
| 162 | bool antenna_diversity; | ||
| 162 | }; | 163 | }; |
| 163 | 164 | ||
| 164 | struct sk_buff *ath_rxbuf_alloc(struct ath_common *common, | 165 | struct sk_buff *ath_rxbuf_alloc(struct ath_common *common, |
diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c index 8eb274f16861..664844c5d3d5 100644 --- a/drivers/net/wireless/ath/ath9k/antenna.c +++ b/drivers/net/wireless/ath/ath9k/antenna.c | |||
| @@ -776,6 +776,7 @@ div_comb_done: | |||
| 776 | void ath_ant_comb_update(struct ath_softc *sc) | 776 | void ath_ant_comb_update(struct ath_softc *sc) |
| 777 | { | 777 | { |
| 778 | struct ath_hw *ah = sc->sc_ah; | 778 | struct ath_hw *ah = sc->sc_ah; |
| 779 | struct ath_common *common = ath9k_hw_common(ah); | ||
| 779 | struct ath_hw_antcomb_conf div_ant_conf; | 780 | struct ath_hw_antcomb_conf div_ant_conf; |
| 780 | u8 lna_conf; | 781 | u8 lna_conf; |
| 781 | 782 | ||
| @@ -790,4 +791,7 @@ void ath_ant_comb_update(struct ath_softc *sc) | |||
| 790 | div_ant_conf.alt_lna_conf = lna_conf; | 791 | div_ant_conf.alt_lna_conf = lna_conf; |
| 791 | 792 | ||
| 792 | ath9k_hw_antdiv_comb_conf_set(ah, &div_ant_conf); | 793 | ath9k_hw_antdiv_comb_conf_set(ah, &div_ant_conf); |
| 794 | |||
| 795 | if (common->antenna_diversity) | ||
| 796 | ath9k_hw_antctrl_shared_chain_lnadiv(ah, true); | ||
| 793 | } | 797 | } |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 706255222598..fad3ccd5cd91 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
| @@ -46,6 +46,10 @@ static int ath9k_btcoex_enable; | |||
| 46 | module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); | 46 | module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); |
| 47 | MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence"); | 47 | MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence"); |
| 48 | 48 | ||
| 49 | static int ath9k_enable_diversity; | ||
| 50 | module_param_named(enable_diversity, ath9k_enable_diversity, int, 0444); | ||
| 51 | MODULE_PARM_DESC(enable_diversity, "Enable Antenna diversity for AR9565"); | ||
| 52 | |||
| 49 | bool is_ath9k_unloaded; | 53 | bool is_ath9k_unloaded; |
| 50 | /* We use the hw_value as an index into our private channel structure */ | 54 | /* We use the hw_value as an index into our private channel structure */ |
| 51 | 55 | ||
| @@ -546,6 +550,14 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, | |||
| 546 | common->debug_mask = ath9k_debug; | 550 | common->debug_mask = ath9k_debug; |
| 547 | common->btcoex_enabled = ath9k_btcoex_enable == 1; | 551 | common->btcoex_enabled = ath9k_btcoex_enable == 1; |
| 548 | common->disable_ani = false; | 552 | common->disable_ani = false; |
| 553 | |||
| 554 | /* | ||
| 555 | * Enable Antenna diversity only when BTCOEX is disabled | ||
| 556 | * and the user manually requests the feature. | ||
| 557 | */ | ||
| 558 | if (!common->btcoex_enabled && ath9k_enable_diversity) | ||
| 559 | common->antenna_diversity = 1; | ||
| 560 | |||
| 549 | spin_lock_init(&common->cc_lock); | 561 | spin_lock_init(&common->cc_lock); |
| 550 | 562 | ||
| 551 | spin_lock_init(&sc->sc_serial_rw); | 563 | spin_lock_init(&sc->sc_serial_rw); |
