aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/debug.c
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2013-08-04 04:51:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-08-05 14:52:42 -0400
commit3f2da95517029d88365a074ef81a928a99871964 (patch)
tree6b0d6e9949ddfbf44842628fa91a6fc7c15dd17d /drivers/net/wireless/ath/ath9k/debug.c
parent6308130542e2ad913b678436c8f7b833e1420d65 (diff)
ath9k: Add a HW capability for WLAN/BT RX diversity
Make use of this capability to restrict the usage of the debugfs file and modparam using which this feature can be enabled. 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/debug.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 881ca6cb47db..daa316bf47b3 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -289,6 +289,7 @@ static ssize_t write_file_bt_ant_diversity(struct file *file,
289{ 289{
290 struct ath_softc *sc = file->private_data; 290 struct ath_softc *sc = file->private_data;
291 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 291 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
292 struct ath9k_hw_capabilities *pCap = &sc->sc_ah->caps;
292 unsigned long bt_ant_diversity; 293 unsigned long bt_ant_diversity;
293 char buf[32]; 294 char buf[32];
294 ssize_t len; 295 ssize_t len;
@@ -297,6 +298,9 @@ static ssize_t write_file_bt_ant_diversity(struct file *file,
297 if (copy_from_user(buf, user_buf, len)) 298 if (copy_from_user(buf, user_buf, len))
298 return -EFAULT; 299 return -EFAULT;
299 300
301 if (!(pCap->hw_caps & ATH9K_HW_CAP_BT_ANT_DIV))
302 goto exit;
303
300 buf[len] = '\0'; 304 buf[len] = '\0';
301 if (kstrtoul(buf, 0, &bt_ant_diversity)) 305 if (kstrtoul(buf, 0, &bt_ant_diversity))
302 return -EINVAL; 306 return -EINVAL;
@@ -307,7 +311,7 @@ static ssize_t write_file_bt_ant_diversity(struct file *file,
307 ath_dbg(common, CONFIG, "Enable WLAN/BT RX Antenna diversity: %d\n", 311 ath_dbg(common, CONFIG, "Enable WLAN/BT RX Antenna diversity: %d\n",
308 common->bt_ant_diversity); 312 common->bt_ant_diversity);
309 ath9k_ps_restore(sc); 313 ath9k_ps_restore(sc);
310 314exit:
311 return count; 315 return count;
312} 316}
313 317