ath10k: move pktlog_filter out of ath10k_debug
authorAnilkumar Kolli <akolli@qti.qualcomm.com>
Tue, 5 Dec 2017 13:31:24 +0000 (19:01 +0530)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 14 Dec 2017 15:26:34 +0000 (17:26 +0200)
Move pktlog_filter from struct ath10k_debug to struct ath10k
so that pktlog can be enabled even when debugfs is not
enabled, needed to enable peer tx stats for 10.2.4.

No changes in functionality.

Signed-off-by: Anilkumar Kolli <akolli@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/debug.c

index 71f8e0f0fa90c059324a07cb5b9f363b473bd32e..efd9eab5c1395181d96ba42520351b13db8af5cf 100644 (file)
@@ -487,7 +487,6 @@ struct ath10k_debug {
        /* protected by conf_mutex */
        u64 fw_dbglog_mask;
        u32 fw_dbglog_level;
-       u32 pktlog_filter;
        u32 reg_addr;
        u32 nf_cal_period;
        void *cal_data;
@@ -962,6 +961,7 @@ struct ath10k {
        } spectral;
 #endif
 
+       u32 pktlog_filter;
        struct {
                /* protected by conf_mutex */
                struct ath10k_fw_components utf_mode_fw;
index 66498e3c0f915e9408f740c0d2a949179a2689fd..181fd8e2e61583cf0d788fb6c6f14c68eb7dffe1 100644 (file)
@@ -1950,14 +1950,14 @@ int ath10k_debug_start(struct ath10k *ar)
                                    ret);
        }
 
-       if (ar->debug.pktlog_filter) {
+       if (ar->pktlog_filter) {
                ret = ath10k_wmi_pdev_pktlog_enable(ar,
-                                                   ar->debug.pktlog_filter);
+                                                   ar->pktlog_filter);
                if (ret)
                        /* not serious */
                        ath10k_warn(ar,
                                    "failed to enable pktlog filter %x: %d\n",
-                                   ar->debug.pktlog_filter, ret);
+                                   ar->pktlog_filter, ret);
        } else {
                ret = ath10k_wmi_pdev_pktlog_disable(ar);
                if (ret)
@@ -2097,12 +2097,12 @@ static ssize_t ath10k_write_pktlog_filter(struct file *file,
        mutex_lock(&ar->conf_mutex);
 
        if (ar->state != ATH10K_STATE_ON) {
-               ar->debug.pktlog_filter = filter;
+               ar->pktlog_filter = filter;
                ret = count;
                goto out;
        }
 
-       if (filter == ar->debug.pktlog_filter) {
+       if (filter == ar->pktlog_filter) {
                ret = count;
                goto out;
        }
@@ -2111,7 +2111,7 @@ static ssize_t ath10k_write_pktlog_filter(struct file *file,
                ret = ath10k_wmi_pdev_pktlog_enable(ar, filter);
                if (ret) {
                        ath10k_warn(ar, "failed to enable pktlog filter %x: %d\n",
-                                   ar->debug.pktlog_filter, ret);
+                                   ar->pktlog_filter, ret);
                        goto out;
                }
        } else {
@@ -2122,7 +2122,7 @@ static ssize_t ath10k_write_pktlog_filter(struct file *file,
                }
        }
 
-       ar->debug.pktlog_filter = filter;
+       ar->pktlog_filter = filter;
        ret = count;
 
 out:
@@ -2139,7 +2139,7 @@ static ssize_t ath10k_read_pktlog_filter(struct file *file, char __user *ubuf,
 
        mutex_lock(&ar->conf_mutex);
        len = scnprintf(buf, sizeof(buf) - len, "%08x\n",
-                       ar->debug.pktlog_filter);
+                       ar->pktlog_filter);
        mutex_unlock(&ar->conf_mutex);
 
        return simple_read_from_buffer(ubuf, count, ppos, buf, len);