@@ -1349,3 +1349,16 @@ void idxd_device_drv_remove(struct idxd_dev *idxd_dev)
if (test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
idxd_device_reset(idxd);
}
+
+static enum idxd_dev_type dev_types[] = {
+ IDXD_DEV_DSA,
+ IDXD_DEV_IAX,
+ IDXD_DEV_NONE,
+};
+
+struct idxd_device_driver idxd_drv = {
+ .type = dev_types,
+ .probe = idxd_device_drv_probe,
+ .remove = idxd_device_drv_remove,
+ .name = "idxd",
+};
@@ -58,6 +58,7 @@ struct idxd_device_driver {
};
extern struct idxd_device_driver dsa_drv;
+extern struct idxd_device_driver idxd_drv;
struct idxd_irq_entry {
struct idxd_device *idxd;
@@ -493,6 +494,8 @@ void idxd_mask_msix_vector(struct idxd_device *idxd, int vec_id);
void idxd_unmask_msix_vector(struct idxd_device *idxd, int vec_id);
/* device control */
+int idxd_register_idxd_drv(void);
+void idxd_unregister_idxd_drv(void);
int idxd_device_drv_probe(struct idxd_dev *idxd_dev);
void idxd_device_drv_remove(struct idxd_dev *idxd_dev);
int drv_enable_wq(struct idxd_wq *wq);
@@ -832,6 +832,10 @@ static int __init idxd_init_module(void)
if (err < 0)
return err;
+ err = idxd_driver_register(&idxd_drv);
+ if (err < 0)
+ goto err_idxd_driver_register;
+
err = idxd_driver_register(&dsa_drv);
if (err < 0)
goto err_dsa_driver_register;
@@ -851,6 +855,8 @@ static int __init idxd_init_module(void)
err_cdev_register:
idxd_driver_unregister(&dsa_drv);
err_dsa_driver_register:
+ idxd_driver_unregister(&idxd_drv);
+err_idxd_driver_register:
idxd_unregister_bus_type();
return err;
}
@@ -858,6 +864,7 @@ module_init(idxd_init_module);
static void __exit idxd_exit_module(void)
{
+ idxd_driver_unregister(&idxd_drv);
idxd_driver_unregister(&dsa_drv);
pci_unregister_driver(&idxd_pci_driver);
idxd_cdev_remove();