1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Copyright IBM Corp. 2020
10 int zpci_bus_device_register(struct zpci_dev *zdev, struct pci_ops *ops);
11 void zpci_bus_device_unregister(struct zpci_dev *zdev);
13 int zpci_bus_scan_bus(struct zpci_bus *zbus);
14 void zpci_bus_scan_busses(void);
16 int zpci_bus_scan_device(struct zpci_dev *zdev);
17 void zpci_bus_remove_device(struct zpci_dev *zdev, bool set_error);
19 void zpci_release_device(struct kref *kref);
20 static inline void zpci_zdev_put(struct zpci_dev *zdev)
22 kref_put(&zdev->kref, zpci_release_device);
25 static inline void zpci_zdev_get(struct zpci_dev *zdev)
27 kref_get(&zdev->kref);
30 int zpci_alloc_domain(int domain);
31 void zpci_free_domain(int domain);
32 int zpci_setup_bus_resources(struct zpci_dev *zdev,
33 struct list_head *resources);
35 static inline struct zpci_dev *get_zdev_by_bus(struct pci_bus *bus,
38 struct zpci_bus *zbus = bus->sysdata;
40 return (devfn >= ZPCI_FUNCTIONS_PER_BUS) ? NULL : zbus->function[devfn];