lkml.org 
[lkml]   [2018]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH v3 3/5] iommu/amd - Add a README variable for the IOMMU debugfs
From
Date
Provide help text via a filesystem entry

Signed-off-by: Gary R Hook <gary.hook@amd.com>
---
drivers/iommu/amd_iommu_debugfs.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

diff --git a/drivers/iommu/amd_iommu_debugfs.c b/drivers/iommu/amd_iommu_debugfs.c
index 170863e5e86b..d95428b1ef90 100644
--- a/drivers/iommu/amd_iommu_debugfs.c
+++ b/drivers/iommu/amd_iommu_debugfs.c
@@ -92,6 +92,31 @@ static const struct file_operations amd_iommu_debugfs_dtecount_ops = {
.write = NULL,
};

+static char readmetext[] =
+"count Count of active devices\n"
+"verbose Provide additional descriptive text\n"
+"\n";
+
+static ssize_t amd_iommu_debugfs_readme_read(struct file *filp,
+ char __user *ubuf,
+ size_t count, loff_t *offp)
+{
+ ssize_t ret;
+
+ ret = simple_read_from_buffer(ubuf, count, offp,
+ readmetext, strlen(readmetext));
+
+ return ret;
+}
+
+
+static const struct file_operations amd_iommu_debugfs_readme_ops = {
+ .owner = THIS_MODULE,
+ .open = simple_open,
+ .read = amd_iommu_debugfs_readme_read,
+ .write = NULL,
+};
+
void amd_iommu_debugfs_setup(struct amd_iommu *iommu)
{
char name[MAX_NAME_LEN + 1];
@@ -125,6 +150,12 @@ void amd_iommu_debugfs_setup(struct amd_iommu *iommu)
if (!d_dte)
goto err;

+ d_dte = debugfs_create_file("README", 0400,
+ iommu->debugfs_instance, iommu,
+ &amd_iommu_debugfs_readme_ops);
+ if (!d_dte)
+ goto err;
+
return;

err:
\
 
 \ /
  Last update: 2018-03-15 00:06    [W:0.095 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site