Lines Matching refs:zdev

42 static int zpci_bus_prepare_device(struct zpci_dev *zdev)  in zpci_bus_prepare_device()  argument
46 if (!zdev_enabled(zdev)) { in zpci_bus_prepare_device()
47 rc = zpci_enable_device(zdev); in zpci_bus_prepare_device()
50 rc = zpci_dma_init_device(zdev); in zpci_bus_prepare_device()
52 zpci_disable_device(zdev); in zpci_bus_prepare_device()
57 if (!zdev->has_resources) { in zpci_bus_prepare_device()
58 zpci_setup_bus_resources(zdev); in zpci_bus_prepare_device()
60 if (zdev->bars[i].res) in zpci_bus_prepare_device()
61 pci_bus_add_resource(zdev->zbus->bus, zdev->bars[i].res, 0); in zpci_bus_prepare_device()
75 int zpci_bus_scan_device(struct zpci_dev *zdev) in zpci_bus_scan_device() argument
80 rc = zpci_bus_prepare_device(zdev); in zpci_bus_scan_device()
84 pdev = pci_scan_single_device(zdev->zbus->bus, zdev->devfn); in zpci_bus_scan_device()
104 void zpci_bus_remove_device(struct zpci_dev *zdev, bool set_error) in zpci_bus_remove_device() argument
106 struct zpci_bus *zbus = zdev->zbus; in zpci_bus_remove_device()
109 if (!zdev->zbus->bus) in zpci_bus_remove_device()
112 pdev = pci_get_slot(zbus->bus, zdev->devfn); in zpci_bus_remove_device()
117 zpci_iov_remove_virtfn(pdev, zdev->vfn); in zpci_bus_remove_device()
139 struct zpci_dev *zdev; in zpci_bus_scan_bus() local
143 zdev = zbus->function[devfn]; in zpci_bus_scan_bus()
144 if (zdev && zdev->state == ZPCI_FN_STATE_CONFIGURED) { in zpci_bus_scan_bus()
145 rc = zpci_bus_prepare_device(zdev); in zpci_bus_scan_bus()
284 struct zpci_dev *zdev = to_zpci(pdev); in pcibios_bus_add_device() local
290 if (zdev->vfn) { in pcibios_bus_add_device()
291 zpci_iov_setup_virtfn(zdev->zbus, pdev, zdev->vfn); in pcibios_bus_add_device()
296 static int zpci_bus_add_device(struct zpci_bus *zbus, struct zpci_dev *zdev) in zpci_bus_add_device() argument
300 if (zbus->function[zdev->devfn]) { in zpci_bus_add_device()
301 pr_err("devfn %04x is already assigned\n", zdev->devfn); in zpci_bus_add_device()
305 zdev->zbus = zbus; in zpci_bus_add_device()
306 zbus->function[zdev->devfn] = zdev; in zpci_bus_add_device()
309 if (zbus->multifunction && !zdev->rid_available) { in zpci_bus_add_device()
313 rc = zpci_init_slot(zdev); in zpci_bus_add_device()
316 zdev->has_hp_slot = 1; in zpci_bus_add_device()
321 zbus->function[zdev->devfn] = NULL; in zpci_bus_add_device()
322 zdev->zbus = NULL; in zpci_bus_add_device()
327 int zpci_bus_device_register(struct zpci_dev *zdev, struct pci_ops *ops) in zpci_bus_device_register() argument
334 zdev->fid, ZPCI_NR_DEVICES); in zpci_bus_device_register()
338 if (zdev->devfn >= ZPCI_FUNCTIONS_PER_BUS) in zpci_bus_device_register()
341 if (!s390_pci_no_rid && zdev->rid_available) in zpci_bus_device_register()
342 zbus = zpci_bus_get(zdev->pchid); in zpci_bus_device_register()
345 zbus = zpci_bus_alloc(zdev->pchid); in zpci_bus_device_register()
355 rc = zpci_bus_create_pci_bus(zbus, zdev, ops); in zpci_bus_device_register()
360 rc = zpci_bus_add_device(zbus, zdev); in zpci_bus_device_register()
367 pr_err("Adding PCI function %08x failed\n", zdev->fid); in zpci_bus_device_register()
372 void zpci_bus_device_unregister(struct zpci_dev *zdev) in zpci_bus_device_unregister() argument
374 struct zpci_bus *zbus = zdev->zbus; in zpci_bus_device_unregister()
377 zbus->function[zdev->devfn] = NULL; in zpci_bus_device_unregister()