idxd_dev
static int iaa_crypto_probe(struct idxd_dev *idxd_dev)
struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev);
struct device *dev = &idxd_dev->conf_dev;
static void iaa_crypto_remove(struct idxd_dev *idxd_dev)
struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev);
struct idxd_dev *idxd_dev = confdev_to_idxd_dev(dev);
if (idxd_dev->type == idxd_drv->type[i])
struct idxd_dev *idxd_dev = confdev_to_idxd_dev(dev);
return idxd_drv->probe(idxd_dev);
struct idxd_dev *idxd_dev = confdev_to_idxd_dev(dev);
idxd_drv->remove(idxd_dev);
ctx->idxd_dev.type = IDXD_DEV_CDEV_FILE;
struct idxd_dev *idxd_dev = &wq->idxd->idxd_dev;
const uint64_t comp_addr_align = is_dsa_dev(idxd_dev) ? 0x20 : 0x40;
if (is_dsa_dev(idxd_dev) && descriptor.opcode == DSA_OPCODE_BATCH &&
struct idxd_dev idxd_dev;
idxd_cdev->idxd_dev.type = IDXD_DEV_CDEV;
struct idxd_dev *idxd_dev = confdev_to_idxd_dev(dev);
static int idxd_user_drv_probe(struct idxd_dev *idxd_dev)
struct device *dev = &idxd_dev->conf_dev;
struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev);
return container_of(idxd_dev, struct idxd_user_context, idxd_dev);
static void idxd_user_drv_remove(struct idxd_dev *idxd_dev)
struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev);
static void idxd_dsa_drv_remove(struct idxd_dev *idxd_dev)
struct idxd_dev *idxd_dev;
idxd_dev = confdev_to_idxd_dev(dev);
if (is_idxd_dev(idxd_dev)) {
} else if (is_idxd_wq_dev(idxd_dev)) {
static int idxd_dsa_drv_probe(struct idxd_dev *idxd_dev)
int idxd_device_drv_probe(struct idxd_dev *idxd_dev)
struct idxd_device *idxd = idxd_dev_to_idxd(idxd_dev);
void idxd_device_drv_remove(struct idxd_dev *idxd_dev)
struct device *dev = &idxd_dev->conf_dev;
struct idxd_device *idxd = idxd_dev_to_idxd(idxd_dev);
static int idxd_dmaengine_drv_probe(struct idxd_dev *idxd_dev)
struct device *dev = &idxd_dev->conf_dev;
struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev);
static void idxd_dmaengine_drv_remove(struct idxd_dev *idxd_dev)
struct idxd_wq *wq = idxd_dev_to_wq(idxd_dev);
struct idxd_dev idxd_dev;
struct idxd_dev idxd_dev;
struct idxd_dev idxd_dev;
struct idxd_dev idxd_dev;
struct idxd_dev;
struct idxd_dev idxd_dev;
#define idxd_confdev(idxd) &idxd->idxd_dev.conf_dev
#define wq_confdev(wq) &wq->idxd_dev.conf_dev
#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)
#define idxd_dev_to_wq(idxd_dev) container_of(idxd_dev, struct idxd_wq, idxd_dev)
struct idxd_dev *idxd_dev = confdev_to_idxd_dev(dev);
return idxd_dev_to_idxd(idxd_dev);
struct idxd_dev *idxd_dev = confdev_to_idxd_dev(dev);
return idxd_dev_to_wq(idxd_dev);
struct idxd_dev *idxd_dev = confdev_to_idxd_dev(dev);
return container_of(idxd_dev, struct idxd_engine, idxd_dev);
struct idxd_dev *idxd_dev = confdev_to_idxd_dev(dev);
return container_of(idxd_dev, struct idxd_group, idxd_dev);
struct idxd_dev *idxd_dev = confdev_to_idxd_dev(dev);
return container_of(idxd_dev, struct idxd_cdev, idxd_dev);
static inline void idxd_dev_set_type(struct idxd_dev *idev, int type)
static inline bool is_dsa_dev(struct idxd_dev *idxd_dev)
return idxd_dev->type == IDXD_DEV_DSA;
static inline bool is_iax_dev(struct idxd_dev *idxd_dev)
return idxd_dev->type == IDXD_DEV_IAX;
static inline bool is_idxd_dev(struct idxd_dev *idxd_dev)
return is_dsa_dev(idxd_dev) || is_iax_dev(idxd_dev);
static inline bool is_idxd_wq_dev(struct idxd_dev *idxd_dev)
return idxd_dev->type == IDXD_DEV_WQ;
int (*probe)(struct idxd_dev *idxd_dev);
void (*remove)(struct idxd_dev *idxd_dev);
int idxd_device_drv_probe(struct idxd_dev *idxd_dev);
void idxd_device_drv_remove(struct idxd_dev *idxd_dev);
idxd_dev_set_type(&wq->idxd_dev, IDXD_DEV_WQ);
idxd_dev_set_type(&engine->idxd_dev, IDXD_DEV_ENGINE);
idxd_dev_set_type(&group->idxd_dev, IDXD_DEV_GROUP);
idxd_dev_set_type(&idxd->idxd_dev, idxd->data->type);
#define GRPWQCFG_OFFSET(idxd_dev, n, ofs) ((idxd_dev)->grpcfg_offset +\
#define GRPENGCFG_OFFSET(idxd_dev, n) ((idxd_dev)->grpcfg_offset + (n) * GRPCFG_SIZE + 32)
#define GRPFLGCFG_OFFSET(idxd_dev, n) ((idxd_dev)->grpcfg_offset + (n) * GRPCFG_SIZE + 40)
#define GRPWQCFG_OFFSET(idxd_dev, n, ofs) ((idxd_dev)->grpcfg_offset +\
#define GRPENGCFG_OFFSET(idxd_dev, n) ((idxd_dev)->grpcfg_offset + (n) * GRPCFG_SIZE + 32)
#define GRPFLGCFG_OFFSET(idxd_dev, n) ((idxd_dev)->grpcfg_offset + (n) * GRPCFG_SIZE + 40)