aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLior David <liord@codeaurora.org>2018-02-26 13:12:18 -0500
committerKalle Valo <kvalo@codeaurora.org>2018-02-27 11:50:54 -0500
commit3a3b745f1eaeb5c9f876bcc7849f6e35fbc87397 (patch)
tree83aaba5a45ac181a447e2d7ea82afff3c24173f9
parent5bd6098252104f1007882805e9d7c36924ff6a81 (diff)
wil6210: add debugfs 'mids' file
Added a new debugfs file 'mids' to print the list of virtual interfaces by MAC ID (MID). Allows mapping between the internal MID used by FW and the actual network interface used by the VIF. This is needed by debugging tools. Signed-off-by: Lior David <liord@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
-rw-r--r--drivers/net/wireless/ath/wil6210/debugfs.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index 93a99a1c8c92..8c90b3111f0b 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -1495,6 +1495,42 @@ static const struct file_operations fops_sta = {
1495 .llseek = seq_lseek, 1495 .llseek = seq_lseek,
1496}; 1496};
1497 1497
1498static int wil_mids_debugfs_show(struct seq_file *s, void *data)
1499{
1500 struct wil6210_priv *wil = s->private;
1501 struct wil6210_vif *vif;
1502 struct net_device *ndev;
1503 int i;
1504
1505 mutex_lock(&wil->vif_mutex);
1506 for (i = 0; i < wil->max_vifs; i++) {
1507 vif = wil->vifs[i];
1508
1509 if (vif) {
1510 ndev = vif_to_ndev(vif);
1511 seq_printf(s, "[%d] %pM %s\n", i, ndev->dev_addr,
1512 ndev->name);
1513 } else {
1514 seq_printf(s, "[%d] unused\n", i);
1515 }
1516 }
1517 mutex_unlock(&wil->vif_mutex);
1518
1519 return 0;
1520}
1521
1522static int wil_mids_seq_open(struct inode *inode, struct file *file)
1523{
1524 return single_open(file, wil_mids_debugfs_show, inode->i_private);
1525}
1526
1527static const struct file_operations fops_mids = {
1528 .open = wil_mids_seq_open,
1529 .release = single_release,
1530 .read = seq_read,
1531 .llseek = seq_lseek,
1532};
1533
1498static ssize_t wil_read_file_led_cfg(struct file *file, char __user *user_buf, 1534static ssize_t wil_read_file_led_cfg(struct file *file, char __user *user_buf,
1499 size_t count, loff_t *ppos) 1535 size_t count, loff_t *ppos)
1500{ 1536{
@@ -1749,6 +1785,7 @@ static const struct {
1749 {"mbox", 0444, &fops_mbox}, 1785 {"mbox", 0444, &fops_mbox},
1750 {"vrings", 0444, &fops_vring}, 1786 {"vrings", 0444, &fops_vring},
1751 {"stations", 0444, &fops_sta}, 1787 {"stations", 0444, &fops_sta},
1788 {"mids", 0444, &fops_mids},
1752 {"desc", 0444, &fops_txdesc}, 1789 {"desc", 0444, &fops_txdesc},
1753 {"bf", 0444, &fops_bf}, 1790 {"bf", 0444, &fops_bf},
1754 {"mem_val", 0644, &fops_memread}, 1791 {"mem_val", 0644, &fops_memread},