diff options
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/debugfs.c')
-rw-r--r-- | drivers/net/wireless/ath/wil6210/debugfs.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c index eb6de8cbdd7a..fd5975153386 100644 --- a/drivers/net/wireless/ath/wil6210/debugfs.c +++ b/drivers/net/wireless/ath/wil6210/debugfs.c | |||
@@ -103,23 +103,30 @@ static int wil_vring_debugfs_show(struct seq_file *s, void *data) | |||
103 | % vring->size; | 103 | % vring->size; |
104 | int avail = vring->size - used - 1; | 104 | int avail = vring->size - used - 1; |
105 | char name[10]; | 105 | char name[10]; |
106 | char sidle[10]; | ||
106 | /* performance monitoring */ | 107 | /* performance monitoring */ |
107 | cycles_t now = get_cycles(); | 108 | cycles_t now = get_cycles(); |
108 | uint64_t idle = txdata->idle * 100; | 109 | uint64_t idle = txdata->idle * 100; |
109 | uint64_t total = now - txdata->begin; | 110 | uint64_t total = now - txdata->begin; |
110 | 111 | ||
111 | do_div(idle, total); | 112 | if (total != 0) { |
113 | do_div(idle, total); | ||
114 | snprintf(sidle, sizeof(sidle), "%3d%%", | ||
115 | (int)idle); | ||
116 | } else { | ||
117 | snprintf(sidle, sizeof(sidle), "N/A"); | ||
118 | } | ||
112 | txdata->begin = now; | 119 | txdata->begin = now; |
113 | txdata->idle = 0ULL; | 120 | txdata->idle = 0ULL; |
114 | 121 | ||
115 | snprintf(name, sizeof(name), "tx_%2d", i); | 122 | snprintf(name, sizeof(name), "tx_%2d", i); |
116 | 123 | ||
117 | seq_printf(s, | 124 | seq_printf(s, |
118 | "\n%pM CID %d TID %d BACK([%d] %d TU A%s) [%3d|%3d] idle %3d%%\n", | 125 | "\n%pM CID %d TID %d BACK([%d] %d TU A%s) [%3d|%3d] idle %s\n", |
119 | wil->sta[cid].addr, cid, tid, | 126 | wil->sta[cid].addr, cid, tid, |
120 | txdata->agg_wsize, txdata->agg_timeout, | 127 | txdata->agg_wsize, txdata->agg_timeout, |
121 | txdata->agg_amsdu ? "+" : "-", | 128 | txdata->agg_amsdu ? "+" : "-", |
122 | used, avail, (int)idle); | 129 | used, avail, sidle); |
123 | 130 | ||
124 | wil_print_vring(s, wil, name, vring, '_', 'H'); | 131 | wil_print_vring(s, wil, name, vring, '_', 'H'); |
125 | } | 132 | } |