2014-02-09 15:24:15 +04:00
|
|
|
/*
|
|
|
|
* QTest testcase for IndustryPack Octal-RS232
|
|
|
|
*
|
|
|
|
* Copyright (c) 2014 SUSE LINUX Products GmbH
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
2016-02-08 21:08:51 +03:00
|
|
|
#include "qemu/osdep.h"
|
2020-08-04 21:00:40 +03:00
|
|
|
#include "libqos/libqtest.h"
|
2019-05-23 17:35:07 +03:00
|
|
|
#include "qemu/module.h"
|
2018-08-17 13:48:27 +03:00
|
|
|
#include "libqos/qgraph.h"
|
|
|
|
|
|
|
|
typedef struct QIpoctal232 QIpoctal232;
|
|
|
|
|
|
|
|
struct QIpoctal232 {
|
|
|
|
QOSGraphObject obj;
|
|
|
|
};
|
2014-02-09 15:24:15 +04:00
|
|
|
|
|
|
|
/* Tests only initialization so far. TODO: Replace with functional tests */
|
2018-08-17 13:48:27 +03:00
|
|
|
static void nop(void *obj, void *data, QGuestAllocator *alloc)
|
2014-02-09 15:24:15 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-08-17 13:48:27 +03:00
|
|
|
static void *ipoctal232_create(void *pci_bus, QGuestAllocator *alloc,
|
|
|
|
void *addr)
|
2014-02-09 15:24:15 +04:00
|
|
|
{
|
2018-08-17 13:48:27 +03:00
|
|
|
QIpoctal232 *ipoctal232 = g_new0(QIpoctal232, 1);
|
2014-02-09 15:24:15 +04:00
|
|
|
|
2018-08-17 13:48:27 +03:00
|
|
|
return &ipoctal232->obj;
|
|
|
|
}
|
2014-02-09 15:24:15 +04:00
|
|
|
|
2018-08-17 13:48:27 +03:00
|
|
|
static void ipoctal232_register_nodes(void)
|
|
|
|
{
|
|
|
|
qos_node_create_driver("ipoctal232", ipoctal232_create);
|
|
|
|
qos_node_consumes("ipoctal232", "ipack", &(QOSGraphEdgeOptions) {
|
|
|
|
.extra_device_opts = "bus=ipack0.0",
|
|
|
|
});
|
|
|
|
}
|
2014-02-09 15:24:15 +04:00
|
|
|
|
2018-08-17 13:48:27 +03:00
|
|
|
libqos_init(ipoctal232_register_nodes);
|
2014-02-09 15:24:15 +04:00
|
|
|
|
2018-08-17 13:48:27 +03:00
|
|
|
static void register_ipoctal232_test(void)
|
|
|
|
{
|
|
|
|
qos_add_test("nop", "ipoctal232", nop, NULL);
|
2014-02-09 15:24:15 +04:00
|
|
|
}
|
2018-08-17 13:48:27 +03:00
|
|
|
|
|
|
|
libqos_init(register_ipoctal232_test);
|