Commit | Line | Data |
---|---|---|
05bc1be6 PM |
1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | /* | |
3 | * Copyright IBM Corp. 2020 | |
4 | * | |
5 | * Author(s): | |
6 | * Pierre Morel <pmorel@linux.ibm.com> | |
7 | * | |
8 | */ | |
9 | ||
10 | int zpci_bus_device_register(struct zpci_dev *zdev, struct pci_ops *ops); | |
11 | void zpci_bus_device_unregister(struct zpci_dev *zdev); | |
05bc1be6 | 12 | |
a50297cf | 13 | int zpci_bus_scan_bus(struct zpci_bus *zbus); |
14c87ba8 | 14 | void zpci_bus_scan_busses(void); |
a50297cf | 15 | |
faf29a4d | 16 | int zpci_bus_scan_device(struct zpci_dev *zdev); |
95b3a8b4 NS |
17 | void zpci_bus_remove_device(struct zpci_dev *zdev, bool set_error); |
18 | ||
05bc1be6 PM |
19 | void zpci_release_device(struct kref *kref); |
20 | static inline void zpci_zdev_put(struct zpci_dev *zdev) | |
21 | { | |
c122383d NS |
22 | if (zdev) |
23 | kref_put(&zdev->kref, zpci_release_device); | |
05bc1be6 PM |
24 | } |
25 | ||
2a671f77 NS |
26 | static inline void zpci_zdev_get(struct zpci_dev *zdev) |
27 | { | |
28 | kref_get(&zdev->kref); | |
29 | } | |
30 | ||
05bc1be6 PM |
31 | int zpci_alloc_domain(int domain); |
32 | void zpci_free_domain(int domain); | |
33 | int zpci_setup_bus_resources(struct zpci_dev *zdev, | |
34 | struct list_head *resources); | |
35 | ||
7dcfe50f NS |
36 | static inline struct zpci_dev *zdev_from_bus(struct pci_bus *bus, |
37 | unsigned int devfn) | |
05bc1be6 PM |
38 | { |
39 | struct zpci_bus *zbus = bus->sysdata; | |
40 | ||
44510d6f | 41 | return (devfn >= ZPCI_FUNCTIONS_PER_BUS) ? NULL : zbus->function[devfn]; |
05bc1be6 | 42 | } |
b97bf44f | 43 |