Lines Matching refs:afu

31 	struct cxl_afu *afu;
35 afu = (struct cxl_afu *)phb->private_data;
37 if (!cxl_ops->link_ok(afu->adapter, afu)) {
53 return (cxl_ops->afu_check_and_enable(afu) == 0);
87 static void cxl_afu_configured_put(struct cxl_afu *afu)
89 atomic_dec_if_positive(&afu->configured_state);
92 static bool cxl_afu_configured_get(struct cxl_afu *afu)
94 return atomic_inc_unless_negative(&afu->configured_state);
98 struct cxl_afu *afu, int *_record)
103 if (record > afu->crs_num)
114 struct cxl_afu *afu;
119 afu = pci_bus_to_afu(bus);
120 /* Grab a reader lock on afu. */
121 if (afu == NULL || !cxl_afu_configured_get(afu))
124 rc = cxl_pcie_config_info(bus, devfn, afu, &record);
130 rc = cxl_ops->afu_cr_read8(afu, record, offset, &val8);
134 rc = cxl_ops->afu_cr_read16(afu, record, offset, &val16);
138 rc = cxl_ops->afu_cr_read32(afu, record, offset, &val32);
146 cxl_afu_configured_put(afu);
154 struct cxl_afu *afu;
156 afu = pci_bus_to_afu(bus);
157 /* Grab a reader lock on afu. */
158 if (afu == NULL || !cxl_afu_configured_get(afu))
161 rc = cxl_pcie_config_info(bus, devfn, afu, &record);
167 rc = cxl_ops->afu_cr_write8(afu, record, offset, val & 0xff);
170 rc = cxl_ops->afu_cr_write16(afu, record, offset, val & 0xffff);
173 rc = cxl_ops->afu_cr_write32(afu, record, offset, val);
180 cxl_afu_configured_put(afu);
202 int cxl_pci_vphb_add(struct cxl_afu *afu)
216 if (!afu->crs_num)
226 parent = afu->adapter->dev.parent;
241 phb->private_data = afu;
263 afu->phb = phb;
268 void cxl_pci_vphb_remove(struct cxl_afu *afu)
273 if (!afu || !afu->phb)
276 phb = afu->phb;
277 afu->phb = NULL;