Lines Matching refs:afu

131 	struct cxl_afu *afu = to_afu_chardev_m(device);  in mmio_size_show_master()  local
133 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->adapter->ps_size); in mmio_size_show_master()
140 struct cxl_afu *afu = to_afu_chardev_m(device); in pp_mmio_off_show() local
142 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->pp_offset); in pp_mmio_off_show()
149 struct cxl_afu *afu = to_afu_chardev_m(device); in pp_mmio_len_show() local
151 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->pp_size); in pp_mmio_len_show()
167 struct cxl_afu *afu = to_cxl_afu(device); in mmio_size_show() local
169 if (afu->pp_size) in mmio_size_show()
170 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->pp_size); in mmio_size_show()
171 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->adapter->ps_size); in mmio_size_show()
178 struct cxl_afu *afu = to_cxl_afu(device); in reset_store_afu() local
182 mutex_lock(&afu->contexts_lock); in reset_store_afu()
183 if (!idr_is_empty(&afu->contexts_idr)) { in reset_store_afu()
188 if ((rc = cxl_afu_reset(afu))) in reset_store_afu()
193 mutex_unlock(&afu->contexts_lock); in reset_store_afu()
201 struct cxl_afu *afu = to_cxl_afu(device); in irqs_min_show() local
203 return scnprintf(buf, PAGE_SIZE, "%i\n", afu->pp_irqs); in irqs_min_show()
210 struct cxl_afu *afu = to_cxl_afu(device); in irqs_max_show() local
212 return scnprintf(buf, PAGE_SIZE, "%i\n", afu->irqs_max); in irqs_max_show()
219 struct cxl_afu *afu = to_cxl_afu(device); in irqs_max_store() local
227 if (irqs_max < afu->pp_irqs) in irqs_max_store()
230 if (irqs_max > afu->adapter->user_irqs) in irqs_max_store()
233 afu->irqs_max = irqs_max; in irqs_max_store()
240 struct cxl_afu *afu = to_cxl_afu(device); in modes_supported_show() local
243 if (afu->modes_supported & CXL_MODE_DEDICATED) in modes_supported_show()
245 if (afu->modes_supported & CXL_MODE_DIRECTED) in modes_supported_show()
254 struct cxl_afu *afu = to_cxl_afu(device); in prefault_mode_show() local
256 switch (afu->prefault_mode) { in prefault_mode_show()
270 struct cxl_afu *afu = to_cxl_afu(device); in prefault_mode_store() local
283 afu->prefault_mode = mode; in prefault_mode_store()
291 struct cxl_afu *afu = to_cxl_afu(device); in mode_show() local
293 if (afu->current_mode == CXL_MODE_DEDICATED) in mode_show()
295 if (afu->current_mode == CXL_MODE_DIRECTED) in mode_show()
303 struct cxl_afu *afu = to_cxl_afu(device); in mode_store() local
308 mutex_lock(&afu->contexts_lock); in mode_store()
309 if (!idr_is_empty(&afu->contexts_idr)) in mode_store()
328 old_mode = afu->current_mode; in mode_store()
329 afu->current_mode = 0; in mode_store()
330 afu->num_procs = 0; in mode_store()
332 mutex_unlock(&afu->contexts_lock); in mode_store()
334 if ((rc = _cxl_afu_deactivate_mode(afu, old_mode))) in mode_store()
336 if ((rc = cxl_afu_activate_mode(afu, mode))) in mode_store()
341 mutex_unlock(&afu->contexts_lock); in mode_store()
434 struct cxl_afu *afu = to_cxl_afu(container_of(kobj->parent, struct device, kobj)); in afu_read_config() local
436 u64 i, j, val, size = afu->crs_len; in afu_read_config()
444 val = cxl_afu_cr_read64(afu, cr->cr, off & ~0x7); in afu_read_config()
479 static struct afu_config_record *cxl_sysfs_afu_new_cr(struct cxl_afu *afu, int cr_idx) in cxl_sysfs_afu_new_cr() argument
489 cr->device = cxl_afu_cr_read16(afu, cr_idx, PCI_DEVICE_ID); in cxl_sysfs_afu_new_cr()
490 cr->vendor = cxl_afu_cr_read16(afu, cr_idx, PCI_VENDOR_ID); in cxl_sysfs_afu_new_cr()
491 cr->class = cxl_afu_cr_read32(afu, cr_idx, PCI_CLASS_REVISION) >> 8; in cxl_sysfs_afu_new_cr()
505 cr->config_attr.size = afu->crs_len; in cxl_sysfs_afu_new_cr()
509 &afu->dev.kobj, "cr%i", cr->cr); in cxl_sysfs_afu_new_cr()
532 void cxl_sysfs_afu_remove(struct cxl_afu *afu) in cxl_sysfs_afu_remove() argument
538 device_remove_file(&afu->dev, &afu_attrs[i]); in cxl_sysfs_afu_remove()
540 list_for_each_entry_safe(cr, tmp, &afu->crs, list) { in cxl_sysfs_afu_remove()
546 int cxl_sysfs_afu_add(struct cxl_afu *afu) in cxl_sysfs_afu_add() argument
551 INIT_LIST_HEAD(&afu->crs); in cxl_sysfs_afu_add()
554 if ((rc = device_create_file(&afu->dev, &afu_attrs[i]))) in cxl_sysfs_afu_add()
558 for (i = 0; i < afu->crs_num; i++) { in cxl_sysfs_afu_add()
559 cr = cxl_sysfs_afu_new_cr(afu, i); in cxl_sysfs_afu_add()
564 list_add(&cr->list, &afu->crs); in cxl_sysfs_afu_add()
570 cxl_sysfs_afu_remove(afu); in cxl_sysfs_afu_add()
574 device_remove_file(&afu->dev, &afu_attrs[i]); in cxl_sysfs_afu_add()
578 int cxl_sysfs_afu_m_add(struct cxl_afu *afu) in cxl_sysfs_afu_m_add() argument
583 if ((rc = device_create_file(afu->chardev_m, &afu_master_attrs[i]))) in cxl_sysfs_afu_m_add()
591 device_remove_file(afu->chardev_m, &afu_master_attrs[i]); in cxl_sysfs_afu_m_add()
595 void cxl_sysfs_afu_m_remove(struct cxl_afu *afu) in cxl_sysfs_afu_m_remove() argument
600 device_remove_file(afu->chardev_m, &afu_master_attrs[i]); in cxl_sysfs_afu_m_remove()