Lines Matching refs:afu
32 #define CXL_AFU_MINOR_D(afu) (CXL_CARD_MINOR(afu->adapter) + 1 + (3 * afu->slice)) argument
33 #define CXL_AFU_MINOR_M(afu) (CXL_AFU_MINOR_D(afu) + 1) argument
34 #define CXL_AFU_MINOR_S(afu) (CXL_AFU_MINOR_D(afu) + 2) argument
35 #define CXL_AFU_MKDEV_D(afu) MKDEV(MAJOR(cxl_dev), CXL_AFU_MINOR_D(afu)) argument
36 #define CXL_AFU_MKDEV_M(afu) MKDEV(MAJOR(cxl_dev), CXL_AFU_MINOR_M(afu)) argument
37 #define CXL_AFU_MKDEV_S(afu) MKDEV(MAJOR(cxl_dev), CXL_AFU_MINOR_S(afu)) argument
51 struct cxl_afu *afu; in __afu_open() local
66 if (!(afu = adapter->afu[slice])) { in __afu_open()
70 get_device(&afu->dev); in __afu_open()
73 if (!afu->current_mode) in __afu_open()
81 if ((rc = cxl_context_init(ctx, afu, master, inode->i_mapping))) in __afu_open()
94 put_device(&afu->dev); in __afu_open()
121 put_device(&ctx->afu->dev); in afu_release()
170 work.num_interrupts = ctx->afu->pp_irqs; in afu_ioctl_start_work()
171 else if ((work.num_interrupts < ctx->afu->pp_irqs) || in afu_ioctl_start_work()
172 (work.num_interrupts > ctx->afu->irqs_max)) { in afu_ioctl_start_work()
399 static int cxl_add_chardev(struct cxl_afu *afu, dev_t devt, struct cdev *cdev, in cxl_add_chardev() argument
408 dev_err(&afu->dev, "Unable to add %s chardev: %i\n", desc, rc); in cxl_add_chardev()
412 dev = device_create(cxl_class, &afu->dev, devt, afu, in cxl_add_chardev()
413 "afu%i.%i%s", afu->adapter->adapter_num, afu->slice, postfix); in cxl_add_chardev()
415 dev_err(&afu->dev, "Unable to create %s chardev in sysfs: %i\n", desc, rc); in cxl_add_chardev()
428 int cxl_chardev_d_afu_add(struct cxl_afu *afu) in cxl_chardev_d_afu_add() argument
430 return cxl_add_chardev(afu, CXL_AFU_MKDEV_D(afu), &afu->afu_cdev_d, in cxl_chardev_d_afu_add()
431 &afu->chardev_d, "d", "dedicated", in cxl_chardev_d_afu_add()
435 int cxl_chardev_m_afu_add(struct cxl_afu *afu) in cxl_chardev_m_afu_add() argument
437 return cxl_add_chardev(afu, CXL_AFU_MKDEV_M(afu), &afu->afu_cdev_m, in cxl_chardev_m_afu_add()
438 &afu->chardev_m, "m", "master", in cxl_chardev_m_afu_add()
442 int cxl_chardev_s_afu_add(struct cxl_afu *afu) in cxl_chardev_s_afu_add() argument
444 return cxl_add_chardev(afu, CXL_AFU_MKDEV_S(afu), &afu->afu_cdev_s, in cxl_chardev_s_afu_add()
445 &afu->chardev_s, "s", "shared", in cxl_chardev_s_afu_add()
449 void cxl_chardev_afu_remove(struct cxl_afu *afu) in cxl_chardev_afu_remove() argument
451 if (afu->chardev_d) { in cxl_chardev_afu_remove()
452 cdev_del(&afu->afu_cdev_d); in cxl_chardev_afu_remove()
453 device_unregister(afu->chardev_d); in cxl_chardev_afu_remove()
454 afu->chardev_d = NULL; in cxl_chardev_afu_remove()
456 if (afu->chardev_m) { in cxl_chardev_afu_remove()
457 cdev_del(&afu->afu_cdev_m); in cxl_chardev_afu_remove()
458 device_unregister(afu->chardev_m); in cxl_chardev_afu_remove()
459 afu->chardev_m = NULL; in cxl_chardev_afu_remove()
461 if (afu->chardev_s) { in cxl_chardev_afu_remove()
462 cdev_del(&afu->afu_cdev_s); in cxl_chardev_afu_remove()
463 device_unregister(afu->chardev_s); in cxl_chardev_afu_remove()
464 afu->chardev_s = NULL; in cxl_chardev_afu_remove()
468 int cxl_register_afu(struct cxl_afu *afu) in cxl_register_afu() argument
470 afu->dev.class = cxl_class; in cxl_register_afu()
472 return device_register(&afu->dev); in cxl_register_afu()