diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2014-08-04 02:18:33 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2014-08-12 03:42:24 -0400 |
commit | cff990ce7ddd6a43f86757867399a8a64aa29af9 (patch) | |
tree | 35ad2395674acefba4e6822a0773a9219c1cf8af /drivers/net/wireless/ath/ath10k/debug.c | |
parent | 17dc0b8068f9f01c56b0ade5c36b4c45a3339dda (diff) |
ath10k: fix wmi service bitmap debug
The 10.x and main firmware branches have
conflicting WMI service bitmap definitions.
This also fixes WMI services parsing on big-endian
hosts and changes debugfs output to be more human
friendly.
kvalo: remove braces and the last semicolon from SVCSTR()
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/debug.c')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/debug.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index c9e35c87edfb..df1abe7f1fef 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c | |||
@@ -115,9 +115,10 @@ static ssize_t ath10k_read_wmi_services(struct file *file, | |||
115 | { | 115 | { |
116 | struct ath10k *ar = file->private_data; | 116 | struct ath10k *ar = file->private_data; |
117 | char *buf; | 117 | char *buf; |
118 | unsigned int len = 0, buf_len = 1500; | 118 | unsigned int len = 0, buf_len = 4096; |
119 | const char *status; | 119 | const char *name; |
120 | ssize_t ret_cnt; | 120 | ssize_t ret_cnt; |
121 | bool enabled; | ||
121 | int i; | 122 | int i; |
122 | 123 | ||
123 | buf = kzalloc(buf_len, GFP_KERNEL); | 124 | buf = kzalloc(buf_len, GFP_KERNEL); |
@@ -129,15 +130,22 @@ static ssize_t ath10k_read_wmi_services(struct file *file, | |||
129 | if (len > buf_len) | 130 | if (len > buf_len) |
130 | len = buf_len; | 131 | len = buf_len; |
131 | 132 | ||
132 | for (i = 0; i < WMI_SERVICE_LAST; i++) { | 133 | for (i = 0; i < WMI_MAX_SERVICE; i++) { |
133 | if (WMI_SERVICE_IS_ENABLED(ar->debug.wmi_service_bitmap, i)) | 134 | enabled = test_bit(i, ar->debug.wmi_service_bitmap); |
134 | status = "enabled"; | 135 | name = wmi_service_name(i); |
135 | else | 136 | |
136 | status = "disabled"; | 137 | if (!name) { |
138 | if (enabled) | ||
139 | len += scnprintf(buf + len, buf_len - len, | ||
140 | "%-40s %s (bit %d)\n", | ||
141 | "unknown", "enabled", i); | ||
142 | |||
143 | continue; | ||
144 | } | ||
137 | 145 | ||
138 | len += scnprintf(buf + len, buf_len - len, | 146 | len += scnprintf(buf + len, buf_len - len, |
139 | "0x%02x - %20s - %s\n", | 147 | "%-40s %s\n", |
140 | i, wmi_service_name(i), status); | 148 | name, enabled ? "enabled" : "-"); |
141 | } | 149 | } |
142 | 150 | ||
143 | ret_cnt = simple_read_from_buffer(user_buf, count, ppos, buf, len); | 151 | ret_cnt = simple_read_from_buffer(user_buf, count, ppos, buf, len); |