Lines Matching refs:afu

31 	struct cxl_afu *afu;  in cxl_pci_enable_device_hook()  local
35 afu = (struct cxl_afu *)phb->private_data; in cxl_pci_enable_device_hook()
37 if (!cxl_ops->link_ok(afu->adapter, afu)) { in cxl_pci_enable_device_hook()
53 return (cxl_ops->afu_check_and_enable(afu) == 0); in cxl_pci_enable_device_hook()
93 static void cxl_afu_configured_put(struct cxl_afu *afu) in cxl_afu_configured_put() argument
95 atomic_dec_if_positive(&afu->configured_state); in cxl_afu_configured_put()
98 static bool cxl_afu_configured_get(struct cxl_afu *afu) in cxl_afu_configured_get() argument
100 return atomic_inc_unless_negative(&afu->configured_state); in cxl_afu_configured_get()
104 struct cxl_afu *afu, int *_record) in cxl_pcie_config_info() argument
109 if (record > afu->crs_num) in cxl_pcie_config_info()
120 struct cxl_afu *afu; in cxl_pcie_read_config() local
125 afu = pci_bus_to_afu(bus); in cxl_pcie_read_config()
127 if (afu == NULL || !cxl_afu_configured_get(afu)) in cxl_pcie_read_config()
130 rc = cxl_pcie_config_info(bus, devfn, afu, &record); in cxl_pcie_read_config()
136 rc = cxl_ops->afu_cr_read8(afu, record, offset, &val8); in cxl_pcie_read_config()
140 rc = cxl_ops->afu_cr_read16(afu, record, offset, &val16); in cxl_pcie_read_config()
144 rc = cxl_ops->afu_cr_read32(afu, record, offset, &val32); in cxl_pcie_read_config()
152 cxl_afu_configured_put(afu); in cxl_pcie_read_config()
160 struct cxl_afu *afu; in cxl_pcie_write_config() local
162 afu = pci_bus_to_afu(bus); in cxl_pcie_write_config()
164 if (afu == NULL || !cxl_afu_configured_get(afu)) in cxl_pcie_write_config()
167 rc = cxl_pcie_config_info(bus, devfn, afu, &record); in cxl_pcie_write_config()
173 rc = cxl_ops->afu_cr_write8(afu, record, offset, val & 0xff); in cxl_pcie_write_config()
176 rc = cxl_ops->afu_cr_write16(afu, record, offset, val & 0xffff); in cxl_pcie_write_config()
179 rc = cxl_ops->afu_cr_write32(afu, record, offset, val); in cxl_pcie_write_config()
186 cxl_afu_configured_put(afu); in cxl_pcie_write_config()
209 int cxl_pci_vphb_add(struct cxl_afu *afu) in cxl_pci_vphb_add() argument
223 if (!afu->crs_num) in cxl_pci_vphb_add()
233 parent = afu->adapter->dev.parent; in cxl_pci_vphb_add()
248 phb->private_data = afu; in cxl_pci_vphb_add()
270 afu->phb = phb; in cxl_pci_vphb_add()
275 void cxl_pci_vphb_remove(struct cxl_afu *afu) in cxl_pci_vphb_remove() argument
280 if (!afu || !afu->phb) in cxl_pci_vphb_remove()
283 phb = afu->phb; in cxl_pci_vphb_remove()
284 afu->phb = NULL; in cxl_pci_vphb_remove()