xref: /qemu/include/hw/fw-path-provider.h (revision aa1b35b9)
16b1566cbSPaolo Bonzini /*
26b1566cbSPaolo Bonzini  *  Firmware patch provider class and helpers definitions.
36b1566cbSPaolo Bonzini  *
46b1566cbSPaolo Bonzini  *  This program is free software; you can redistribute it and/or modify
56b1566cbSPaolo Bonzini  *  it under the terms of the GNU General Public License as published by
620c50a95SAlexey Kardashevskiy  *  the Free Software Foundation; either version 2 of the License,
720c50a95SAlexey Kardashevskiy  *  or (at your option) any later version.
86b1566cbSPaolo Bonzini  *
96b1566cbSPaolo Bonzini  *  This program is distributed in the hope that it will be useful,
106b1566cbSPaolo Bonzini  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
116b1566cbSPaolo Bonzini  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
126b1566cbSPaolo Bonzini  *  GNU General Public License for more details.
136b1566cbSPaolo Bonzini  *
146b1566cbSPaolo Bonzini  *  You should have received a copy of the GNU General Public License
156b1566cbSPaolo Bonzini  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
166b1566cbSPaolo Bonzini  */
176b1566cbSPaolo Bonzini 
186b1566cbSPaolo Bonzini #ifndef FW_PATH_PROVIDER_H
19175de524SMarkus Armbruster #define FW_PATH_PROVIDER_H
206b1566cbSPaolo Bonzini 
216b1566cbSPaolo Bonzini #include "qemu-common.h"
226b1566cbSPaolo Bonzini #include "qom/object.h"
236b1566cbSPaolo Bonzini 
246b1566cbSPaolo Bonzini #define TYPE_FW_PATH_PROVIDER "fw-path-provider"
256b1566cbSPaolo Bonzini 
266b1566cbSPaolo Bonzini #define FW_PATH_PROVIDER_CLASS(klass) \
276b1566cbSPaolo Bonzini      OBJECT_CLASS_CHECK(FWPathProviderClass, (klass), TYPE_FW_PATH_PROVIDER)
286b1566cbSPaolo Bonzini #define FW_PATH_PROVIDER_GET_CLASS(obj) \
296b1566cbSPaolo Bonzini     OBJECT_GET_CLASS(FWPathProviderClass, (obj), TYPE_FW_PATH_PROVIDER)
306b1566cbSPaolo Bonzini #define FW_PATH_PROVIDER(obj) \
316b1566cbSPaolo Bonzini      INTERFACE_CHECK(FWPathProvider, (obj), TYPE_FW_PATH_PROVIDER)
326b1566cbSPaolo Bonzini 
33*aa1b35b9SMarc-André Lureau typedef struct FWPathProvider FWPathProvider;
346b1566cbSPaolo Bonzini 
356b1566cbSPaolo Bonzini typedef struct FWPathProviderClass {
366b1566cbSPaolo Bonzini     InterfaceClass parent_class;
376b1566cbSPaolo Bonzini 
386b1566cbSPaolo Bonzini     char *(*get_dev_path)(FWPathProvider *p, BusState *bus, DeviceState *dev);
396b1566cbSPaolo Bonzini } FWPathProviderClass;
406b1566cbSPaolo Bonzini 
416b1566cbSPaolo Bonzini char *fw_path_provider_get_dev_path(FWPathProvider *p, BusState *bus,
426b1566cbSPaolo Bonzini                                     DeviceState *dev);
436b1566cbSPaolo Bonzini char *fw_path_provider_try_get_dev_path(Object *o, BusState *bus,
446b1566cbSPaolo Bonzini                                         DeviceState *dev);
456b1566cbSPaolo Bonzini 
466b1566cbSPaolo Bonzini #endif /* FW_PATH_PROVIDER_H */
47