aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2013-08-04 04:51:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-08-05 14:52:42 -0400
commit6308130542e2ad913b678436c8f7b833e1420d65 (patch)
tree58b4f8ecf741f5c78457a376520e974c1eb1b692 /drivers/net/wireless/ath/ath9k
parent3afa6b4f54181e88814680e71b2f12fae64057f4 (diff)
ath9k: Cleanup WLAN/BT RX diversity
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. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r--drivers/net/wireless/ath/ath9k/antenna.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c38
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c12
3 files changed, 25 insertions, 27 deletions
diff --git a/drivers/net/wireless/ath/ath9k/antenna.c b/drivers/net/wireless/ath/ath9k/antenna.c
index 8de314cd4aed..354dc668205e 100644
--- a/drivers/net/wireless/ath/ath9k/antenna.c
+++ b/drivers/net/wireless/ath/ath9k/antenna.c
@@ -887,6 +887,6 @@ void ath_ant_comb_update(struct ath_softc *sc)
887 887
888 ath9k_hw_antdiv_comb_conf_set(ah, &div_ant_conf); 888 ath9k_hw_antdiv_comb_conf_set(ah, &div_ant_conf);
889 889
890 if (common->antenna_diversity) 890 if (common->bt_ant_diversity)
891 ath9k_hw_antctrl_shared_chain_lnadiv(ah, true); 891 ath9k_hw_antctrl_shared_chain_lnadiv(ah, true);
892} 892}
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index e744d9747697..881ca6cb47db 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -270,25 +270,26 @@ static const struct file_operations fops_ani = {
270 .llseek = default_llseek, 270 .llseek = default_llseek,
271}; 271};
272 272
273static ssize_t read_file_ant_diversity(struct file *file, char __user *user_buf, 273static ssize_t read_file_bt_ant_diversity(struct file *file,
274 size_t count, loff_t *ppos) 274 char __user *user_buf,
275 size_t count, loff_t *ppos)
275{ 276{
276 struct ath_softc *sc = file->private_data; 277 struct ath_softc *sc = file->private_data;
277 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 278 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
278 char buf[32]; 279 char buf[32];
279 unsigned int len; 280 unsigned int len;
280 281
281 len = sprintf(buf, "%d\n", common->antenna_diversity); 282 len = sprintf(buf, "%d\n", common->bt_ant_diversity);
282 return simple_read_from_buffer(user_buf, count, ppos, buf, len); 283 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
283} 284}
284 285
285static ssize_t write_file_ant_diversity(struct file *file, 286static ssize_t write_file_bt_ant_diversity(struct file *file,
286 const char __user *user_buf, 287 const char __user *user_buf,
287 size_t count, loff_t *ppos) 288 size_t count, loff_t *ppos)
288{ 289{
289 struct ath_softc *sc = file->private_data; 290 struct ath_softc *sc = file->private_data;
290 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 291 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
291 unsigned long antenna_diversity; 292 unsigned long bt_ant_diversity;
292 char buf[32]; 293 char buf[32];
293 ssize_t len; 294 ssize_t len;
294 295
@@ -296,26 +297,23 @@ static ssize_t write_file_ant_diversity(struct file *file,
296 if (copy_from_user(buf, user_buf, len)) 297 if (copy_from_user(buf, user_buf, len))
297 return -EFAULT; 298 return -EFAULT;
298 299
299 if (!AR_SREV_9565(sc->sc_ah))
300 goto exit;
301
302 buf[len] = '\0'; 300 buf[len] = '\0';
303 if (kstrtoul(buf, 0, &antenna_diversity)) 301 if (kstrtoul(buf, 0, &bt_ant_diversity))
304 return -EINVAL; 302 return -EINVAL;
305 303
306 common->antenna_diversity = !!antenna_diversity; 304 common->bt_ant_diversity = !!bt_ant_diversity;
307 ath9k_ps_wakeup(sc); 305 ath9k_ps_wakeup(sc);
308 ath_ant_comb_update(sc); 306 ath_ant_comb_update(sc);
309 ath_dbg(common, CONFIG, "Antenna diversity: %d\n", 307 ath_dbg(common, CONFIG, "Enable WLAN/BT RX Antenna diversity: %d\n",
310 common->antenna_diversity); 308 common->bt_ant_diversity);
311 ath9k_ps_restore(sc); 309 ath9k_ps_restore(sc);
312exit: 310
313 return count; 311 return count;
314} 312}
315 313
316static const struct file_operations fops_ant_diversity = { 314static const struct file_operations fops_bt_ant_diversity = {
317 .read = read_file_ant_diversity, 315 .read = read_file_bt_ant_diversity,
318 .write = write_file_ant_diversity, 316 .write = write_file_bt_ant_diversity,
319 .open = simple_open, 317 .open = simple_open,
320 .owner = THIS_MODULE, 318 .owner = THIS_MODULE,
321 .llseek = default_llseek, 319 .llseek = default_llseek,
@@ -1933,8 +1931,8 @@ int ath9k_init_debug(struct ath_hw *ah)
1933 sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask); 1931 sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask);
1934 debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR, 1932 debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR,
1935 sc->debug.debugfs_phy, &sc->sc_ah->gpio_val); 1933 sc->debug.debugfs_phy, &sc->sc_ah->gpio_val);
1936 debugfs_create_file("diversity", S_IRUSR | S_IWUSR, 1934 debugfs_create_file("bt_ant_diversity", S_IRUSR | S_IWUSR,
1937 sc->debug.debugfs_phy, sc, &fops_ant_diversity); 1935 sc->debug.debugfs_phy, sc, &fops_bt_ant_diversity);
1938 debugfs_create_file("antenna_diversity", S_IRUSR, 1936 debugfs_create_file("antenna_diversity", S_IRUSR,
1939 sc->debug.debugfs_phy, sc, &fops_antenna_diversity); 1937 sc->debug.debugfs_phy, sc, &fops_antenna_diversity);
1940#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT 1938#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 7ded9d607db0..5e81b2c24342 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -53,9 +53,9 @@ static int ath9k_btcoex_enable;
53module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444); 53module_param_named(btcoex_enable, ath9k_btcoex_enable, int, 0444);
54MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence"); 54MODULE_PARM_DESC(btcoex_enable, "Enable wifi-BT coexistence");
55 55
56static int ath9k_enable_diversity; 56static int ath9k_bt_ant_diversity;
57module_param_named(enable_diversity, ath9k_enable_diversity, int, 0444); 57module_param_named(bt_ant_diversity, ath9k_bt_ant_diversity, int, 0444);
58MODULE_PARM_DESC(enable_diversity, "Enable Antenna diversity for AR9565"); 58MODULE_PARM_DESC(bt_ant_diversity, "Enable WLAN/BT RX antenna diversity");
59 59
60bool is_ath9k_unloaded; 60bool is_ath9k_unloaded;
61/* We use the hw_value as an index into our private channel structure */ 61/* 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,
633 ath9k_init_platform(sc); 633 ath9k_init_platform(sc);
634 634
635 /* 635 /*
636 * Enable Antenna diversity only when BTCOEX is disabled 636 * Enable WLAN/BT RX Antenna diversity only when BTCOEX is enabled
637 * and the user manually requests the feature. 637 * and the user manually requests the feature.
638 */ 638 */
639 if (!common->btcoex_enabled && ath9k_enable_diversity) 639 if (common->btcoex_enabled && ath9k_bt_ant_diversity)
640 common->antenna_diversity = 1; 640 common->bt_ant_diversity = 1;
641 641
642 spin_lock_init(&common->cc_lock); 642 spin_lock_init(&common->cc_lock);
643 643