wil6210: move vring_idle_trsh definition to wil6210_priv
authorGidon Studinski <qca_gidons@qca.qualcomm.com>
Tue, 8 Aug 2017 11:16:50 +0000 (14:16 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 8 Aug 2017 18:44:25 +0000 (21:44 +0300)
vring_idle_trsh is used in the operational driver, hence
should not be defined as a debugfs variable.

Signed-off-by: Gidon Studinski <qca_gidons@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/wil6210/debugfs.c
drivers/net/wireless/ath/wil6210/main.c
drivers/net/wireless/ath/wil6210/txrx.c
drivers/net/wireless/ath/wil6210/wil6210.h

index d4e88652fcc6a5071e9287e8b5e55023d9b1344b..6db00c167d2e16f6ac63ad350864f3b2505f395f 100644 (file)
@@ -20,7 +20,6 @@
 #include <linux/pci.h>
 #include <linux/rtnetlink.h>
 #include <linux/power_supply.h>
-
 #include "wil6210.h"
 #include "wmi.h"
 #include "txrx.h"
@@ -30,7 +29,6 @@
 static u32 mem_addr;
 static u32 dbg_txdesc_index;
 static u32 dbg_vring_index; /* 24+ for Rx, 0..23 for Tx */
-u32 vring_idle_trsh = 16; /* HW fetches up to 16 descriptors at once */
 
 enum dbg_off_type {
        doff_u32 = 0,
@@ -1763,6 +1761,7 @@ static const struct dbg_off dbg_wil_off[] = {
        WIL_FIELD(chip_revision, 0444,  doff_u8),
        WIL_FIELD(abft_len, 0644,               doff_u8),
        WIL_FIELD(wakeup_trigger, 0644,         doff_u8),
+       WIL_FIELD(vring_idle_trsh, 0644,        doff_u32),
        {},
 };
 
@@ -1778,8 +1777,6 @@ static const struct dbg_off dbg_statics[] = {
        {"desc_index",  0644, (ulong)&dbg_txdesc_index, doff_u32},
        {"vring_index", 0644, (ulong)&dbg_vring_index, doff_u32},
        {"mem_addr",    0644, (ulong)&mem_addr, doff_u32},
-       {"vring_idle_trsh", 0644, (ulong)&vring_idle_trsh,
-        doff_u32},
        {"led_polarity", 0644, (ulong)&led_polarity, doff_u8},
        {},
 };
index b89d017ec84785b0b30ff59a28fb069f77af6b1a..e2ea49077b78b06329d8979afb29209011e67ca9 100644 (file)
@@ -581,6 +581,7 @@ int wil_priv_init(struct wil6210_priv *wil)
                              WMI_WAKEUP_TRIGGER_BCAST;
        memset(&wil->suspend_stats, 0, sizeof(wil->suspend_stats));
        wil->suspend_stats.min_suspend_time = ULONG_MAX;
+       wil->vring_idle_trsh = 16;
 
        return 0;
 
index ec57bcce9601f79e4ca5f02398ed3e54d9c4db0f..389c718cd257f4c1f50e865ccf684f1c051eeef8 100644 (file)
@@ -1666,7 +1666,7 @@ static int __wil_tx_vring_tso(struct wil6210_priv *wil, struct vring *vring,
 
        /* performance monitoring */
        used = wil_vring_used_tx(vring);
-       if (wil_val_in_range(vring_idle_trsh,
+       if (wil_val_in_range(wil->vring_idle_trsh,
                             used, used + descs_used)) {
                txdata->idle += get_cycles() - txdata->last_idle;
                wil_dbg_txrx(wil,  "Ring[%2d] not idle %d -> %d\n",
@@ -1813,7 +1813,7 @@ static int __wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
 
        /* performance monitoring */
        used = wil_vring_used_tx(vring);
-       if (wil_val_in_range(vring_idle_trsh,
+       if (wil_val_in_range(wil->vring_idle_trsh,
                             used, used + nr_frags + 1)) {
                txdata->idle += get_cycles() - txdata->last_idle;
                wil_dbg_txrx(wil,  "Ring[%2d] not idle %d -> %d\n",
@@ -2175,7 +2175,7 @@ int wil_tx_complete(struct wil6210_priv *wil, int ringid)
 
        /* performance monitoring */
        used_new = wil_vring_used_tx(vring);
-       if (wil_val_in_range(vring_idle_trsh,
+       if (wil_val_in_range(wil->vring_idle_trsh,
                             used_new, used_before_complete)) {
                wil_dbg_txrx(wil, "Ring[%2d] idle %d -> %d\n",
                             ringid, used_before_complete, used_new);
index 78a9c9f8fc8f91b14ca59a1a1b06a48130fa4f6d..73dbd62dfed7c34a192c28e2e407d08b39da7146 100644 (file)
@@ -30,7 +30,6 @@ extern bool no_fw_recovery;
 extern unsigned int mtu_max;
 extern unsigned short rx_ring_overflow_thrsh;
 extern int agg_wsize;
-extern u32 vring_idle_trsh;
 extern bool rx_align_2;
 extern bool rx_large_buf;
 extern bool debug_fw;
@@ -693,6 +692,7 @@ struct wil6210_priv {
        u8 vring2cid_tid[WIL6210_MAX_TX_RINGS][2]; /* [0] - CID, [1] - TID */
        struct wil_sta_info sta[WIL6210_MAX_CID];
        int bcast_vring;
+       u32 vring_idle_trsh; /* HW fetches up to 16 descriptors at once  */
        bool use_extended_dma_addr; /* indicates whether we are using 48 bits */
        /* scan */
        struct cfg80211_scan_request *scan_request;