blob: 8e1d45651cfe5bfbff8928f15f522c78b285e334 [file] [log] [blame]
Paolo Bonzini6b1566c2014-03-17 13:40:23 +11001/*
2 * Firmware patch provider class and helpers definitions.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
Alexey Kardashevskiy20c50a92014-03-27 01:13:02 +11006 * the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
Paolo Bonzini6b1566c2014-03-17 13:40:23 +11008 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef FW_PATH_PROVIDER_H
Markus Armbruster175de522016-06-29 15:29:06 +020019#define FW_PATH_PROVIDER_H
Paolo Bonzini6b1566c2014-03-17 13:40:23 +110020
Paolo Bonzini6b1566c2014-03-17 13:40:23 +110021#include "qom/object.h"
22
23#define TYPE_FW_PATH_PROVIDER "fw-path-provider"
24
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040025typedef struct FWPathProviderClass FWPathProviderClass;
Eduardo Habkost8110fa12020-08-31 17:07:33 -040026DECLARE_CLASS_CHECKERS(FWPathProviderClass, FW_PATH_PROVIDER,
27 TYPE_FW_PATH_PROVIDER)
Paolo Bonzini6b1566c2014-03-17 13:40:23 +110028#define FW_PATH_PROVIDER(obj) \
29 INTERFACE_CHECK(FWPathProvider, (obj), TYPE_FW_PATH_PROVIDER)
30
Marc-André Lureauaa1b35b2018-12-04 18:20:06 +040031typedef struct FWPathProvider FWPathProvider;
Paolo Bonzini6b1566c2014-03-17 13:40:23 +110032
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040033struct FWPathProviderClass {
Paolo Bonzini6b1566c2014-03-17 13:40:23 +110034 InterfaceClass parent_class;
35
36 char *(*get_dev_path)(FWPathProvider *p, BusState *bus, DeviceState *dev);
Eduardo Habkostdb1015e2020-09-03 16:43:22 -040037};
Paolo Bonzini6b1566c2014-03-17 13:40:23 +110038
39char *fw_path_provider_get_dev_path(FWPathProvider *p, BusState *bus,
40 DeviceState *dev);
41char *fw_path_provider_try_get_dev_path(Object *o, BusState *bus,
42 DeviceState *dev);
43
44#endif /* FW_PATH_PROVIDER_H */