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);
93 static void cxl_afu_configured_put(struct cxl_afu *afu)
95 atomic_dec_if_positive(&afu->configured_state);
98 static bool cxl_afu_configured_get(struct cxl_afu *afu)
100 return atomic_inc_unless_negative(&afu->configured_state);
104 struct cxl_afu *afu, int *_record)
109 if (record > afu->crs_num)
120 struct cxl_afu *afu;
125 afu = pci_bus_to_afu(bus);
126 /* Grab a reader lock on afu. */
127 if (afu == NULL || !cxl_afu_configured_get(afu))
130 rc = cxl_pcie_config_info(bus, devfn, afu, &record);
136 rc = cxl_ops->afu_cr_read8(afu, record, offset, &val8);
140 rc = cxl_ops->afu_cr_read16(afu, record, offset, &val16);
144 rc = cxl_ops->afu_cr_read32(afu, record, offset, &val32);
152 cxl_afu_configured_put(afu);
160 struct cxl_afu *afu;
162 afu = pci_bus_to_afu(bus);
163 /* Grab a reader lock on afu. */
164 if (afu == NULL || !cxl_afu_configured_get(afu))
167 rc = cxl_pcie_config_info(bus, devfn, afu, &record);
173 rc = cxl_ops->afu_cr_write8(afu, record, offset, val & 0xff);
176 rc = cxl_ops->afu_cr_write16(afu, record, offset, val & 0xffff);
179 rc = cxl_ops->afu_cr_write32(afu, record, offset, val);
186 cxl_afu_configured_put(afu);
209 int cxl_pci_vphb_add(struct cxl_afu *afu)
223 if (!afu->crs_num)
233 parent = afu->adapter->dev.parent;
248 phb->private_data = afu;
270 afu->phb = phb;
275 void cxl_pci_vphb_remove(struct cxl_afu *afu)
280 if (!afu || !afu->phb)
283 phb = afu->phb;
284 afu->phb = NULL;