diff options
author | Sujith Manoharan <Sujith.Manoharan@atheros.com> | 2011-04-13 01:56:31 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-13 15:24:27 -0400 |
commit | c4d04186c7023d54445b695da226b3e98e0a55f9 (patch) | |
tree | 97b4570d35adb7c37dcab41826cc9b3365d75942 /drivers/net/wireless/ath | |
parent | 01f684de7cc0641a9ee968f2d2c45c3a67241252 (diff) |
ath9k_htc: Add a debugfs file showing endpoint status
Location: ath9k_htc/phy#/queue
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 54 |
2 files changed, 55 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index b9c7bec9dd45..b40753ca6706 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h | |||
@@ -339,6 +339,7 @@ struct ath9k_debug { | |||
339 | struct dentry *debugfs_xmit; | 339 | struct dentry *debugfs_xmit; |
340 | struct dentry *debugfs_recv; | 340 | struct dentry *debugfs_recv; |
341 | struct dentry *debugfs_slot; | 341 | struct dentry *debugfs_slot; |
342 | struct dentry *debugfs_queue; | ||
342 | struct ath_tx_stats tx_stats; | 343 | struct ath_tx_stats tx_stats; |
343 | struct ath_rx_stats rx_stats; | 344 | struct ath_rx_stats rx_stats; |
344 | u32 txrate; | 345 | u32 txrate; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c index 119cc544cea0..961bec20d140 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c | |||
@@ -279,6 +279,53 @@ static const struct file_operations fops_slot = { | |||
279 | .llseek = default_llseek, | 279 | .llseek = default_llseek, |
280 | }; | 280 | }; |
281 | 281 | ||
282 | static ssize_t read_file_queue(struct file *file, char __user *user_buf, | ||
283 | size_t count, loff_t *ppos) | ||
284 | { | ||
285 | struct ath9k_htc_priv *priv = file->private_data; | ||
286 | char buf[512]; | ||
287 | unsigned int len = 0; | ||
288 | |||
289 | len += snprintf(buf + len, sizeof(buf) - len, "%16s : %3d\n", | ||
290 | "Mgmt endpoint", skb_queue_len(&priv->tx.mgmt_ep_queue)); | ||
291 | |||
292 | len += snprintf(buf + len, sizeof(buf) - len, "%16s : %3d\n", | ||
293 | "Cab endpoint", skb_queue_len(&priv->tx.cab_ep_queue)); | ||
294 | |||
295 | len += snprintf(buf + len, sizeof(buf) - len, "%16s : %3d\n", | ||
296 | "Data BE endpoint", skb_queue_len(&priv->tx.data_be_queue)); | ||
297 | |||
298 | len += snprintf(buf + len, sizeof(buf) - len, "%16s : %3d\n", | ||
299 | "Data BK endpoint", skb_queue_len(&priv->tx.data_bk_queue)); | ||
300 | |||
301 | len += snprintf(buf + len, sizeof(buf) - len, "%16s : %3d\n", | ||
302 | "Data VI endpoint", skb_queue_len(&priv->tx.data_vi_queue)); | ||
303 | |||
304 | len += snprintf(buf + len, sizeof(buf) - len, "%16s : %3d\n", | ||
305 | "Data VO endpoint", skb_queue_len(&priv->tx.data_vo_queue)); | ||
306 | |||
307 | len += snprintf(buf + len, sizeof(buf) - len, "%16s : %3d\n", | ||
308 | "Failed queue", skb_queue_len(&priv->tx.tx_failed)); | ||
309 | |||
310 | spin_lock_bh(&priv->tx.tx_lock); | ||
311 | len += snprintf(buf + len, sizeof(buf) - len, "%16s : %3d\n", | ||
312 | "Queued count", priv->tx.queued_cnt); | ||
313 | spin_unlock_bh(&priv->tx.tx_lock); | ||
314 | |||
315 | if (len > sizeof(buf)) | ||
316 | len = sizeof(buf); | ||
317 | |||
318 | return simple_read_from_buffer(user_buf, count, ppos, buf, len); | ||
319 | |||
320 | } | ||
321 | |||
322 | static const struct file_operations fops_queue = { | ||
323 | .read = read_file_queue, | ||
324 | .open = ath9k_debugfs_open, | ||
325 | .owner = THIS_MODULE, | ||
326 | .llseek = default_llseek, | ||
327 | }; | ||
328 | |||
282 | int ath9k_htc_init_debug(struct ath_hw *ah) | 329 | int ath9k_htc_init_debug(struct ath_hw *ah) |
283 | { | 330 | { |
284 | struct ath_common *common = ath9k_hw_common(ah); | 331 | struct ath_common *common = ath9k_hw_common(ah); |
@@ -317,6 +364,12 @@ int ath9k_htc_init_debug(struct ath_hw *ah) | |||
317 | if (!priv->debug.debugfs_slot) | 364 | if (!priv->debug.debugfs_slot) |
318 | goto err; | 365 | goto err; |
319 | 366 | ||
367 | priv->debug.debugfs_queue = debugfs_create_file("queue", S_IRUSR, | ||
368 | priv->debug.debugfs_phy, | ||
369 | priv, &fops_queue); | ||
370 | if (!priv->debug.debugfs_queue) | ||
371 | goto err; | ||
372 | |||
320 | return 0; | 373 | return 0; |
321 | 374 | ||
322 | err: | 375 | err: |
@@ -329,6 +382,7 @@ void ath9k_htc_exit_debug(struct ath_hw *ah) | |||
329 | struct ath_common *common = ath9k_hw_common(ah); | 382 | struct ath_common *common = ath9k_hw_common(ah); |
330 | struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; | 383 | struct ath9k_htc_priv *priv = (struct ath9k_htc_priv *) common->priv; |
331 | 384 | ||
385 | debugfs_remove(priv->debug.debugfs_queue); | ||
332 | debugfs_remove(priv->debug.debugfs_slot); | 386 | debugfs_remove(priv->debug.debugfs_slot); |
333 | debugfs_remove(priv->debug.debugfs_recv); | 387 | debugfs_remove(priv->debug.debugfs_recv); |
334 | debugfs_remove(priv->debug.debugfs_xmit); | 388 | debugfs_remove(priv->debug.debugfs_xmit); |