2014-02-09 19:24:15 +08: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-09 02:08:51 +08:00
|
|
|
#include "qemu/osdep.h"
|
2014-02-09 19:24:15 +08:00
|
|
|
#include "libqtest.h"
|
2019-05-23 22:35:07 +08:00
|
|
|
#include "qemu/module.h"
|
2018-08-17 18:48:27 +08:00
|
|
|
#include "libqos/qgraph.h"
|
|
|
|
|
|
|
|
typedef struct QIpoctal232 QIpoctal232;
|
|
|
|
|
|
|
|
struct QIpoctal232 {
|
|
|
|
QOSGraphObject obj;
|
|
|
|
};
|
2014-02-09 19:24:15 +08:00
|
|
|
|
|
|
|
/* Tests only initialization so far. TODO: Replace with functional tests */
|
2018-08-17 18:48:27 +08:00
|
|
|
static void nop(void *obj, void *data, QGuestAllocator *alloc)
|
2014-02-09 19:24:15 +08:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-08-17 18:48:27 +08:00
|
|
|
static void *ipoctal232_create(void *pci_bus, QGuestAllocator *alloc,
|
|
|
|
void *addr)
|
2014-02-09 19:24:15 +08:00
|
|
|
{
|
2018-08-17 18:48:27 +08:00
|
|
|
QIpoctal232 *ipoctal232 = g_new0(QIpoctal232, 1);
|
2014-02-09 19:24:15 +08:00
|
|
|
|
2018-08-17 18:48:27 +08:00
|
|
|
return &ipoctal232->obj;
|
|
|
|
}
|
2014-02-09 19:24:15 +08:00
|
|
|
|
2018-08-17 18:48:27 +08: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 19:24:15 +08:00
|
|
|
|
2018-08-17 18:48:27 +08:00
|
|
|
libqos_init(ipoctal232_register_nodes);
|
2014-02-09 19:24:15 +08:00
|
|
|
|
2018-08-17 18:48:27 +08:00
|
|
|
static void register_ipoctal232_test(void)
|
|
|
|
{
|
|
|
|
qos_add_test("nop", "ipoctal232", nop, NULL);
|
2014-02-09 19:24:15 +08:00
|
|
|
}
|
2018-08-17 18:48:27 +08:00
|
|
|
|
|
|
|
libqos_init(register_ipoctal232_test);
|