Lines Matching refs:zdev

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