/* SPDX-License-Identifier: GPL-2.0 */ /* * PCI Live Update support (Public/Driver API) * * Copyright (c) 2026, Google LLC. * David Matlack */ #ifndef LINUX_PCI_LIVEUPDATE_H #define LINUX_PCI_LIVEUPDATE_H #include #include #include #include /** * struct pci_liveupdate - PCI Live Update state for a struct pci_dev * @outgoing: State preserved for the next kernel. * @incoming: State preserved by the previous kernel. * @was_incoming: True if this struct pci_dev was incoming-preserved when it was * set up, i.e. it was matched to state preserved by the previous * kernel. Unlike @incoming, this is never cleared, so it stays * true after the device finishes participating in Live Update. * @frozen: True if the outgoing preservation status of this device is frozen * and thus cannot be changed. */ struct pci_liveupdate { struct pci_dev_ser *outgoing; struct pci_dev_ser *incoming; bool was_incoming; bool frozen; }; struct pci_dev; #ifdef CONFIG_PCI_LIVEUPDATE int pci_liveupdate_register_flb(struct liveupdate_file_handler *fh); void pci_liveupdate_unregister_flb(struct liveupdate_file_handler *fh); int pci_liveupdate_preserve(struct pci_dev *dev); void pci_liveupdate_unpreserve(struct pci_dev *dev); void pci_liveupdate_finish(struct pci_dev *dev); bool pci_liveupdate_is_incoming(struct pci_dev *dev); #else static inline int pci_liveupdate_register_flb(struct liveupdate_file_handler *fh) { return -EOPNOTSUPP; } static inline void pci_liveupdate_unregister_flb(struct liveupdate_file_handler *fh) { } static inline int pci_liveupdate_preserve(struct pci_dev *dev) { return -EOPNOTSUPP; } static inline void pci_liveupdate_unpreserve(struct pci_dev *dev) { } static inline void pci_liveupdate_finish(struct pci_dev *dev) { } static inline bool pci_liveupdate_is_incoming(struct pci_dev *dev) { return false; } #endif #endif /* LINUX_PCI_LIVEUPDATE_H */