• Home
  • Raw
  • Download

Lines Matching refs:cr

508 	int cr;  member
519 struct afu_config_record *cr = to_cr(kobj); in vendor_show() local
521 return scnprintf(buf, PAGE_SIZE, "0x%.4x\n", cr->vendor); in vendor_show()
527 struct afu_config_record *cr = to_cr(kobj); in device_show() local
529 return scnprintf(buf, PAGE_SIZE, "0x%.4x\n", cr->device); in device_show()
535 struct afu_config_record *cr = to_cr(kobj); in class_show() local
537 return scnprintf(buf, PAGE_SIZE, "0x%.6x\n", cr->class); in class_show()
544 struct afu_config_record *cr = to_cr(kobj); in afu_read_config() local
550 rc = cxl_ops->afu_cr_read64(afu, cr->cr, off & ~0x7, &val); in afu_read_config()
576 struct afu_config_record *cr = to_cr(kobj); in release_afu_config_record() local
578 kfree(cr); in release_afu_config_record()
589 struct afu_config_record *cr; in cxl_sysfs_afu_new_cr() local
592 cr = kzalloc(sizeof(struct afu_config_record), GFP_KERNEL); in cxl_sysfs_afu_new_cr()
593 if (!cr) in cxl_sysfs_afu_new_cr()
596 cr->cr = cr_idx; in cxl_sysfs_afu_new_cr()
598 rc = cxl_ops->afu_cr_read16(afu, cr_idx, PCI_DEVICE_ID, &cr->device); in cxl_sysfs_afu_new_cr()
601 rc = cxl_ops->afu_cr_read16(afu, cr_idx, PCI_VENDOR_ID, &cr->vendor); in cxl_sysfs_afu_new_cr()
604 rc = cxl_ops->afu_cr_read32(afu, cr_idx, PCI_CLASS_REVISION, &cr->class); in cxl_sysfs_afu_new_cr()
607 cr->class >>= 8; in cxl_sysfs_afu_new_cr()
618 sysfs_bin_attr_init(&cr->config_attr); in cxl_sysfs_afu_new_cr()
619 cr->config_attr.attr.name = "config"; in cxl_sysfs_afu_new_cr()
620 cr->config_attr.attr.mode = S_IRUSR; in cxl_sysfs_afu_new_cr()
621 cr->config_attr.size = afu->crs_len; in cxl_sysfs_afu_new_cr()
622 cr->config_attr.read = afu_read_config; in cxl_sysfs_afu_new_cr()
624 rc = kobject_init_and_add(&cr->kobj, &afu_config_record_type, in cxl_sysfs_afu_new_cr()
625 &afu->dev.kobj, "cr%i", cr->cr); in cxl_sysfs_afu_new_cr()
629 rc = sysfs_create_bin_file(&cr->kobj, &cr->config_attr); in cxl_sysfs_afu_new_cr()
633 rc = kobject_uevent(&cr->kobj, KOBJ_ADD); in cxl_sysfs_afu_new_cr()
637 return cr; in cxl_sysfs_afu_new_cr()
639 sysfs_remove_bin_file(&cr->kobj, &cr->config_attr); in cxl_sysfs_afu_new_cr()
641 kobject_put(&cr->kobj); in cxl_sysfs_afu_new_cr()
644 kfree(cr); in cxl_sysfs_afu_new_cr()
651 struct afu_config_record *cr, *tmp; in cxl_sysfs_afu_remove() local
665 list_for_each_entry_safe(cr, tmp, &afu->crs, list) { in cxl_sysfs_afu_remove()
666 sysfs_remove_bin_file(&cr->kobj, &cr->config_attr); in cxl_sysfs_afu_remove()
667 kobject_put(&cr->kobj); in cxl_sysfs_afu_remove()
674 struct afu_config_record *cr; in cxl_sysfs_afu_add() local
707 cr = cxl_sysfs_afu_new_cr(afu, i); in cxl_sysfs_afu_add()
708 if (IS_ERR(cr)) { in cxl_sysfs_afu_add()
709 rc = PTR_ERR(cr); in cxl_sysfs_afu_add()
712 list_add(&cr->list, &afu->crs); in cxl_sysfs_afu_add()