summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/debug.c
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2013-08-04 14:21:56 +0530
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)
downloadop-kernel-dev-3f2da95517029d88365a074ef81a928a99871964.zip
op-kernel-dev-3f2da95517029d88365a074ef81a928a99871964.tar.gz
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 881ca6c..daa316b 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,
{
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;
}
OpenPOWER on IntegriCloud