dmaengine: idxd: add wq driver name support for accel-config user tool
[linux-2.6-microblaze.git] / drivers / dma / idxd / idxd.h
index e269ca1..1e89c80 100644 (file)
@@ -159,6 +159,8 @@ struct idxd_cdev {
        int minor;
 };
 
+#define DRIVER_NAME_SIZE               128
+
 #define IDXD_ALLOCATED_BATCH_SIZE      128U
 #define WQ_NAME_SIZE   1024
 #define WQ_TYPE_SIZE   10
@@ -227,6 +229,8 @@ struct idxd_wq {
        /* Lock to protect upasid_xa access. */
        struct mutex uc_lock;
        struct xarray upasid_xa;
+
+       char driver_name[DRIVER_NAME_SIZE + 1];
 };
 
 struct idxd_engine {
@@ -646,6 +650,11 @@ static inline void idxd_wqcfg_set_max_batch_shift(int idxd_type, union wqcfg *wq
                wqcfg->max_batch_shift = max_batch_shift;
 }
 
+static inline int idxd_wq_driver_name_match(struct idxd_wq *wq, struct device *dev)
+{
+       return (strncmp(wq->driver_name, dev->driver->name, strlen(dev->driver->name)) == 0);
+}
+
 int __must_check __idxd_driver_register(struct idxd_device_driver *idxd_drv,
                                        struct module *module, const char *mod_name);
 #define idxd_driver_register(driver) \