summaryrefslogtreecommitdiffstats
path: root/drivers/dma/idxd/idxd.h
diff options
context:
space:
mode:
authorDave Jiang <dave.jiang@intel.com>2023-04-07 13:31:40 -0700
committerVinod Koul <vkoul@kernel.org>2023-04-12 23:18:45 +0530
commite6fd6d7e5f0fe4a17a08e892afb5db800e7794ec (patch)
treeb0ec0c7ce03e680e029680b06fdb7292ae933e28 /drivers/dma/idxd/idxd.h
parentfecae134ee10b7de69461c197450f7c05677e733 (diff)
downloadlinux-stable-e6fd6d7e5f0fe4a17a08e892afb5db800e7794ec.tar.gz
linux-stable-e6fd6d7e5f0fe4a17a08e892afb5db800e7794ec.tar.bz2
linux-stable-e6fd6d7e5f0fe4a17a08e892afb5db800e7794ec.zip
dmaengine: idxd: add a device to represent the file opened
Embed a struct device for the user file context in order to export sysfs attributes related with the opened file. Tie the lifetime of the file context to the device. The sysfs entry will be added under the char device. Tested-by: Tony Zhu <tony.zhu@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Co-developed-by: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Link: https://lore.kernel.org/r/20230407203143.2189681-14-fenghua.yu@intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/idxd/idxd.h')
-rw-r--r--drivers/dma/idxd/idxd.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/dma/idxd/idxd.h b/drivers/dma/idxd/idxd.h
index 9fb26d017285..bd544eb2ddcb 100644
--- a/drivers/dma/idxd/idxd.h
+++ b/drivers/dma/idxd/idxd.h
@@ -32,6 +32,7 @@ enum idxd_dev_type {
IDXD_DEV_GROUP,
IDXD_DEV_ENGINE,
IDXD_DEV_CDEV,
+ IDXD_DEV_CDEV_FILE,
IDXD_DEV_MAX_TYPE,
};
@@ -405,6 +406,7 @@ enum idxd_completion_status {
#define engine_confdev(engine) &engine->idxd_dev.conf_dev
#define group_confdev(group) &group->idxd_dev.conf_dev
#define cdev_dev(cdev) &cdev->idxd_dev.conf_dev
+#define user_ctx_dev(ctx) (&(ctx)->idxd_dev.conf_dev)
#define confdev_to_idxd_dev(dev) container_of(dev, struct idxd_dev, conf_dev)
#define idxd_dev_to_idxd(idxd_dev) container_of(idxd_dev, struct idxd_device, idxd_dev)