summaryrefslogtreecommitdiff
path: root/drivers/pci/liveupdate.h
blob: 333ddd8f36c51409d8406283dee8bea61f18e4c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * PCI Live Update support (core API)
 *
 * Copyright (c) 2026, Google LLC.
 * David Matlack <dmatlack@google.com>
 */
#ifndef DRIVERS_PCI_LIVEUPDATE_H
#define DRIVERS_PCI_LIVEUPDATE_H

#include <linux/pci.h>

#ifdef CONFIG_PCI_LIVEUPDATE
void pci_liveupdate_setup_device(struct pci_dev *dev);
void pci_liveupdate_cleanup_device(struct pci_dev *dev);
void pci_liveupdate_freeze(struct pci_dev *dev);
bool pci_liveupdate_preserve_bus_numbers(void);
bool pci_liveupdate_refuse_bus_numbers(struct pci_bus *bus, struct pci_dev *dev);
int pci_liveupdate_adopt_acs(struct pci_dev *dev);
int pci_liveupdate_adopt_ari(struct pci_dev *dev);
bool pci_liveupdate_is_outgoing(struct pci_dev *dev);
#else
static inline void pci_liveupdate_setup_device(struct pci_dev *dev)
{
}

static inline void pci_liveupdate_cleanup_device(struct pci_dev *dev)
{
}

static inline void pci_liveupdate_freeze(struct pci_dev *dev)
{
}

static inline bool pci_liveupdate_preserve_bus_numbers(void)
{
	return false;
}

static inline bool pci_liveupdate_refuse_bus_numbers(struct pci_bus *bus,
						     struct pci_dev *dev)
{
	return false;
}

static inline int pci_liveupdate_adopt_acs(struct pci_dev *dev)
{
	return -EINVAL;
}

static inline int pci_liveupdate_adopt_ari(struct pci_dev *dev)
{
	return -EINVAL;
}

static inline bool pci_liveupdate_is_outgoing(struct pci_dev *dev)
{
	return false;
}
#endif

#endif /* DRIVERS_PCI_LIVEUPDATE_H */